setup-ruby icon indicating copy to clipboard operation
setup-ruby copied to clipboard

python from msys64 directory gets invoked on windows

Open prabhu opened this issue 4 months ago • 3 comments

My workflow has setup-python step followed by setup-ruby. Noticed that the python from msys64 directory is getting invoked, due to it appearing before the Python directory in the PATH.

C:/hostedtoolcache/windows/Ruby/3.4.5/x64/msys64/ucrt64/bin/python.exe: No module named pip

I think this line is responsible for this feature/bug.

https://github.com/ruby/setup-ruby/blob/30011b6444339b8df773cfc724e1631d805a5e64/windows.js#L75

PATH variable in GitHub actions.

/c/hostedtoolcache/windows/cs/2.1.17/x64:/c/Users/runneradmin/cs/bin:/c/hostedtoolcache/windows/sbt/1.11.2/sbt/bin:/c/hostedtoolcache/windows/Java_Temurin-Hotspot_jdk/21.0.8-9.0/x64/bin:/c/hostedtoolcache/windows/Ruby/3.4.5/x64/bin:/c/hostedtoolcache/windows/Ruby/3.4.5/x64/msys64/ucrt64/bin:/c/hostedtoolcache/windows/Ruby/3.4.5/x64/msys64/usr/bin:/c/Users/runneradmin/AppData/Roaming/Python/Python312/Scripts:/c/hostedtoolcache/windows/Python/3.12.10/x64/Scripts:/c/hostedtoolcache/windows/Python/3.12.10/x64:

Would it be possible to make this configurable?

prabhu avatar Jul 30 '25 22:07 prabhu

My workflow has setup-python step followed by setup-ruby.

If you reverse the steps, does it work? The MSYS2 path entries are needed for compiling extension gems. I don't believe python is directly being installed, it must be a build dependency of one of the packages, not sure which.

MSP-Greg avatar Jul 30 '25 23:07 MSP-Greg

Yes, it works after reversing the steps, which is good enough for now, although an option to disable this behaviour will be nice. Thank you for the prompt response!

prabhu avatar Jul 31 '25 00:07 prabhu

There is windows-toolchain: none: https://github.com/ruby/setup-ruby/blob/2a7b30092b0caf9c046252510f9273b4875f3db9/action.yml#L39-L46 but then of course you won't be able to install Ruby C extensions.

eregon avatar Jul 31 '25 19:07 eregon