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
Handle BUNDLER_VERSION being set to an empty string #6928
base: master
Are you sure you want to change the base?
Conversation
Thanks for opening a pull request and helping make RubyGems and Bundler better! Someone from the RubyGems team will take a look at your pull request shortly and leave any feedback. Please make sure that your pull request has tests for any changes or added functionality. We use GitHub Actions to test and make sure your change works functionally and uses acceptable conventions, you can review the current progress of GitHub Actions in the PR status window below. If you have any questions or concerns that you wish to ask, feel free to leave a comment in this PR or join our #rubygems or #bundler channel on Slack. For more information about contributing to the RubyGems project feel free to review our CONTRIBUTING guide |
cb1e1cb
to
68eb32a
Compare
fb76694
to
98277dc
Compare
@@ -150,6 +150,12 @@ | |||
sys_exec "bin/bundle install", :env => { "BUNDLER_VERSION" => "999.999.998", "DEBUG" => "1" }, :raise_on_error => false | |||
expect(out).to include %(Using bundler 999.999.998\n) | |||
end | |||
|
|||
it "runs correctly even if empty" do | |||
skip "does not work on old rubies" if RUBY_VERSION < "2.7.0" |
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.
we are now 3.0+, this line should be deletable
This is useful, in case you're using Docker, and an upstream Dockerfile sets BUNDLER_VERSION to something you don't want. It's impossible to unset it... only override to be the empty string.
dec8cda
to
8246cec
Compare
Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
Instead of trying to update all usage of |
This is useful, in case you're using Docker, and an upstream Dockerfile sets BUNDLER_VERSION to something you don't want. It's impossible to unset it... only override to be the empty string.
What was the end-user or developer problem that led to this PR?
I have a Dockerfile that has an upstream Dockerfile that sets BUNDLER_VERSION, but I don't want that set. I instead want bundler to automatically use the correct version from my Gemfile.lock. Unfortunately, once an env var is set in Docker, it can't be unset. Only overridden (and set to the empty string). When I do that, I get this:
What is your fix for the problem, implemented in this PR?
Treat an empty BUNDLER_VERSION env var the same as not present at all.
Make sure the following tasks are checked