[71604] trunk/base/src

raimue at macports.org raimue at macports.org
Fri Sep 17 17:23:01 PDT 2010


Revision: 71604
          http://trac.macports.org/changeset/71604
Author:   raimue at macports.org
Date:     2010-09-17 17:23:00 -0700 (Fri, 17 Sep 2010)
Log Message:
-----------
Due to privilege escalation we cannot use $HOME/.ccache anymore for ccache.
Add new ccache_dir and ccache_size options, default path is
${portdbpath}/build/.ccache and a size of 2 GB.

Modified Paths:
--------------
    trunk/base/src/macports1.0/macports.tcl
    trunk/base/src/port1.0/portconfigure.tcl

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2010-09-18 00:13:12 UTC (rev 71603)
+++ trunk/base/src/macports1.0/macports.tcl	2010-09-18 00:23:00 UTC (rev 71604)
@@ -44,7 +44,7 @@
         portinstalltype portarchivemode portarchivepath portarchivetype portautoclean \
         porttrace portverbose keeplogs destroot_umask variants_conf rsync_server rsync_options \
         rsync_dir startupitem_type place_worksymlink xcodeversion xcodebuildcmd \
-        mp_remote_url mp_remote_submit_url configureccache configuredistcc configurepipe buildnicevalue buildmakejobs \
+        mp_remote_url mp_remote_submit_url configureccache ccache_dir ccache_size configuredistcc configurepipe buildnicevalue buildmakejobs \
         applications_dir frameworks_dir developer_dir universal_archs build_arch macosx_deployment_target \
         macportsuser proxy_override_env proxy_http proxy_https proxy_ftp proxy_rsync proxy_skip"
     variable user_options "submitter_name submitter_email submitter_key"
@@ -53,7 +53,7 @@
         registry.path registry.format registry.installtype portarchivemode portarchivepath \
         portarchivetype archivefetch_pubkeys portautoclean porttrace keeplogs portverbose destroot_umask \
         rsync_server rsync_options rsync_dir startupitem_type place_worksymlink macportsuser \
-        mp_remote_url mp_remote_submit_url configureccache configuredistcc configurepipe buildnicevalue buildmakejobs \
+        mp_remote_url mp_remote_submit_url configureccache ccache_dir ccache_size configuredistcc configurepipe buildnicevalue buildmakejobs \
         applications_dir current_phase frameworks_dir developer_dir universal_archs build_arch \
         os_arch os_endian os_version os_major os_platform macosx_version macosx_deployment_target $user_options"
 
@@ -457,6 +457,8 @@
     global macports::xcodebuildcmd
     global macports::xcodeversion
     global macports::configureccache
+    global macports::ccache_dir
+    global macports::ccache_size
     global macports::configuredistcc
     global macports::configurepipe
     global macports::buildnicevalue
@@ -783,6 +785,12 @@
     if {![info exists macports::configureccache]} {
         set macports::configureccache no
     }
+    if {![info exists macports::ccache_dir]} {
+        set macports::ccache_dir [file join $portdbpath build .ccache]
+    }
+    if {![info exists macports::ccache_size]} {
+        set macports::ccache_size "2G"
+    }
     if {![info exists macports::configuredistcc]} {
         set macports::configuredistcc no
     }
@@ -942,6 +950,9 @@
         }
     }
 
+    # add ccache to environment
+    set env(CCACHE_DIR) ${macports::ccache_dir}
+
     # load the quick index
     _mports_load_quickindex
 

Modified: trunk/base/src/port1.0/portconfigure.tcl
===================================================================
--- trunk/base/src/port1.0/portconfigure.tcl	2010-09-18 00:13:12 UTC (rev 71603)
+++ trunk/base/src/port1.0/portconfigure.tcl	2010-09-18 00:23:00 UTC (rev 71604)
@@ -214,6 +214,21 @@
         default { return -code error "Invalid value for configure.compiler" }
     }
     ui_debug "Using compiler '$name'"
+
+    # Additional ccache directory setup
+    global configureccache ccache_dir ccache_size macportsuser
+    if {${configureccache}} {
+        elevateToRoot "configure ccache"
+        if [catch {
+                file mkdir ${ccache_dir}
+                file attributes ${ccache_dir} -owner ${macportsuser} -permissions 0755
+                exec ccache -M ${ccache_size} >/dev/null
+            } result] {
+            ui_warn "ccache_dir ${ccache_dir} could not be initialized; disabling ccache: $result"
+            set configureccache no
+        }
+        dropPrivileges
+    }
 }
 
 # internal function to choose the default configure.build_arch and
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100917/5f6c7507/attachment.html>


More information about the macports-changes mailing list