Bug 1291944 - Search for nsis in msys environment; r=glandium
authorGregory Szorc <gps@mozilla.com>
Mon, 15 Aug 2016 17:34:42 -0700
changeset 309655 0253b9b9684a7a716003db28baff826f568a3984
parent 309654 72696d61d5fcb97440ed1cda8a4f9b5767d62f91
child 309656 c89c51c5414d2688e8a5c236f082febcdd82939a
push id80665
push userkwierso@gmail.com
push dateWed, 17 Aug 2016 05:07:09 +0000
treeherdermozilla-inbound@5aa02060f7c4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1291944
milestone51.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 1291944 - Search for nsis in msys environment; r=glandium Previously, configure found nsis on PATH, likely from MozillaBuild. In our msys2 environment, nsis is installed under /mingw32. We supplement moz.configure to look for nsis in this location. MozReview-Commit-ID: 34mjoCrI7B6
moz.configure
--- a/moz.configure
+++ b/moz.configure
@@ -246,19 +246,36 @@ def check_for_hunspell(value, compile_en
 
 system_hunspell = pkg_check_modules('MOZ_HUNSPELL', 'hunspell',
                                     check_for_hunspell)
 
 set_config('MOZ_SYSTEM_HUNSPELL', system_hunspell)
 
 
 @depends(target)
+@imports('os')
 def makensis_progs(target):
-    if target.kernel == 'WINNT':
-        return ('makensis-3.0b3.exe', 'makensis-3.0b1.exe', 'makensis.exe', 'makensis')
+    if target.kernel != 'WINNT':
+        return
+
+    candidates = [
+        'makensis-3.0b3.exe',
+        'makensis-3.0b1.exe',
+        'makensis.exe',
+        'makensis',
+    ]
+
+    # Look for nsis installed by msys environment. But only the 32-bit version.
+    # We use an absolute path and insert as the first entry so it is preferred
+    # over a 64-bit exe that may be in PATH.
+    if 'MSYSTEM_PREFIX' in os.environ:
+        prefix = os.path.dirname(os.environ['MSYSTEM_PREFIX'])
+        candidates.insert(0, os.path.join(prefix, 'mingw32', 'bin', 'makensis.exe'))
+
+    return tuple(candidates)
 
 nsis = check_prog('MAKENSISU', makensis_progs)
 
 # Make sure the version of makensis is up to date.
 @depends_if(nsis)
 @checking('for NSIS version')
 @imports('re')
 def nsis_version(nsis):