-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Bundler not working as expected for cross-platform gems #3371
Comments
Can you please share the output of |
ping @xam7247 |
@colby-swandale following is the output of bundle env (I have obscured username and workspace location) Environment
Bundler settings
GemfileGemfilesource 'https://rubygems.org'
# Core gems
gem 'rspec', '>= 3.4.0'
gem 'colorize'
gem 'mongo'
gem 'json'
gem 'capybara'
gem "json-schema"
gem 'rubyXL'
gem "roo", "~> 2.7.0"
# Specify gems that have different version
# on windows and linux, so that bundler
# caches other platform gems too.
# See README for detailed explaination
gem "ffi"
gem "unf_ext"
gem "rest-client", path: "rest-client-2.0.2"
gem "nokogiri" Gemfile.lock
|
Any updates on this please ? |
There is no update for this issue, no one on the core team runs Windows so this issue is hard and very timely for any of us to look into to try to reproduce it. |
Is there really no solution for this issue? |
I'm not sure if it helps anyone, but I experience this same issue in 1.16.*. Specifically the ffi gem, mentioned in the original post. I've found that reverting back to 1.15.4 seems to remove the issue? I haven't spent time trying to figure out why yet. |
To stop the cache call on an install, pass I don't know enough about the code to figure out what the issue is, but going down the stack with a gemfile.lock that has pg 1.0.0 and pg 1.0.0-x64-mingw32 in it and is setup for ruby, x64-mingw32, and x84_64-linux... The error is raised by cli\install.rb as it rescues either GemNotFound or VersionConflict (I'm betting it's the first in this case) around line 88.
That eventually leads you to
Line 134 is causing the exception as it chokes on a gem that isn't for the platform the command is being run on.
|
https://nvd.nist.gov/vuln/detail/CVE-2018-1000201 Configured bundler to update cached gems for all platforms. Helpful links on that: * https://bundler.io/v1.16/man/bundle-config.1.html * rubygems/bundler#5863 * https://github.com/bundler/bundler/issues/5989 * googleapis/google-cloud-ruby#1592
Please note that issue is exactly same if 'Development machine' is mac and CI machine is linux. In Gemfile.lock:
seemingly no way to make vendor/cache contain gems for linux platform if command is run on mac.... Edit: while it could be possible to ask bundler to vendor only 'ruby' platform, so that everything would be compiled from 'raw sources', that would make deploy much longer, being able to instead package multiple platform specific gems into vendor/cache would be much better. Edit2: another workaround is to remove --deployment from bundle install, so it is allowed to use both remote and local sources, but it can introduce non-reproducibility issue across platforms. |
Potential workaround, in case it helps anyone. In our case, we need to cache a linux specific libv8 in vendor/cache, when building on a Mac. The following gets us around the 'could not find in any of the sources' error: $ rm -rf vendor/cache/libv8* |
Could you try #4022 and verify whether it fixes this issue? Thanks! |
I'll assume issue is fixed by mentioned PR. |
@deivid-rodriguez : Unfortunately I don't have access to a windows machine anymore. So until someone else lands into the same issue, we can rightly assume that #4022 might have fixed this 👍 |
Not fixed and not working in bundler 2.4.2 on Windows, Mac, and Linux. Either gemfile.lock and tree
|
Please report a separate issue with repro steps. Thank you. |
👍 I'll scare up a MCE Dockerfile when I have a chance.
…On Fri, Jan 20, 2023 at 4:39 AM David Rodríguez ***@***.***> wrote:
Please report a separate issue with repro steps. Thank you.
—
Reply to this email directly, view it on GitHub
<#3371 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABWYMAIXZ4LA7HPKQTHBMDWTJTMTANCNFSM4LIKRV7A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Is multiplatform FOSS testing and on-demnd testing still a PITA?
At work, we have to run Ruby-based software in extremely
heterogeneous use-cases.
|
After going through rubygems/bundler#5863, rubygems/bundler#4517, rubygems/bundler#646, rubygems/bundler#2040, rubygems/bundler#2283, rubygems/bundler-features#4, and many more issues on the same note, I still face this issue.
Development machine: Windows
CI machine: Linux (No internet connection, no other Linux machine available to generate a *nix based Gemfile / caching the gems)
Ruby: v2.3.3
Bundler: v1.15.1
Gemfile:
Gemfile.lock
As per rubygems/bundler#5863, I did:
bundle config specific_platform true
bundle lock --add-platform ruby
bundle package --all-platforms
Doing this, Bundler did download the gems for other platform ('ruby' in this case), along with gem files for current platform ('x64-mingw32').
Note: I had to add the dependent gems 'ffi', 'unf_ext' and 'nokogiri' since bundler was not downloading other platform gems unless these were explicitly mentioned in Gemfile.
Problem:
After this, when you do
bundle install --local
(on the windows machine), it installs gems from vendor/cache, but throws an error randomly for one of the cross-platform gems.e.g., "
Some gems seem to be missing from your vendor/cache directory. Could not find ffi-1.9.18 in any of the sources
"Post this,
bundle exec ...
still works.So:
Any solutions would be much appreciated.
The text was updated successfully, but these errors were encountered: