diff options
author | William Deegan <bill@baddogconsulting.com> | 2023-05-04 10:41:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-04 10:41:47 -0700 |
commit | fcb92c4ff1503ac0cf920d26f771b8f47386f4dc (patch) | |
tree | 6199e98610c76c39efe59a4dc6e91d31e5a13e96 | |
parent | 84859d565216af998f817e05d0696f3423bb7216 (diff) | |
parent | 4997bbda807ebdbcd11b1282981c3abb81dd8ee1 (diff) | |
download | scons-git-fcb92c4ff1503ac0cf920d26f771b8f47386f4dc.tar.gz |
Merge pull request #4307 from mwichmann/bug/msys-python
Fix Configure tests on win32/msys2
-rw-r--r-- | CHANGES.txt | 3 | ||||
-rw-r--r-- | RELEASE.txt | 4 | ||||
-rw-r--r-- | SCons/SConf.py | 6 | ||||
-rw-r--r-- | SCons/Tool/mingw.py | 3 |
4 files changed, 15 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index ddb957ae1..d4ad973a0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -196,6 +196,9 @@ RELEASE 4.5.0 - Sun, 05 Mar 2023 14:08:29 -0700 We take advantage that their order is now stable based on insertion order in Python 3.5+ - Added/modifed unit and system tests to verify these changes. + - Fixed: when using the mingw tool, if an msys2 Python is used (os.sep + is '/' rather than the Windows default '\'), certain Configure checks + could fail due to the construction of the path to run the compiled check. RELEASE 4.4.0 - Sat, 30 Jul 2022 14:08:29 -0700 diff --git a/RELEASE.txt b/RELEASE.txt index 4f6f0a828..c2244f27b 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -32,6 +32,10 @@ CHANGED/ENHANCED EXISTING FUNCTIONALITY FIXES ----- + +- Fixed: when using the mingw tool, if an msys2 Python is used (os.sep + is '/' rather than the Windows default '\'), certain Configure checks + could fail due to the construction of the path to run the compiled check. - C scanner's dictifyCPPDEFINES routine did not understand the possible combinations of CPPDEFINES - not aware of a "name=value" string either embedded in a sequence, or by itself. The conditional C scanner thus diff --git a/SCons/SConf.py b/SCons/SConf.py index daece1ade..128644fc8 100644 --- a/SCons/SConf.py +++ b/SCons/SConf.py @@ -714,6 +714,12 @@ class SConfBase: if ok: prog = self.lastTarget pname = prog.get_internal_path() + if sys.platform == "win32" and os.sep == "/": + # msys might have a Python where os.sep='/' on Windows. + # That builds a path in the env.Command below which breaks + # if the SHELL used is cmd because 'pname' will always have + # an os.sep in it. + pname = pname.replace(os.sep, os.altsep) output = self.confdir.File(os.path.basename(pname)+'.out') node = self.env.Command(output, prog, [ [ pname, ">", "${TARGET}"] ]) ok = self.BuildNodes(node) diff --git a/SCons/Tool/mingw.py b/SCons/Tool/mingw.py index 07f15b74c..8d4f3ed2f 100644 --- a/SCons/Tool/mingw.py +++ b/SCons/Tool/mingw.py @@ -48,7 +48,8 @@ mingw_base_paths = [ r'C:\msys64\mingw64\bin', r'C:\cygwin\bin', r'C:\msys', - r'C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin' + r'C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin', + os.path.expandvars(r'%LocalAppData%\Programs\msys64\usr\bin'), ] |