Open eregon opened 3 days ago
@eregon
For a long time, ruby-loco had code to modify the binstubs in all windows builds. On 10-Oct, I removed it, as RubyGems/Bundler updated their code. I'm looking at it. Also, I'm adding which -a ruby bundle gem
to the ruby-loco CI.
@eregon
This is kind of strange, and I could repro it locally. Now that I check the title, it's not correct. The issue is that which
cannot find the bundle executable. My ruby-loco has checked several of the bash binstubs for a long time.
What's being called a 'prolog' was added to the Windows binstubs, and allows the following (done with a PWD that might as well be HOME). Used the MSYS2 bash shell):
This shows the Ruby in PATH (ucrt):
$ ruby -v
ruby 3.4.0dev (2024-10-17T15:21:34Z master a7317f53e0) +PRISM [x64-mingw-ucrt]
This also uses the Ruby in PATH, and shows ucrt folders & Ruby.
$ bundle env
## Environment
Bundler 2.6.0.dev
Platforms ruby, x64-mingw-ucrt
Ruby 3.4.0p-1 (2024-10-18 revision a7317f53e03059c946835d086d8def3f39649a8e) [x64-mingw-ucrt]
Full Path C:/ruby-ucrt/bin/ruby.exe
Config Dir C:/ProgramData
RubyGems 3.6.0.dev
Gem Home C:/ruby-ucrt/lib/ruby/gems/3.4.0+0
This exec's bundle in another Ruby install (hard path), and the prolog switches the Ruby to the Ruby exec in the same folder as the bundle exec, which is the mswin folder:
$ /c/ruby-mswin/bin/bundle env
## Environment
Bundler 2.6.0.dev
Platforms ruby, x64-mswin64-140
Ruby 3.4.0p-1 (2024-10-18 revision a7317f53e03059c946835d086d8def3f39649a8e) [x64-mswin64-140]
Full Path C:/ruby-mswin/bin/ruby.exe
Config Dir C:/ProgramData
RubyGems 3.6.0.dev
Gem Home C:/ruby-mswin/lib/ruby/gems/3.4.0+0
Ah so this prolog causes which
in Windows Bash to think it's not a proper executable? (maybe it no longer starts with a shebang?)
I think that's something worth reporting to https://bugs.ruby-lang.org/ , could you do that?
https://github.com/ruby/setup-ruby/actions/runs/11391394046/job/31695188901?pr=657
cc @MSP-Greg