-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Redo: Run Bundler v1 helpers with explicit version #3223
Conversation
Test failures aside, I think using Bundler's own environment management is a step in the right direction, I've been able to get a sensible outcome across the three test repos along with our specific git-dependency test https://github.com/dsp-testing/bundler1-git-test bin/dry-run.rb bundler dsp-testing/bundler1-git-test
|
# Bundler will pick the matching installed major version | ||
"BUNDLER_VERSION" => bundler_version, | ||
"BUNDLE_GEMFILE" => File.join(versioned_helper_path(bundler_version: bundler_version), "Gemfile"), | ||
"BUNDLE_PATH" => File.join(versioned_helper_path(bundler_version: bundler_version), ".bundle") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this to match BUNDLE_GEMFILE
but not sure it's necessary, both seemed to work inside and outside the container with v1 and v2 installed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed synchronously, I'm 👍🏻 on having versioned_helper_path(bundler_version: bundler_version)
as a clean(ish) room bundler path for all things related to the native helper process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pending some further testing, I think this is ready to 🚢 🎉
Since it took a lot of iterations to get this working end to end, how do you feel about squashing the commit history for merge?
7a07768
to
d38670d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
env: { | ||
# Bundler will pick the matching installed major version | ||
"BUNDLER_VERSION" => bundler_version, | ||
"BUNDLE_GEMFILE" => File.join(versioned_helper_path(bundler_version: bundler_version), "Gemfile"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is required when running with bundler 2 installed alongside v1, without this it defaults to v2 during dry-runs.
@@ -1,5 +1,7 @@ | |||
# frozen_string_literal: true | |||
|
|||
require "find" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed synchronously, the use of Find
in these gemspecs is atypical and not suggested by Bundler v1.17.x or v2.x.x when generating new gems.
Since Find
isn't in the ruby context by default, we'd expect .gemspecs
in the real world to have this require
This brings back this revert: #3222 We've wrapped bundler native helpers in `Bundler.with_original_env` to use the env before bundler was initialised in core. This removed the need to manually unset env vars like `GEM_HOME` and `GEM_PATH` which caused bundler to default git install to `/var/lib/gems/2.6.0/cache/bundler/git` when run in the parent container, where it doesn't have write permission. With this change the the bundle cache is written to the native helper folder/.bundle. Co-authored-by: Barry Gordon <[email protected]>
5b0a34b
to
1535a20
Compare
This brings back this revert: #3222
Work in progress to figure out how to run multiple bundler version