Skip to content
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

Installing the latest bundler causes google-protobuf to be installed as a different platform and failed to be resolved at runtime #2695

Closed
ntkme opened this issue Jul 26, 2022 · 6 comments
Assignees
Labels
third-party-issue An issue which should be fixed upstream

Comments

@ntkme
Copy link
Contributor

ntkme commented Jul 26, 2022

Log from GitHub Actions that with truffleruby-head it is using bundled bundler from truffleruby and everything was fine:

  /Users/runner/.rubies/truffleruby-head/bin/ruby --version
  truffleruby 22.2.0-dev-07df635e, like ruby 3.0.3, GraalVM CE Native [x86_64-darwin]

  Using Bundler 2 shipped with truffleruby-head (head versions do not always support the latest Bundler release)

  /home/runner/.rubies/truffleruby-head/bin/bundle install --jobs 4
......
  Fetching google-protobuf 3.21.3
  Installing google-protobuf 3.21.3 with native extensions

When using truffleruby stable release ruby/setup-ruby action will install the latest bundler version and it causes a strange problem. At first, instead of treating truffleruby as platform: ruby, it now platform: x86_64-linux, this behavior itself is already very problematic, as native extension may have been compiled with SSE3, and such native extension will just crash and need to be re-compiled from source using platform: ruby.

  /home/runner/.rubies/truffleruby-22.2.0/bin/ruby --version
  truffleruby 22.2.0, like ruby 3.0.3, GraalVM CE Native [x86_64-linux]

  /home/runner/.rubies/truffleruby-22.2.0/bin/gem install bundler -v ~> 2.0
  Successfully installed bundler-2.3.18

  /home/runner/.rubies/truffleruby-22.2.0/bin/bundle install --jobs 4
  Fetching google-protobuf 3.21.3 (x86_64-linux)
  Installing google-protobuf 3.21.3 (x86_64-linux)

After gems are installed, as a side effect of being treated as a different platform, running the following code also gives an unexpected error due to inconsistent platforms:

Gem::Dependency.new('google-protobuf').to_spec
Gem::MissingSpecVersionError: Could not find 'google-protobuf' (>= 0) - did find: [google-protobuf-3.21.3-x86_64-linux]
@ntkme
Copy link
Contributor Author

ntkme commented Jul 26, 2022

Related: ruby/setup-ruby#358

@eregon eregon added the third-party-issue An issue which should be fixed upstream label Jul 26, 2022
@eregon
Copy link
Member

eregon commented Jul 26, 2022

It's rubygems/rubygems#5691 it should be fixed in the upcoming Bundler 2.3.19: rubygems/rubygems#5691 (comment)

@ntkme
Copy link
Contributor Author

ntkme commented Jul 26, 2022

Thanks. I will lock it to 2.3.16 for now.

@ntkme ntkme closed this as completed Jul 26, 2022
@eregon
Copy link
Member

eregon commented Jul 26, 2022

I'll fix ruby/setup-ruby#358 ASAP so users run less into this.

@eregon
Copy link
Member

eregon commented Jul 26, 2022

Thanks for the report!

@eregon
Copy link
Member

eregon commented Jul 26, 2022

ruby/setup-ruby#358 fixed, so at least setup-ruby users should not run into this with the default bundler input.

@eregon eregon self-assigned this Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
third-party-issue An issue which should be fixed upstream
Projects
None yet
Development

No branches or pull requests

2 participants