Skip to content
This repository was archived by the owner on Nov 21, 2018. It is now read-only.

Commit 77185c8

Browse files
committed
Use the system python on the windows bots
Wow this stuff sucks
1 parent 8faa011 commit 77185c8

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

master/master.cfg

+38-2
Original file line numberDiff line numberDiff line change
@@ -701,19 +701,55 @@ class CommandEnv(object):
701701
if "buildername" in props:
702702
win32toolchain = r"c:\mingw-w64\i686-4.9.1-win32-dwarf-rt_v3-rev1\mingw32\bin"
703703
win64toolchain = r"c:\mingw-w64\x86_64-4.9.1-win32-seh-rt_v3-rev1\mingw64\bin"
704+
python = r"c:\Python27"
705+
mingw32 = r"c:\msys64\mingw32\bin;c:\msys64\usr\bin"
706+
mingw64 = r"c:\msys64\mingw64\bin;c:\msys64\usr\bin"
704707
name = props["buildername"]
705708

706709
# This is required to trigger certain workarounds done
707710
# slave-side by buildbot. In particular omitting the PWD
708711
# variable with an unmangled pathname.
712+
#
713+
# Note that the PATH management here is very particular, notably:
714+
#
715+
# * The gcc toolchain is first in PATH. We use a custom toolchain
716+
# rather than one installed by MinGW for a few reasons. We're
717+
# going to be shipping rustc binaries produced by this toolchain,
718+
# notably LLVM is compiled and will require libstdc++-6.dll
719+
# somehow. We want to use the win32 threading model as it doesn't
720+
# have an extra dependency, and the MinGW default toolchains all
721+
# have the pthread threading model. Also LLVM will segfault at
722+
# runtime if compiled by gcc 5+ currently, so we need to stick
723+
# back to 4.9.1 ... Not fun.
724+
#
725+
# * Next up is the system python we have installed. The MinGW python
726+
# is super weird in a few ways. First, it will implicitly insert
727+
# an entry in PATH to `/mingw32/bin` *first* whenever it runs, so
728+
# if a program relies on the order of PATH (like make-win-dist.py)
729+
# then we'll do the wrong thing. Second, the LLVM cmake requires
730+
# python, and it requires it to basically not worry about
731+
# msys-vs-windows paths, and the MinGW python likes to take
732+
# control of paths quickly. To complicate matters, there are
733+
# **two** python installations in MinGW, both of which end up just
734+
# being totally wrong for our use case. As a result we just
735+
# installed a local copy of python and called it a day.
736+
#
737+
# * Finally we add the mingw paths and then the system PATH to
738+
# ensure that we can find all the necessary tools as part of the
739+
# build.
740+
#
741+
# Note that MSVC and MinGW share this same block. MSVC just won't
742+
# use the gcc toolchain and in theory doesn't need the MinGW
743+
# programs, but currently we use `make` everywhere so it definitely
744+
# needs them...
709745
if "win-msvc-32" in name or "win-gnu-32" in name:
710746
env["MACHTYPE"] = "i686-pc-win32"
711747
env["MSYSTEM"] = "MINGW32"
712-
env["PATH"] = win32toolchain + ";c:\\msys64\\mingw32\\bin;c:\\msys64\\usr\\bin;${PATH}"
748+
env["PATH"] = ';'.join([win32toolchain, python, mingw32, '${PATH}'])
713749
if "win-msvc-64" in name or "win-gnu-64" in name:
714750
env["MACHTYPE"] = "x86_64-pc-win32"
715751
env["MSYSTEM"] = "MINGW64"
716-
env["PATH"] = win64toolchain + ";c:\\msys64\\mingw64\\bin;c:\\msys64\\usr\\bin;${PATH}"
752+
env["PATH"] = ';'.join([win64toolchain, python, mingw64, '${PATH}'])
717753

718754
if "msvc" in props["buildername"]:
719755
env["MSVC"] = "1"

0 commit comments

Comments
 (0)