Repository navigation
Basic Bundler operations don't seem to work on Windows #209
Description
Activity
Not sure what the issue is. YARD uses rspec (the only repo I immediately thought of), and it's using Bundler 2 and a rake task.
I looked at the branch you added Windows CI to. You might add quotes around the 3.0 version in the workflow file, as it's interpreted as '3' by the parser. So, when Ruby 3.1 is released, it will jump to that... Also, personal preference, but '-latest` for OS designation may change, which you may not want...
https://github.com/Shopify/seafoam/runs/3186334964#step:3:22
Setting BUNDLER_VERSION=1.17.2 for "bundle config|lock" commands below to ensure Bundler 1 is used
Can you try by removing the
BUNDLE WITHsection in https://github.com/Shopify/seafoam/blob/722a029eb268c3e00d8a946c5f554ad0b28e265f/Gemfile.lock#L58-L59, or updating to 2.x withbundle update --bundler?If that's not it, I suspect a potential regression in Bundler.
But should definitely make sure Bundler 2 is used first, Bundler 1 is no longer being developed and might not work with recent Rubies AFAIK.
Note that
bundle exec rake --versiondoes work in this repo's CI:
https://github.com/ruby/setup-ruby/runs/3171185439#step:17:10I think the problem is there is no Rakefile in https://github.com/Shopify/seafoam/tree/windows-ci
Also rake has some nasty exception/backtrace swallowing, some of it got recently fixed: ruby/rake#367Note that bundle exec rake --version does work
Yes in my other repo it actually finds
rake, starts to run it, then during the load of Gems it then complainsrakeisn't installed! I get backtraces like thisC:/hostedtoolcache/windows/Ruby/2.7.1/x64/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/rubygems_integration.rb:374:in `block in replace_bin_path': can't find executable rake for gem rake. rake is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception) from C:/hostedtoolcache/windows/Ruby/2.7.1/x64/lib/ruby/gems/2.7.0/gems/bundler-2.1.4/lib/bundler/rubygems_integration.rb:402:in `block in replace_bin_path' from D:/a/shopify-cli/shopify-cli/vendor/bundle/ruby/2.7.0/bin/rake:23:in `<main>'I think the problem is there is no Rakefile
Does Bundler need a Rakefile to run? It doesn't in macOS or Ubuntu.
I think the problem is there is no Rakefile
I don't think it's using Rake or not. I added a Rakefile, and same issue.
https://github.com/Shopify/seafoam/runs/3191396713#step:4:11
C:/hostedtoolcache/windows/Ruby/2.7.4/x64/lib/ruby/gems/2.7.0/gems/bundler-1.17.2/lib/bundler/rubygems_integration.rb:462:in `block in replace_bin_path': can't find executable rake for gem rake. rake is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception) from C:/hostedtoolcache/windows/Ruby/2.7.4/x64/lib/ruby/gems/2.7.0/gems/bundler-1.17.2/lib/bundler/rubygems_integration.rb:482:in `block in replace_bin_path' from D:/a/seafoam/seafoam/vendor/bundle/ruby/2.7.0/bin/rake:23:in `<main>'It is fixed by upgrading to most recent Bundler though, so I'll investigate in that direction.
It does work with
2.2.17, but doesn't work with2.1.4. I'm not going to bisect that further, but that's the fix - you need to use a more recent Bundler on Windows than you do on other platforms, and it needs to be at least I guess2.2or so.I don't know if that needs to be documented, or tested for, or something like that.
I added
bundle exec rakein this repo CI, and it passes for everything except JRuby on Windows, which is a known bug: e08bf35 #18 (comment)Does Bundler need a Rakefile to run? It doesn't in macOS or Ubuntu.
rakecertainly does. The error might just be confusing or the wrong one, but that's just a guess.Documented in 77d7ca9.
rake certainly does
I don't run
rakethough.^ indeed, my bad, I was confusing with some other log.
I have a basic gem. Its CI looks like this.
https://github.com/Shopify/seafoam/blob/master/.github/workflows/workflows.yml
I enabled Windows, and there even a basic
bundle exec rspecdoesn't work on Windows.Shopify/seafoam@9ef19e5
https://github.com/Shopify/seafoam/runs/3186334852
I found this in a more complex gem, but I'm reproducing here to make the problem more clear in simpler code. That gem does
bundle exec rake, so it's not a Rake / RSpec thing.