Skip to content

Commit 132887c

Browse files
ryeMark-Simulacrum
authored andcommitted
ci: Stop setting CI_OVERRIDE_SHELL environment variable
This will render the src/ci/exec-with-shell.py script more or less useless, but we're going to replace that by just using the system bash instead. Signed-off-by: Kristofer Rye <[email protected]>
1 parent 7d0afb1 commit 132887c

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/ci/scripts/install-msys2.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ if isWindows; then
2323
mkdir -p "$(ciCheckoutPath)/msys2/home/${USERNAME}"
2424
ciCommandAddPath "$(ciCheckoutPath)/msys2/usr/bin"
2525

26-
echo "switching shell to use our own bash"
27-
ciCommandSetEnv CI_OVERRIDE_SHELL "$(ciCheckoutPath)/msys2/usr/bin/bash.exe"
26+
# Detect the native Python version installed on the agent. On GitHub
27+
# Actions, the C:\hostedtoolcache\windows\Python directory contains a
28+
# subdirectory for each installed Python version.
29+
#
30+
# The -V flag of the sort command sorts the input by version number.
31+
native_python_version="$(ls /c/hostedtoolcache/windows/Python | sort -Vr | head -n 1)"
32+
33+
# Make sure we use the native python interpreter instead of some msys equivalent
34+
# one way or another. The msys interpreters seem to have weird path conversions
35+
# baked in which break LLVM's build system one way or another, so let's use the
36+
# native version which keeps everything as native as possible.
37+
python_home="/c/hostedtoolcache/windows/Python/${native_python_version}/x64"
38+
cp "${python_home}/python.exe" "${python_home}/python3.exe"
39+
ciCommandAddPath "C:\\hostedtoolcache\\windows\\Python\\${native_python_version}\\x64"
40+
ciCommandAddPath "C:\\hostedtoolcache\\windows\\Python\\${native_python_version}\\x64\\Scripts"
2841
fi

0 commit comments

Comments
 (0)