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 |
There was a problem hiding this comment.
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.
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.
brrygrdn
left a comment
There was a problem hiding this comment.
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.
This is required when running with bundler 2 installed alongside v1, without this it defaults to v2 during dry-runs.
There was a problem hiding this comment.
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 <brrygrdn@github.com>
5b0a34b to
1535a20
Compare
This brings back this revert: #3222
Work in progress to figure out how to run multiple bundler version