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
Gem in gemspec without ruby platform version is resolved to a wrong platform #3200
Comments
Reproduces on my machine, thanks for the report! |
Following spec reproduces the issue: diff --git a/spec/runtime/platform_spec.rb b/spec/runtime/platform_spec.rb
index f38f73384..64a616de6 100644
--- a/spec/runtime/platform_spec.rb
+++ b/spec/runtime/platform_spec.rb
@@ -115,4 +115,27 @@ RSpec.describe "Bundler.setup with multi platform stuff" do
expect(the_bundle).to include_gems "platform_specific 1.0 RUBY"
end
end
+
+ it "works with a `gemspec` that depends upon a multi-platform gem" do
+ simulate_platform "x86-darwin-100"
+
+ build_repo4 do
+ %w[universal-aix5 universal-darwin].each do |pl|
+ build_gem("bar") do |s|
+ s.platform = pl
+ end
+ end
+ end
+
+ build_lib("foo", "1.0", :path => bundled_app) do |s|
+ s.add_runtime_dependency "bar"
+ end
+
+ install_gemfile! <<-G
+ source "file:#{gem_repo4}"
+ gemspec
+ G
+
+ expect(the_bundle).to include_gems 'foo 1.0', "bar 1.0 universal-darwin"
+ end
end
|
Hello! 👋 👋 I run Samuel's spec and it passes now! So it sounds like we might've fixed this with the recent multiplatform improvements! 🎉 @toy Could you verify that this is now working fine? |
@deivid-rodriguez Using bundler 2.2.0.rc.2 if I change the dependency to |
Interesting, I guess the issue doesn't repro with that spec after all. It does work if you set |
Setting the source 'https://rubygems.org'
gemspec and Gem::Specification.new do |s|
s.name = 'test'
s.version = '1.0.0'
s.summary = 'test summary'
s.authors = ['Max Mustermann']
s.add_dependency 'sys-proctable', '~> 1.1.0'
end and running bundle on osx will contain in the output:
It is enough to delete bundle config specific_platform true
bundle To lock on the right gem. It may be important that sys-proctable doesn't have version 1.1.5 with platform ruby. |
Great! The plan is currently to remove the |
I've stumbled upon an issue with using bundler for developing a gem that has a dependency on
sys-proctable
gem. The issue seems to be caused by two characteristics ofsys-proctable
gem: it has only platform specific versions and two of them (darwin and freebsd) have additional dependency on ffi gem. I was able to reproduce the behaviour on freebsd (10.3) and osx (darwin 16).Given
Gemfile
:and
test.gemspec
:and running
bundle
on freebsd, produces:Running
bundle config specific_platform true
, removing thesys-proctable
gem from the system and repeatingbundle
will remove the warning, but will still fetch theuniversal-aix5
platform specific gem.The text was updated successfully, but these errors were encountered: