-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Gem::Platform.match no longer behaves properly with a String argument #5938
Labels
Comments
flavorjones
added a commit
to rails/tailwindcss-rails
that referenced
this issue
Sep 19, 2022
to work around rubygems/rubygems#5938 Closes #200
flavorjones
added a commit
to rails/tailwindcss-rails
that referenced
this issue
Sep 19, 2022
to work around rubygems/rubygems#5938 Closes #200
flavorjones
added a commit
to rails/tailwindcss-rails
that referenced
this issue
Sep 19, 2022
to work around rubygems/rubygems#5938 Closes #200
flavorjones
added a commit
to rails/tailwindcss-rails
that referenced
this issue
Sep 19, 2022
to work around rubygems/rubygems#5938 Closes #200
flavorjones
added a commit
to flavorjones/rubygems
that referenced
this issue
Sep 19, 2022
Previously 9eead86 introduced non-commutativity of platforms, and later commit 1b9f7f5 changed the behavior of `Gem::Platform.match` to ensure the callee of `#=~` was the gem platform. However, when the platform argument is a String, then the callee and argument of `#=~` are flipped (see docs for `String#=~`), which works against the fix from 1b9f7f5. Closes rubygems#5938
4 tasks
I've submitted a PR with a test and a fix at #5939 |
anderscain63
added a commit
to anderscain63/tailwindcss-rails
that referenced
this issue
Dec 20, 2022
to work around rubygems/rubygems#5938 Closes #200
titan2gman
added a commit
to titan2gman/tailwindcss-rails
that referenced
this issue
Dec 27, 2022
to work around rubygems/rubygems#5938 Closes #200
smartech7
pushed a commit
to smartech7/rails-tailwind-css
that referenced
this issue
Aug 4, 2023
to work around rubygems/rubygems#5938 Closes #200
XLoopLion
added a commit
to XLoopLion/tailwindcss-rails
that referenced
this issue
Jun 12, 2024
to work around rubygems/rubygems#5938 Closes #200
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the problem as clearly as you can
When passing a string to
Gem::Platform.match
, the behavior of the method is the same as before 1b9f7f5 introduced a fix for musl platforms.Although
Gem::Platform#=~
properly coerces theother
argument, the#match
method, when passed aString
, will instead invokeString#=~
.The interesting bit can be seen in the docstring for
String#=~
(from https://ruby-doc.org/core-3.1.2/String.html#method-i-3D~)thereby avoiding the intended behavior change of 1b9f7f5
Did you try upgrading RubyGems?
Present in 3.3.22
Post steps to reproduce the problem
On a
x86_64-linux-musl
system (e.g.,ruby:3.1-alpine
image):Run
gem env
and paste the output belowProposed fix
I think the right thing to do here is to coerce the argument to a
Gem::Platform
object, so something like:I couldn't figure out how to write a nice test for this, but hopefully I've provided enough detail?
The text was updated successfully, but these errors were encountered: