-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Describe the problem as clearly as you can
Bundler appears to not support the without configuration when specifying the Gemfile via --gemfile.
Did you try upgrading rubygems & bundler?
This appears to be the case since at least bundler v2.4.22 on Ruby 2.7.8 until current bundler v2.6.4 on Ruby 3.4.2.
Post steps to reproduce the problem
I discovered this while running the test suite of the appraisal gem from thoughtbot. I think the reason tests would pass for long-time maintainers is because the tmp dir wasn't flushed before tests, or between runs, and so old bundles and lockfiles were present, and thus the output was not what a fresh run would see as a full install did not happen. Tests were failing for me because it was running for the first time.
Which command did you run?
With a local set of available gems named%w[pancake orange_juice waffle coffee sausage soda].
With a Gemfile like:
source "https://rubygems.org"
gem "pancake"
gem "rake", "~> 10.5", :platform => :ruby_18
group :drinks do
gem "orange_juice"
end
gem "appraisal"
With an appraisal file like:
appraise "breakfast" do
gem "waffle"
group :drinks do
gem "coffee"
end
end
The failing test is specifically written to test the --without feature of bundler, and that it works with appraisal. The commands it runs are:
bundle install --local
bundle config set --local without 'drinks'
appraisal install # (uses --gemfile internally)
The effect is that appraisal installs the gems listed in the drinks group (i.e. coffee and orange_juice) in spite of the setting.
What were you expecting to happen?
I expected the without group setting to be honored.
What actually happened?
Output of appraisal install run on bundler v2.4.22 and Ruby v2.7.8:
>> bundle check --gemfile='/Users/pboling/src/forks/appraisal/tmp/stage/gemfiles/breakfast.gemfile' || bundle install --gemfile='/Users/pboling/src/forks/appraisal/tmp/stage/gemfiles/breakfast.gemfile' --retry 1
Found changes from the lockfile, re-resolving dependencies because the dependencies in your gemfile changed, you added a new platform to your gemfile, the gemspecs for path gems changed
Resolving dependencies...
Found conflicts with dependencies with prereleases. Will retrying considering prereleases for appraisal...
Retrying resolution...
Running `bundle install --gemfile "/Users/pboling/src/forks/appraisal/tmp/stage/gemfiles/breakfast.gemfile" --retry 1` with bundler 2.4.22
Found changes from the lockfile, re-resolving dependencies because the dependencies in your gemfile changed, you added a new platform to your gemfile, the gemspecs for path gems changed
HTTP GET https://index.rubygems.org/versions
HTTP 206 Partial Content https://index.rubygems.org/versions
Fetching gem metadata from https://rubygems.org/
Looking up gems ["pancake", "rake", "waffle", "orange_juice", "coffee", "bundler", "thor"]
Looking up gems ["bunny", "yajl-ruby", "multi_json", "mynyml-rack-accept-media-types", "usher", "extlib", "rack", "tilt", "hashie", "rack-accept-media-types", "activesupport", "any_view", "json", "rack-test", "wrapt", "http_router", "httparty", "json_pure"]
Looking up gems ["english", "rspec", "amq-protocol", "sorted_set", "fuzzyhash", "ruby-debug", "builder", "i18n", "memcache-client", "tzinfo", "minitest", "thread_safe", "concurrent-ruby", "method_source", "zeitwerk", "base64", "bigdecimal", "connection_pool", "drb", "mutex_m", "logger", "securerandom", "benchmark", "uri", "url_mount", "spruz", "jnunemaker-crack", "crack", "multi_xml", "mime-types", "mini_mime", "csv"]
Looking up gems ["rspec-core", "rspec-expectations", "rspec-mocks", "racc", "rbtree", "set", "rbtree-jruby", "rbtree3", "ruby-debug-base", "columnize", "linecache", "hoe", "ZenTest", "RubyInline", "atomic", "functional-ruby", "ref", "ruby_parser", "ruby2_keywords", "mime-types-data", "safe_yaml", "rexml", "stringio"]
Looking up gems ["rspec-support", "diff-lcs", "rbx-require-relative", "rubyforge", "gemcutter", "ParseTree", "sexp_processor", "psych", "strscan"]
Looking up gems ["net-scp", "jar-dependencies", "date", "SexpProcessor", "rb-threadframe"]
Looking up gems ["ruby-maven", "net-ssh"]
Looking up gems ["maven-tools", "ruby-maven-libs", "needle", "jruby-pageant", "bcrypt_pbkdf", "rbnacl", "rbnacl-libsodium"]
Looking up gems ["virtus", "ffi"]
Looking up gems ["backports", "descendants_tracker", "axiom-types", "coercible", "equalizer"]
Looking up gems ["ice_nine", "adamantium"]
Looking up gems ["memoizable"]
Resolving dependencies...
Fetching rake 10.5.0
Installing rake 10.5.0
0: rake (10.5.0) from /Users/pboling/src/forks/appraisal/tmp/bundler/specifications/rake-10.5.0.gemspec
Using bundler 2.4.22
0: bundler (2.4.22) from /Users/pboling/.asdf/installs/ruby/2.7.8/lib/ruby/gems/2.7.0/specifications/default/bundler-2.4.22.gemspec
Using pancake 1.0.0
0: pancake (1.0.0) from /Users/pboling/src/forks/appraisal/tmp/bundler/specifications/pancake-1.0.0.gemspec
Using waffle 1.0.0
0: waffle (1.0.0) from /Users/pboling/src/forks/appraisal/tmp/bundler/specifications/waffle-1.0.0.gemspec
Fetching thor 1.3.2
Using coffee 1.0.0
1: coffee (1.0.0) from /Users/pboling/src/forks/appraisal/tmp/bundler/specifications/coffee-1.0.0.gemspec
Using orange_juice 1.0.0
3: orange_juice (1.0.0) from /Users/pboling/src/forks/appraisal/tmp/bundler/specifications/orange_juice-1.0.0.gemspec
Installing thor 1.3.2
2: thor (1.3.2) from /Users/pboling/src/forks/appraisal/tmp/bundler/specifications/thor-1.3.2.gemspec
Using appraisal 3.0.0.rc1 from source at `/Users/pboling/src/forks/appraisal` and installing its executables
0: appraisal (3.0.0.rc1) from /Users/pboling/src/forks/appraisal/appraisal.gemspec
Bundle complete! 6 Gemfile dependencies, 8 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Output of appraisal install rrun on bundler v2.6.4 and Ruby v3.4.2:
>> bundle check --gemfile='/Users/pboling/src/forks/appraisal/tmp/stage/gemfiles/breakfast.gemfile' || bundle install --gemfile='/Users/pboling/src/forks/appraisal/tmp/stage/gemfiles/breakfast.gemfile' --retry 1
Resolving dependencies because there's no lockfile
HTTP GET https://index.rubygems.org/versions
HTTP 304 Not Modified https://index.rubygems.org/versions
Fetching gem metadata from https://rubygems.org/
Looking up gems ["pancake", "rake", "waffle", "orange_juice", "coffee", "bundler", "thor"]
Looking up gems ["mynyml-rack-accept-media-types", "usher", "extlib", "rack", "tilt", "hashie", "rack-accept-media-types", "activesupport", "any_view", "json", "rack-test", "wrapt", "http_router", "httparty", "json_pure", "bunny", "yajl-ruby", "multi_json"]
Looking up gems ["fuzzyhash", "english", "rspec", "ruby-debug", "builder", "i18n", "memcache-client", "tzinfo", "minitest", "thread_safe", "concurrent-ruby", "method_source", "zeitwerk", "base64", "bigdecimal", "connection_pool", "drb", "mutex_m", "logger", "securerandom", "benchmark", "uri", "url_mount", "jnunemaker-crack", "crack", "multi_xml", "mime-types", "mini_mime", "csv", "spruz", "amq-protocol", "sorted_set"]
Looking up gems ["ruby-debug-base", "columnize", "linecache", "hoe", "ZenTest", "RubyInline", "racc", "rspec-core", "rspec-expectations", "rspec-mocks", "atomic", "functional-ruby", "ref", "ruby_parser", "ruby2_keywords", "stringio", "safe_yaml", "rexml", "mime-types-data", "rbtree", "set", "rbtree-jruby", "rbtree3"]
Looking up gems ["rbx-require-relative", "rspec-support", "rubyforge", "gemcutter", "diff-lcs", "ParseTree", "sexp_processor", "psych", "strscan"]
Looking up gems ["SexpProcessor", "net-scp", "rb-threadframe", "jar-dependencies", "date"]
Looking up gems ["ruby-maven", "net-ssh"]
Looking up gems ["needle", "jruby-pageant", "bcrypt_pbkdf", "rbnacl", "rbnacl-libsodium", "maven-tools", "ruby-maven-libs"]
Looking up gems ["virtus", "ffi"]
Looking up gems ["backports", "descendants_tracker", "axiom-types", "coercible", "equalizer"]
Looking up gems ["adamantium", "ice_nine"]
Looking up gems ["memoizable"]
Resolving dependencies...
Running `bundle install --gemfile "/Users/pboling/src/forks/appraisal/tmp/stage/gemfiles/breakfast.gemfile" --retry 1` with bundler 2.6.4
Resolving dependencies because there's no lockfile
HTTP GET https://index.rubygems.org/versions
HTTP 304 Not Modified https://index.rubygems.org/versions
Fetching gem metadata from https://rubygems.org/
Looking up gems ["pancake", "rake", "waffle", "orange_juice", "coffee", "bundler", "thor"]
Looking up gems ["mynyml-rack-accept-media-types", "usher", "extlib", "rack", "tilt", "hashie", "rack-accept-media-types", "activesupport", "any_view", "json", "rack-test", "wrapt", "http_router", "bunny", "yajl-ruby", "multi_json", "httparty", "json_pure"]
Looking up gems ["fuzzyhash", "english", "rspec", "builder", "i18n", "memcache-client", "tzinfo", "minitest", "thread_safe", "concurrent-ruby", "method_source", "zeitwerk", "base64", "bigdecimal", "connection_pool", "drb", "mutex_m", "logger", "securerandom", "benchmark", "uri", "ruby-debug", "url_mount", "amq-protocol", "sorted_set", "jnunemaker-crack", "crack", "multi_xml", "mime-types", "mini_mime", "csv", "spruz"]
Looking up gems ["racc", "hoe", "ZenTest", "RubyInline", "rspec-core", "rspec-expectations", "rspec-mocks", "atomic", "ruby2_keywords", "functional-ruby", "ref", "ruby_parser", "ruby-debug-base", "columnize", "linecache", "rbtree", "set", "rbtree-jruby", "rbtree3", "safe_yaml", "rexml", "mime-types-data", "stringio"]
Looking up gems ["rspec-support", "diff-lcs", "rubyforge", "gemcutter", "ParseTree", "sexp_processor", "rbx-require-relative", "psych", "strscan"]
Looking up gems ["net-scp", "SexpProcessor", "rb-threadframe", "jar-dependencies", "date"]
Looking up gems ["net-ssh", "ruby-maven"]
Looking up gems ["needle", "jruby-pageant", "bcrypt_pbkdf", "rbnacl", "rbnacl-libsodium", "maven-tools", "ruby-maven-libs"]
Looking up gems ["ffi", "virtus"]
Looking up gems ["backports", "descendants_tracker", "axiom-types", "coercible", "equalizer"]
Looking up gems ["adamantium", "ice_nine"]
Looking up gems ["memoizable"]
Resolving dependencies...
Fetching rake 10.5.0
Installing rake 10.5.0
0: rake (10.5.0) from /Users/pboling/src/forks/appraisal/tmp/bundler/specifications/rake-10.5.0.gemspec
Using bundler 2.6.4
0: bundler (2.6.4) from /Users/pboling/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/specifications/default/bundler-2.6.4.gemspec
Fetching thor 1.3.2
Using coffee 1.0.0
Using orange_juice 1.0.0
2: coffee (1.0.0) from /Users/pboling/src/forks/appraisal/tmp/bundler/specifications/coffee-1.0.0.gemspec
Using pancake 1.0.0
0: pancake (1.0.0) from /Users/pboling/src/forks/appraisal/tmp/bundler/specifications/pancake-1.0.0.gemspec
3: orange_juice (1.0.0) from /Users/pboling/src/forks/appraisal/tmp/bundler/specifications/orange_juice-1.0.0.gemspec
Using waffle 1.0.0
2: waffle (1.0.0) from /Users/pboling/src/forks/appraisal/tmp/bundler/specifications/waffle-1.0.0.gemspec
Installing thor 1.3.2
1: thor (1.3.2) from /Users/pboling/src/forks/appraisal/tmp/bundler/specifications/thor-1.3.2.gemspec
Using appraisal 3.0.0.rc1 from source at `/Users/pboling/src/forks/appraisal` and installing its executables
0: appraisal (3.0.0.rc1) from /Users/pboling/src/forks/appraisal/appraisal.gemspec
Bundle complete! 6 Gemfile dependencies, 8 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
If not included with the output of your command, run bundle env and paste the output below
bundle env for bundler v2.6.4 and Ruby v3.4.2 (with sensitive data removed):
Environment
Bundler 2.6.4
Platforms ruby, arm64-darwin-24
Ruby 3.4.2p28 (2025-02-15 revision d2930f8e7a5db8a7337fa43370940381b420cc3e) [arm64-darwin-24]
Full Path /Users/pboling/.asdf/installs/ruby/3.4.2/bin/ruby
Config Dir /Users/pboling/.asdf/installs/ruby/3.4.2/etc
RubyGems 3.6.4
Gem Home /Users/pboling/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0
Gem Path /Users/pboling/.gem/ruby/3.4.0:/Users/pboling/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0
User Home /Users/pboling
User Path /Users/pboling/.gem/ruby/3.4.0
Bin Dir /Users/pboling/.asdf/installs/ruby/3.4.2/bin
Tools
Git 2.40.1
RVM not installed
rbenv not installed
chruby not installed
Bundler Build Metadata
Built At 2025-02-17
Git SHA 87f7bf0ac12
Released Version true
Bundler settings
build.nokogiri
Set for the current user (/Users/pboling/.bundle/config): "--use-system-libraries"
gem.changelog
Set for the current user (/Users/pboling/.bundle/config): true
gem.ci
Set for the current user (/Users/pboling/.bundle/config): "gitlab"
gem.coc
Set for the current user (/Users/pboling/.bundle/config): true
gem.linter
Set for the current user (/Users/pboling/.bundle/config): "rubocop"
gem.mit
Set for the current user (/Users/pboling/.bundle/config): true
gem.test
Set for the current user (/Users/pboling/.bundle/config): "rspec"
jobs
Set for the current user (/Users/pboling/.bundle/config): 4
Gemfile
Gemfile
source "https://rubygems.org"
gemspec
platform :mri do
# Debugging
gem "byebug", ">= 11"
# Dev Console - Binding.pry - Irb replacement
gem "pry", "~> 0.14" # ruby >= 2.0
end
# This here to make sure appraisal works with Rails 3.0.0.
gem "thor", "~> 0.14.0"
# Ruby version specific dependencies
ruby_version = Gem::Version.new(RUBY_VERSION)
if ruby_version < Gem::Version.new("1.9")
eval File.read("Gemfile-1.8")
elsif ruby_version < Gem::Version.new("2.1")
eval File.read("Gemfile-2.0")
elsif ruby_version < Gem::Version.new("2.2")
eval File.read("Gemfile-2.1")
elsif ruby_version < Gem::Version.new("2.7")
# Std Lib extractions
gem "benchmark", "~> 0.4" # Removed from Std Lib in Ruby 3.5
else
# Ruby >= 2.7 we can run style / lint checks via rubocop-gradual with rubocop-lts rules for Ruby 1.8+.
# This means we can develop on modern Ruby but remain compatible with ancient Ruby.
eval_gemfile "gemfiles/modular/style.gemfile"
endgemfiles/modular/style.gemfile
# frozen_string_literal: true
# We run rubocop on the latest version of Ruby,
# but in support of the oldest supported version of Ruby
gem "rubocop-lts", "~> 0.1", ">= 0.1.1" # Style and Linting support for Ruby >= 1.8
gem "rubocop-packaging", "~> 0.5", ">= 0.5.2"
gem "rubocop-rspec", "~> 3.2"
gem "standard", ">= 1.35.1", "!= 1.41.1", "!= 1.42.0"
# Std Lib extractions
gem "benchmark", "~> 0.4" # Removed from Std Lib in Ruby 3.5Gemfile.lock
PATH
remote: .
specs:
appraisal (3.0.0.rc1)
bundler (>= 1.17.3)
rake (>= 10)
thor (>= 0.14.0)
GEM
remote: https://rubygems.org/
specs:
activesupport (8.0.1)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
ast (2.4.2)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.9)
byebug (11.1.3)
coderay (1.1.3)
concurrent-ruby (1.3.5)
connection_pool (2.5.0)
diff-lcs (1.6.0)
diffy (3.4.3)
drb (2.2.1)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
json (2.10.1)
language_server-protocol (3.17.0.4)
lint_roller (1.1.0)
logger (1.6.6)
method_source (1.1.0)
minitest (5.25.4)
parallel (1.26.3)
parser (3.3.7.1)
ast (~> 2.4.1)
racc
pry (0.15.2)
coderay (~> 1.1)
method_source (~> 1.0)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.10.0)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-block_is_expected (1.0.6)
rspec-core (3.13.3)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.2)
rubocop (1.71.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.38.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.38.0)
parser (>= 3.3.1.0)
rubocop-gradual (0.3.6)
diff-lcs (>= 1.2.0, < 2.0)
diffy (~> 3.0)
parallel (~> 1.10)
rainbow (>= 2.2.2, < 4.0)
rubocop (~> 1.0)
rubocop-lts (0.1.1)
rubocop-ruby1_8 (>= 1.0.5, < 2)
standard-rubocop-lts (>= 1.0.3, < 3)
version_gem (>= 1.1.2, < 3)
rubocop-md (1.2.4)
rubocop (>= 1.45)
rubocop-packaging (0.5.2)
rubocop (>= 1.33, < 2.0)
rubocop-performance (1.23.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (3.4.0)
rubocop (~> 1.61)
rubocop-ruby1_8 (1.0.7)
rubocop-gradual (~> 0.3, >= 0.3.1)
rubocop-md (~> 1.2)
rubocop-rake (~> 0.6)
rubocop-shopify (~> 2.14)
rubocop-thread_safety (~> 0.5, >= 0.5.1)
standard-rubocop-lts (~> 1.0, >= 1.0.7)
version_gem (>= 1.1.3, < 3)
rubocop-shopify (2.15.1)
rubocop (~> 1.51)
rubocop-thread_safety (0.6.0)
rubocop (>= 1.48.1)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
standard (1.45.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.71.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.6)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.6.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.23.0)
standard-rubocop-lts (1.0.10)
rspec-block_is_expected (~> 1.0, >= 1.0.5)
standard (>= 1.35.1, < 2)
standard-custom (>= 1.0.2, < 2)
standard-performance (>= 1.3.1, < 2)
version_gem (>= 1.1.4, < 3)
thor (0.14.6)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uri (1.0.2)
version_gem (1.1.4)
PLATFORMS
arm64-darwin-24
ruby
DEPENDENCIES
activesupport (>= 3.2.21)
appraisal!
benchmark (~> 0.4)
byebug (>= 11)
pry (~> 0.14)
rspec (~> 3.0)
rubocop-lts (~> 0.1, >= 0.1.1)
rubocop-packaging (~> 0.5, >= 0.5.2)
rubocop-rspec (~> 3.2)
standard (>= 1.35.1, != 1.42.0, != 1.41.1)
thor (~> 0.14.0)
BUNDLED WITH
2.6.4
Gemspecs
appraisal.gemspec
# frozen_string_literal: true
# TODO: Switch to require_relative once support for Ruby < 2 is dropped.
# require_relative "lib/appraisal/version"
$:.push(File.expand_path("lib", __dir__))
require "appraisal/version"
Gem::Specification.new do |s|
s.name = "appraisal"
s.version = Appraisal::VERSION.dup
s.platform = Gem::Platform::RUBY
s.authors = ["Joe Ferris", "Prem Sichanugrist"]
s.email = ["jferris@thoughtbot.com", "prem@thoughtbot.com"]
s.homepage = "http://github.com/thoughtbot/appraisal"
s.summary = "Find out what your Ruby gems are worth"
s.description = 'Appraisal integrates with bundler and rake to test your library against different versions of dependencies in repeatable scenarios called "appraisals."'
s.license = "MIT"
# specify which files should be added to the gem when it is released.
s.files = Dir[
# Splats (keep alphabetical)
"lib/**/*.rb",
]
# automatically included with gem package, no need to list twice (i.e. do not list in files above).
s.extra_rdoc_files = Dir[
# Files (keep alphabetical)
"CONTRIBUTING.md",
"MIT-LICENSE",
"README.md",
"SECURITY.md",
]
# bin/ is scripts, in any available language, for development of this specific gem
# exe/ is for ruby scripts that will ship with this gem to be used by other tools
s.bindir = "exe"
# files listed are relative paths from bindir above.
s.executables = [
"appraisal",
]
s.required_ruby_version = ">= 1.8.7"
s.add_runtime_dependency("bundler", ">= 1.17.3") # Last version supporting Ruby 1.8.7
s.add_runtime_dependency("rake", ">= 10") # Last version supporting Ruby 1.8.7
s.add_runtime_dependency("thor", ">= 0.14.0")
s.add_development_dependency("activesupport", ">= 3.2.21")
s.add_development_dependency("rspec", "~> 3.0")
endI'll work on isolating the bug and finding a fix if it turns out to be inside bundler, otherwise I'll close this issue.