Bug 1091118 - Part 2: Do not use the top-level cache file for freetype2 subconfigure. r=gps, a=lmandel
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 30 Oct 2014 14:35:01 +0900
changeset 225871 16df73a8ddc1
parent 225870 49069150dab1
child 225872 8f974876367e
push id4047
push userryanvm@gmail.com
push date2014-10-30 14:31 +0000
treeherdermozilla-beta@8f974876367e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps, lmandel
bugs1091118
milestone34.0
Bug 1091118 - Part 2: Do not use the top-level cache file for freetype2 subconfigure. r=gps, a=lmandel We modify the environment before running freetype2 configure. When it uses the same cache file, it stores knowledge about that environment in the cache file. The cache file is then reused to configure in js/src, with yet again a different environment, which makes subconfigure.py clear the cache because of the differences. The configure in js/src is however invoked with the same environment as the main configure was invoked with (mostly), so without freetype2 on the way, reusing the cache for it works as expected. In fact, it works better with the cache because of things coming from mozconfig that are not exported. With freetype2 on the way, as mentioned above, the cache is cleared. Without the cache, js/src/configure does new detections with a possibly different environment, and stores that in the cache. Until the next build, which then uses that different cache for the top-level configure. This results in subtle differences in the HOST_CC/HOST_CXX variables on android builds because those variables are not exported from mozconfig, depending on PATH, what the builder was building before, and if the build is a clobber. Avoiding the freetype2 subconfigure writing its environment variables change to the top-level cache makes the cache never invalidate for js/src.
configure.in
--- a/configure.in
+++ b/configure.in
@@ -9076,18 +9076,21 @@ if test "$MOZ_TREE_FREETYPE"; then
    export ZLIB_CFLAGS="$MOZ_ZLIB_CFLAGS "
    export ZLIB_LIBS="$MOZ_ZLIB_LIBS "
    export CONFIG_FILES="unix-cc.mk:unix-cc.in unix-def.mk:unix-def.in freetype-config freetype2.pc:freetype2.in"
    ac_configure_args="$ac_configure_args --host=$target --disable-shared --with-pic=yes --with-zlib=yes --without-bzip2 --with-png=yes --without-harfbuzz"
 
    if ! test -e modules; then
      mkdir modules
    fi
-
-   AC_OUTPUT_SUBDIRS(modules/freetype2,$cache_file)
+   # Only export CC and CXX for the subconfigure, and avoid spilling that
+   # further down the road.
+   (export CC CXX;
+    AC_OUTPUT_SUBDIRS(modules/freetype2)
+   ) || exit 1
 fi
 
 if test -z "$direct_nspr_config"; then
     dnl ========================================================
     dnl = Setup a nice relatively clean build environment for
     dnl = sub-configures.
     dnl ========================================================
     CC="$_SUBDIR_CC"