Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Preserve BUNDLE_GEMFILE and add a test for it #1893
Preserve BUNDLE_GEMFILE and add a test for it #1893
Changes from 27 commits
56bbc2d
a3ed997
4b27762
dad3e58
9c2dd28
5e7a6fd
7d6780d
4cfd3b8
242c140
f15121f
3020316
d89af85
c83401c
cbf32d5
95bcd05
3be5f32
9dcd2e3
2ed158e
359cb69
08dc10f
0d020df
d804495
10d4183
d84e0ae
3d1c5e0
f73cd57
bc4217b
62f075f
1846ef3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Oh, what happened?
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.
Something about the environment in the Travis build was causing
Bundler.with_original_env
to make Puma load in an endless loop. Puma would load, it would callBundler.with_original_env
, then callKernel.exec('puma-wild', ...)
, then the loop would start over again.You can see that loop in this failed build.
I could not reproduce this issue locally, even with the same version of Ubuntu, same version of Ruby, same version of Bundler, and same version of RVM. There are probably other pieces in the environment on the Travis build that I am not aware of and did not fully replicate.
Testing this required, as you can see, pushing many commits to track down the problem.
The
prune_bundler
method is recursive, as you know, and it relies on the linereturn unless defined?(Bundler)
as its terminal case. Something about the Travis environment (I suspect it's RVM) was causing Bundler to be loaded every time the method recursed.As I am out of time to work on this, I went back to the hacky solution that copies the needed env var (
BUNDLE_GEMFILE
) back into the environment after we runBundler.with_clean_env
.It's not my favorite solution, at all. But it meets our needs and should not break anything in other people's environments.
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.
Travis is pretty dirty in my experience, so I've switched my repos to other CIs. You can consider something similar too.
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've moved almost everything to Github Actions, but Ruby 2.2 can't be moved (yet?).
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.
Ruby 2.2 is no more maintained, even security, but I understand that you want to support its users. But I personally consider its usage dangerous and prefer to drop support from gems.
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.
Since https://github.com/ruby/setup-ruby/releases/tag/v1.14.0 it is possible to use Ruby 2.2 on GitHub Actions... but it could be that there's something else missing for the Puma test setup (e.g. that version wasn't built with the OpenSSL version we want to test Puma with, I'm sure @MSP-Greg knows about this and maybe even have tried it, I don't have the time to double check it now)
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.
I should note that I believe Travis' environment actually saved us from shipping a bug here. Something in that particular environment was causing the Bundler constant to be loaded earlier than anticipated. I suspect it is some RVM magic.
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.
One difference between Travis and GitHub Actions is (was) the
bundle install
commandTravis does the following (https://travis-ci.org/puma/puma/jobs/656438353#L885)
Before #2126 (5 days ago),
--path
wasn't used on GitHub Actions, now it is:puma/.github/workflows/ruby.yml
Lines 38 to 39 in 8f28220
Haven't checked if it matters for this particular discussion but thought it was worth mentioning here