Skip to content

Commit

Permalink
Merge pull request SCons#4307 from mwichmann/bug/msys-python
Browse files Browse the repository at this point in the history
Fix Configure tests on win32/msys2
  • Loading branch information
bdbaddog authored May 4, 2023
2 parents 84859d5 + 4997bbd commit fcb92c4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions RELEASE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions SCons/SConf.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,12 @@ def TryRun(self, text, extension ):
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)
Expand Down
3 changes: 2 additions & 1 deletion SCons/Tool/mingw.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
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'),
]


Expand Down

0 comments on commit fcb92c4

Please sign in to comment.