-
-
Notifications
You must be signed in to change notification settings - Fork 257
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
Matrix with 3.0
value will install 3.1
ruby
#252
Comments
3.0
value wil install 3.1
ruby3.0
value will install 3.1
ruby
Seems similar issues is tackled at #251 (comment) But maybe we just force people to use quotes in version numbers and change documentation accordingly? |
Yes you need to use quotes due to actions/runner#849 |
Yeah, I agree if this problem in other dependency So I think some mention or troubleshooting should be in readme of |
I'm running into this too, all my build started failing while running ruby 3.1.x while I thought I had told it to run ruby 3.0.x I see the README has been changed, but this is pretty confusing. I wonder if ALL examples of ruby versions should use quotes? After reading actions/runner#849, it's not clear to me that this is any kind of a bug, rather than just an unanticipated consequence of using a YAML numeric value. I wonder if this action should interpret a |
Although wanting to allow any version of Ruby matching 3.x.y is unlikely, I don't know about the above. Maybe a warning message. Not.Sure.
Being considered... A general rule is if the version text has a decimal point and ends with a zero, it should be quoted. If one wants to quote all the version values for consistency, that's fine.
YAML and other similar syntaxes are often designed to be human-readable and terse. So, parsers will try to parse a value as a number, and if that doesn't work, the value is considered a string. An example would be 3.0.3, which can't be parsed as a number. So, now we have Off-topic: the following yaml will be parsed by Psysch as two floats and a atring ---
[!!float 3, 4.0, 5.1.0] |
I don't think a lot of people think about then whey writing a simple yaml file with several lines
Yeah, thanks for description. I understand technical problem and seems this will be rather complicated to resolve elegantly Usually my rule of thumb - if someone can mess one value it's better to force everyone to use all values in quotes. So when writing a new YAML config you will not try to remember 'should I quote only 3.0 and can leave 3.1 without quotes...' Or another way - show warning if case after parsing 3.0 was replace to 3 (being 3.1) |
Another option would be supporting/showing in examples rubygems-style specifiers. If you want "latest 3.0.x", write If we had to do it all over again, that seems desirable, now that we realize Although could still be done with a I don't think anything is going to be changed in the GH runner yaml parser. It's pretty standard. For instance, almost any YAML to JSON converter you find will convert |
Maybe the easiest solution is to show all version examples quoted, and a brief explanation why? |
Due to this issue, Ruby 3.0 would use 3.1 ruby/setup-ruby#252
Due to this issue, Ruby 3.0 would use 3.1 ruby/setup-ruby#252
Due to this issue, Ruby 3.0 would use 3.1 ruby/setup-ruby#252
Due to this issue, Ruby 3.0 would use 3.1 ruby/setup-ruby#252
> A general rule is if the version text has a decimal point and ends with a zero, it should be quoted. If one wants to quote all the version values for consistency, that's fine. ref: ruby/setup-ruby#252 (comment) Signed-off-by: Peter Boling <peter.boling@gmail.com>
|
I've added quotes in the README, etc: b9675e1
No, because the GH Actions C# YAML parser could easily differentiate 3.0 and 3 (just like Ruby does), or maybe even treat all action inputs as strings without touching them, but instead it has this leaky number type which doesn't remember if it was floating point or not. |
I'm not totally sure that this is issue in
ruby/setup-ruby
iselft, but let me describe itFor quite a long time I've used this code block in different github actions in my different projects
This worked well, it set up several ruby versions and run my tests
But with the release of ruby v3.1 I've noticed a very strange situation
That instead of v3.0 is v3.1 actually installed
You can take a look at that workflow
On
Setup Ruby 3
stage in logs we see that:First of all - I fought 'oh my bad, seems that if I send version as interger and not strings if will install latest major version
But I've rechecked version 2.6 - it send in config as
2.6
, not a'2.6'
and still installing it correctly, not latest v2.7I see in docs - https://github.com/ruby/setup-ruby#matrix-of-ruby-versions that 3.0 is in quotes, but I don't quite get why only 3.0 need quotes?
And if quotes are really required - maybe add some readme statement about this to clarify reasons?
The text was updated successfully, but these errors were encountered: