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
Restore rack 1.6 compatibility #3156
Restore rack 1.6 compatibility #3156
Conversation
The constant Rack::RELEASE was introduced only in rack version 2 (specifically: rack/rack@a2fe30a) Earlier versions provided the class method Rack.release which still exists. puma#3061 has introduced usage of Rack::RELEASE and therefore broke compatibility with rack 1.6.X.
Yes, I think one rack1 job would make sense. Can you add it? |
Shouldn't be too hard I hope, here's the relevant places Lines 14 to 15 in 898dc44
puma/.github/workflows/tests.yaml Lines 86 to 91 in 898dc44
puma/.github/workflows/tests.yaml Lines 86 to 91 in 898dc44
|
I'm looking at this, may have additions shortly... |
Yes, I can do that. Will work on it tomorrow morning (if @MSP-Greg hasn't done it by then 😅, looking forward to their additions). |
Pushed commits, it's working correctly. Running one job with Ruby 2.4. The CI in Rack 1.6.13 (Travis, no Actions) stopped at Ruby 2.3, along with ruby-head, which I suspect was Ruby 2.4. So, although current CI passes with it, not sure about full compatibility... |
Oh wow, so much more changes needed for rack 1 support 😅 My feeling was wrong and adding a test environment for it was worth it in the end 😬 For some more context: we are currently running puma version 6.0.2 in production (without issues) and we are using the rack 1.6 fork maintained by the Rails LTS group: https://github.com/rails-lts/rack/tree/lts-1-6-stable I would be happy if this PR gets merged, even if it includes a big disclaimer that rack 1.6 support is only best effort. |
Thanks for the initial work @severin and thanks Greg for getting it over the line. |
Thank you for this fix, I just ran into it in a similar situation as @severin, running the Rails LTS fork of Rack 1.4. ❤️ Looking forward to it being released! |
Description
The constant
Rack::RELEASE
was introduced "only" (I know, it's a long time ago) in rack version 2 (specifically: rack/rack@a2fe30a). Earlier versions provided the class methodRack.release
which still exists.#3061 has introduced usage of
Rack::RELEASE
and therefore broke compatibility with rack 1.6.X. Since this was released with a minor or patch version update of puma I feel it would be nice to fix and restore compatibility with rack 1.6.X.So this PR changes usage of
Rack::RELEASE
toRack.release
. Since none of the occurrences seem to be in any code that is called per request I assume it's fine to introduce a potential tiny performance overhead of a method call vs. constant lookup.Please let me know if this makes sense and let me know if I can/should change anything with this PR.
I didn't add any tests since I didn't know how to best approach this:
rack is not a dependency of puma and there does not seem to be any infrastructure in place to run tests against different versions of rack(I now see that there's a env var that controls rack version for tests). Since rack 1.6.X is very outdated I would say in this case it's "good enough" if the change does not introduce any regressions but let me know if you have any ideas on how to better test this!Your checklist for this pull request
[ci skip]
to the title of the PR.#issue
" to the PR description or my commit messages.