Bug 1269517 - Fix various environment variables that may contain posix-style paths when invoking the js subconfigure. r=glandium
authorChris Manchester <cmanchester@mozilla.com>
Tue, 26 Jul 2016 15:27:19 -0700
changeset 348900 8457e2d24535a319b3ef7d5cda4d201b7f78e3b1
parent 348899 86ee73866fc0482659456b3d6055ab0503e09a91
child 348901 d3b5b77d0dccfcbf1dad51296b7f0d4b778520e2
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1269517
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1269517 - Fix various environment variables that may contain posix-style paths when invoking the js subconfigure. r=glandium MozReview-Commit-ID: IuxdjO2P9aQ
build/subconfigure.py
--- a/build/subconfigure.py
+++ b/build/subconfigure.py
@@ -201,26 +201,29 @@ def prepare(srcdir, objdir, shell, args)
     if os.path.exists(data_file):
         with open(data_file, 'rb') as f:
             data = pickle.load(f)
             previous_args = data['args']
 
     # Msys likes to break environment variables and command line arguments,
     # so read those from stdin, as they are passed from the configure script
     # when necessary (on windows).
-    # However, for some reason, $PATH is not handled like other environment
-    # variables, and msys remangles it even when giving it is already a msys
-    # $PATH. Fortunately, the mangling/demangling is just find for $PATH, so
-    # we can just take the value from the environment. Msys will convert it
-    # back properly when calling subconfigure.
     input = sys.stdin.read()
     if input:
         data = {a: b for [a, b] in eval(input)}
         environ = {a: b for a, b in data['env']}
-        environ['PATH'] = os.environ['PATH']
+        # These environment variables as passed from old-configure may contain
+        # posix-style paths, which will not be meaningful to the js
+        # subconfigure, which runs as a native python process, so use their
+        # values from the environment. In the case of autoconf implemented
+        # subconfigures, Msys will re-convert them properly.
+        for var in ('HOME', 'TERM', 'PATH', 'TMPDIR', 'TMP',
+                    'TEMP', 'INCLUDE'):
+            if var in environ and var in os.environ:
+                environ[var] = os.environ[var]
         args = data['args']
     else:
         environ = os.environ
 
     args, others = parser.parse_known_args(args)
 
     data = {
         'target': args.target,