Skip to content

Commit dae3adb

Browse files
committed
Restrict Windows->Unix conversion to PATH
1 parent 942ac5c commit dae3adb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/build_als.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,14 @@ function build_langkit_raw() {
177177
if [[ $NODE_ARCH_PLATFORM == "x64/win32" ]]; then
178178
# Fix setenv.sh to be bash script for MSYS2 by replacing
179179
# 1) C:\ -> /C/ 2) '\' -> '/' and ';' -> ':' 3) ": export" -> "; export"
180-
sed -i -e 's#\([A-Z]\):\\#/\1/#g' -e 'y#\\;#/:#' -e 's/: export /; export /' "$LANGKIT_SETENV"
180+
#
181+
# Only do this on the PATH environment variable which MSYS2/Cygwin
182+
# automatically converts to Windows paths. Other variables such as
183+
# PYTHONPATH must be left in Windows format to be usable by Python
184+
# subprocresses.
185+
#
186+
# See https://www.msys2.org/docs/filesystem-paths/
187+
sed -i -e '/^PATH=/s#\([A-Z]\):\\#/\1/#g' -e '/^PATH=/y#\\;#/:#' -e '/^PATH=/s/: export /; export /' "$LANGKIT_SETENV"
181188
fi
182189

183190
cat "$LANGKIT_SETENV"

0 commit comments

Comments
 (0)