-
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running appraisal specs with Bundler >= 2.4.0 broken #218
Comments
I think it's a bundler incompatibility that you're seeing. I haven't been able to pin down exactly what it is, but I was working on this last week. I can run
…and the tests pass, but different versions cause problems. In addition, last week I was playing around with a branch I'd worked on ages ago for testing out GitHub Actions and seen the same. Could you try replicating with one of the combinations (see the GHA branch), and see if that helps you? |
That was a good hint, thanks. I was a little lost and couldn't really find a good starting point. I did some very corse search and found Looking at https://github.com/rubygems/rubygems/blob/master/bundler/CHANGELOG.md#240-december-24-2022, I kind of have the suspicion that rubygems/rubygems#4475 might be the reason. 🤔 |
Forgot to mention: I tested bundler versions with this: |
Ah, hah, nice! It'd be great if you could spend the time tracking down what might have changed. Whilst you're doing that, I'd be keep to hear if you have any ideas of what we could do to make these things a bit easier to debug, too. |
This is what I have so far. Minimal acceptance test: require 'spec_helper'
describe 'Debugging Bundler Issues' do
it 'does something' do
build_git_gems %w(omelette)
build_gemfile <<-Gemfile
source 'https://rubygems.org'
gem "omelette", git: "../gems/omelette"
Gemfile
run 'bundle install --local --verbose'
end
end Trigger the error via When you then go into
BINGO!Here is what happens:
What does that mean?tl;dr: I think Bundler does not support local git repositories to be defined via I'll try to dig through the Bundler changelog and PRs to see if this was intentional or not. I suspect that this was an unintended side-effect introduced by rubygems/rubygems#4475. As it was never documented/recommended to use gems from local git repositories in a different way. IMO, btw: It should either work, or Bundler should raise an error, that local git repos are not supported, instead of trying to feed an invalid |
Oh wow! Great work. Thanks for digging into it. |
Previously, this would yield an error: appraise "foo" do ruby file: '../.ruby-version' gem "faraday-follow_redirects", "0.3.0" end `Appraisal::BundlerDSL#ruby_version` is emitting a block when the Gemfile DSL ruby method is used. Currently, this is emitted, which is not a method argument but rather a block: ruby {:file=>"../.ruby-version"} To fix this, we need to add `()` to ensure the arguments stay arguments: ruby({:file=>"../.ruby-version"}) This has been tested on Bundler 2.3.27 only — at this point in time we have compatibility issues with others. thoughtbot#218
Previously, this would yield an error: appraise "foo" do ruby file: '../.ruby-version' gem "faraday-follow_redirects", "0.3.0" end `Appraisal::BundlerDSL#ruby_version` is emitting a block when the Gemfile DSL ruby method is used. Currently, this is emitted, which is not a method argument but rather a block: ruby {:file=>"../.ruby-version"} To fix this, we need to add `()` to ensure the arguments stay arguments: ruby({:file=>"../.ruby-version"}) This has been tested on Bundler 2.3.27 only — at this point in time we have compatibility issues with others. #218
Hi there! I've opened an issue on bundler repo to get some help/insight : rubygems/rubygems#7925 |
@tisba local git repos are supported/tested but with full paths, not relative paths : https://github.com/rubygems/rubygems/blob/master/bundler/spec/install/gemfile/git_spec.rb#L463-L479 |
@nickcharlton @tisba this isssue is solved by #229 can you please take a look? |
Hey there 👋 I'm trying to send a PR (#219) and I'd like to add specs. But I'm unable to run the current specs. What am I missing?
I did this:
rake
fails with various other warnings but also the same error (no surprise as theRakefile
does not seem to do something special).$ rspec ./spec/acceptance/appraisals_file_bundler_dsl_compatibility_spec.rb:4
fails like this:The text was updated successfully, but these errors were encountered: