Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

--all-platforms breaks one platform #4372

Closed
skull-squadron opened this issue Mar 15, 2016 · 3 comments
Closed

--all-platforms breaks one platform #4372

skull-squadron opened this issue Mar 15, 2016 · 3 comments

Comments

@skull-squadron
Copy link

The presence of BUNDLE_CACHE_ALL_PLATFORMS: true in .bundle/config breaks a multi-platform Gemfile.lock

(Scroll down about 80% for the specific error)

  • Ruby 2.3.0p0 + RubyGems 2.6.2 + bundler 1.11.2
  • JRuby 9.0.5.0 + RubyGems 2.6.2 + bundler 1.11.2

Minimal example project files here

First, cleanup all bundler project files

rm -rf vendor/{bundle,cache} .bundle/config Gemfile.lock

Next, bundle under MRI (works)

$ chruby 2.3.0
$ bundle
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies.......
Using rake 11.1.1
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.4
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.0.0
Using rack 1.6.4
Using mime-types 2.99.1
Using arel 6.0.3
Using bundler 1.11.2
Using concurrent-ruby 1.0.1
Using pg 0.18.4
Using thor 0.19.1
Using tzinfo 1.2.2
Using nokogiri 1.6.7.2
Using rack-test 0.6.3
Using mail 2.6.3
Using sprockets 3.5.2
Using activesupport 4.2.6
Using loofah 2.0.3
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.3.6
Using activemodel 4.2.6
Using rails-html-sanitizer 1.0.3
Using rails-dom-testing 1.0.7
Using activejob 4.2.6
Using activerecord 4.2.6
Using actionview 4.2.6
Using actionpack 4.2.6
Using actionmailer 4.2.6
Using railties 4.2.6
Using sprockets-rails 3.0.4
Using rails 4.2.6
Bundle complete! 3 Gemfile dependencies, 35 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
$ bin/rake -T
rake about                              # List versions of all Rails frameworks and t...
...
rake tmp:create                         # Creates tmp directories for sessions, cache...
$

Then, bundle under JRuby (works)

$ chruby jruby-9.0.5.0
$ bundle
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies................
Using rake 11.1.1
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.4
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using nokogiri 1.6.7.2
Using rack 1.6.4
Using mime-types 2.99.1
Using arel 6.0.3
Using jdbc-postgres 9.4.1206
Using bundler 1.11.2
Using concurrent-ruby 1.0.1
Using thor 0.19.1
Using tzinfo 1.2.2
Using loofah 2.0.3
Using rack-test 0.6.3
Using mail 2.6.3
Using sprockets 3.5.2
Using activesupport 4.2.6
Using rails-html-sanitizer 1.0.3
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.3.6
Using activemodel 4.2.6
Using rails-dom-testing 1.0.7
Using activejob 4.2.6
Using activerecord 4.2.6
Using actionview 4.2.6
Using activerecord-jdbc-adapter 1.3.20
Using actionpack 4.2.6
Using activerecord-jdbcpostgresql-adapter 1.3.20
Using actionmailer 4.2.6
Using railties 4.2.6
Using sprockets-rails 3.0.4
Using rails 4.2.6
Bundle complete! 3 Gemfile dependencies, 36 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
$ bin/rake -T
rake about                              # List versions of all Rails frameworks and the environment
...
rake tmp:create                         # Creates tmp directories for sessions, cache, sockets, and pids
$

Next, cache gems under MRI (caches MRI gems but breaks JRuby)

$ chruby 2.3.0
$ bundle cache --all --all-platforms
Updating files in vendor/cache
  * rake-11.1.1.gem
  * i18n-0.7.0.gem
  * json-1.8.3.gem
  * minitest-5.8.4.gem
  * thread_safe-0.3.5.gem
  * tzinfo-1.2.2.gem
  * activesupport-4.2.6.gem
  * builder-3.2.2.gem
  * erubis-2.7.0.gem
  * mini_portile2-2.0.0.gem
  * nokogiri-1.6.7.2.gem
  * rails-deprecated_sanitizer-1.0.3.gem
  * rails-dom-testing-1.0.7.gem
  * loofah-2.0.3.gem
  * rails-html-sanitizer-1.0.3.gem
  * actionview-4.2.6.gem
  * rack-1.6.4.gem
  * rack-test-0.6.3.gem
  * actionpack-4.2.6.gem
  * globalid-0.3.6.gem
  * activejob-4.2.6.gem
  * mime-types-2.99.1.gem
  * mail-2.6.3.gem
  * actionmailer-4.2.6.gem
  * activemodel-4.2.6.gem
  * arel-6.0.3.gem
  * activerecord-4.2.6.gem
  * concurrent-ruby-1.0.1.gem
  * pg-0.18.4.gem
  * thor-0.19.1.gem
  * railties-4.2.6.gem
  * sprockets-3.5.2.gem
  * sprockets-rails-3.0.4.gem
  * rails-4.2.6.gem
$ bin/rake -T
rake about                              # List versions of all Rails frameworks and t...
...
rake tmp:create                         # Creates tmp directories for sessions, cache...
$ chruby jruby-9.0.5.0
$ bin/rake -T
Could not find pg-0.18.4 in any of the sources
Run `bundle install` to install missing gems.
$

^--- Tries to load the pg gem, which is wrong for the JRuby platform and doesn't try to load it without BUNDLE_CACHE_ALL_PLATFORMS as evidenced below:

$ chruby jruby-9.0.5.0
$ sed -i '' '/BUNDLE_CACHE_ALL_PLATFORMS/d' .bundle/config
$ bin/rake -T
rake about                              # List versions of all Rails frameworks and t...
...
rake tmp:create                         # Creates tmp directories for sessions, cache...
$
@coilysiren
Copy link
Contributor

This fix may require waiting for the Better Platform Support milestone

@coilysiren coilysiren added this to the 1.X -- Better Platform Support milestone Jun 8, 2016
@segiddins
Copy link
Member

This ought to be fixed by #4836

@segiddins
Copy link
Member

Closing as #4836 has been on master for a while and has now shipped in 1.14

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants