You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a gem I'm helping to maintain, we have google-protobuf as a dependency. Our bundler platform is set to ruby.
The Gemfile.lock has this entry.
google-protobuf (3.19.3)
But when our semantic-bot releases a new version, it gets changed to
google-protobuf (3.19.3-x86_64-linux)
After some investigation, it seems that bundle check is the one changing the Gemfile.lock to the platform specific version and bundle changes it back to a non platform specific version.
More context: Bundle check is run by the appraisals gem and running bundle exec appraisal install generates statements like this:
Using this branch as the base (small Dockerfile included):
In the repository root folder, run bundle install
Run bundle check --gemfile="$(pwd)/gemfiles/graphql_1.10.gemfile"
The file gemfiles/graphql_1.10.gemfile.lock changes to a platform specific version
If we ran bundle install --gemfile="$(pwd)/gemfiles/graphql_1.10.gemfile" instead, gemfiles/graphql_1.10.gemfile.lock does not change to a platform specific version.
Which command did you run?
bundle check
What were you expecting to happen?
bundle check should have the same effect as bundle install to any Gemfile or Gemfile.lock that is touched by bundler.
What actually happened?
The bundle check command causes platform specific changes to the lockfiles.
If not included with the output of your command, run bundle env and paste the output below
Environment
Bundler 2.3.6
Platforms ruby, x86_64-darwin-21
Ruby 2.6.9p207 (2021-11-24 revision 67954) [x86_64-darwin-21]
Full Path /Users/me/.rubies/ruby-2.6.9/bin/ruby
Config Dir /Users/me/.rubies/ruby-2.6.9/etc
RubyGems 3.3.6
Gem Home /Users/me/.gem/ruby/2.6.9
Gem Path /Users/me/.gem/ruby/2.6.9:/Users/me/.rubies/ruby-2.6.9/lib/ruby/gems/2.6.0
User Home /Users/me
User Path /Users/me/.gem/ruby/2.6.0
Bin Dir /Users/me/.gem/ruby/2.6.9/bin
Tools
Git 2.33.1
RVM not installed
rbenv not installed
chruby 0.3.9
Bundler Build Metadata
Built At 2022-01-26
Git SHA 056f64c33a
Released Version true
# frozen_string_literal: truelib=File.expand_path('lib',__dir__)
$LOAD_PATH.unshift(lib)unless $LOAD_PATH.include?(lib)require'apollo-federation/version'Gem::Specification.newdo |spec|
spec.name='apollo-federation'spec.version=ApolloFederation::VERSIONspec.authors=[]spec.email=[]spec.summary='A Ruby implementation of Apollo Federation'spec.description=spec.summaryspec.homepage='https://github.com/Gusto/apollo-federation-ruby'spec.license='MIT'spec.required_ruby_version='>= 2.2.0'# bc of `.to_sym`spec.metadata={'homepage_uri'=>'https://github.com/Gusto/apollo-federation-ruby','changelog_uri'=>'https://github.com/Gusto/apollo-federation-ruby/releases','source_code_uri'=>'https://github.com/Gusto/apollo-federation-ruby','bug_tracker_uri'=>'https://github.com/Gusto/apollo-federation-ruby/issues',}spec.files=`git ls-files bin lib *.md LICENSE`.split("\n")spec.add_dependency'graphql','>= 1.10.14'spec.add_runtime_dependency'google-protobuf','~> 3.19'spec.add_development_dependency'actionpack'spec.add_development_dependency'appraisal'spec.add_development_dependency'debase'spec.add_development_dependency'pry-byebug'spec.add_development_dependency'rack'spec.add_development_dependency'rake'spec.add_development_dependency'rspec'spec.add_development_dependency'rubocop','~> 0.72.0'spec.add_development_dependency'rubocop-rspec'spec.add_development_dependency'ruby-debug-ide'end
The text was updated successfully, but these errors were encountered:
Hei @daemonsy, I tried to reproduce this but I couldn't.
I used the provided Dockerfile except that I mounted the CWD manually though docker --mount option, instead of manually copying inside the Dockerfile, because in the latter case files would get inadequate permissions and I would get errors when trying to write a lockfile. Anyways, running the mentioned commands did not generate any unexpected lockfile changes.
Can you share exact docker commands to reproduce the error?
I believe this problem could still be happening. It appears to happen if the lockfile is out-of-date with the Gemfile. For example, if a gem has been removed in the Gemfile, then when the lockfile is regenerated, the platforms will revert.
It can be fixed by effectively running bundle lock --add-platform ruby, then removing the platform-specific lines manually.
I will attempt to reproduce with a Dockerfile to demonstrate the behavior.
Describe the problem as clearly as you can
On a gem I'm helping to maintain, we have
google-protobuf
as a dependency. Our bundler platform is set toruby
.The
Gemfile.lock
has this entry.But when our semantic-bot releases a new version, it gets changed to
After some investigation, it seems that
bundle check
is the one changing theGemfile.lock
to the platform specific version andbundle
changes it back to a non platform specific version.More context: Bundle check is run by the appraisals gem and running
bundle exec appraisal install
generates statements like this:Did you try upgrading rubygems & bundler?
cimg/ruby-2.7.5-node
on DockerPost steps to reproduce the problem
Using this branch as the base (small Dockerfile included):
bundle install
bundle check --gemfile="$(pwd)/gemfiles/graphql_1.10.gemfile"
gemfiles/graphql_1.10.gemfile.lock
changes to a platform specific versionbundle install --gemfile="$(pwd)/gemfiles/graphql_1.10.gemfile"
instead,gemfiles/graphql_1.10.gemfile.lock
does not change to a platform specific version.Which command did you run?
bundle check
What were you expecting to happen?
bundle check
should have the same effect asbundle install
to any Gemfile or Gemfile.lock that is touched by bundler.What actually happened?
The bundle check command causes platform specific changes to the lockfiles.
If not included with the output of your command, run
bundle env
and paste the output belowEnvironment
Bundler Build Metadata
Gemfile
Gemfile
Gemfile.lock
Gemspecs
apollo-federation.gemspec
The text was updated successfully, but these errors were encountered: