-
Notifications
You must be signed in to change notification settings - Fork 63
Fix calculating -otp-
major for Elixir
#351
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
Fix calculating -otp-
major for Elixir
#351
Conversation
@Schultzer, I can't invite you for a "proper" review, so I'm mentioning you to hopefully notify you. |
Mind you this doesn't fix @wojtekmach's second use case where |
aa4b8a4
to
4558652
Compare
@wojtekmach, if this fixes the range issue (not the |
I also noticed:
doesn't work: https://github.com/wojtekmach/setup_beam_bug/actions/runs/15921976367/job/44910621256 unfortunately the action does not show the URL it's trying to download from. This works though:
|
Correct. I'd written "Mind you this doesn't fix @wojtekmach's second use case where 1.19's -rc is being picked up". In any case they're different problems, and I think it should be a different PR. |
This seems 👀 related to my changes, though, so I'll try to find a test for it and then fix it, if possible. |
I don't think I'll be able to write a proper test, not without some complexity, because |
I think we'll have to open an exception for Elixir there:
But I don't think there's a correspondence in Elixir's The same goes for For |
There you go: https://github.com/erlef/setup-beam/actions/runs/15926064004/job/44923493706?pr=351#step:5:1 If the |
Yeah, totally up to you how you wanna proceed with this. I was just trying to be helpful pointing error scenarios that were not caught with tests.
Correct, there's no OTP maint counterpart in Elixir.
OTP maint-28 counterpart would be Elixir v1.18 branch and corresponding builds:
not sure if this is what you were asking but for:
it is important to grab, at the time of writing, |
And they were helpful for sure, thank you.
Is this easy to have a rule for? Or is it an unlikely scenario? Because I'm not sure we want exceptions like hardcoded versions...
Correct, at least for the distribution protocol and support range. What you're pointing out (as missing) is |
just to be clear, you were asking if there is a maint equivalent and there isn’t, and if there is maint-RELEASE equivalent and there is, vMAJOR.MINOR. what do you mean by having a rule? Are you asking what’s the rule |
I meant "if somebody were to choose OTP You wrote
But then there's 4 versions, so which one should the version auto pick... I'm thinking e.g., for |
Per https://github.com/erlef/setup-beam/actions/runs/15926064004/job/44923493706?pr=351#step:5:8, I guess that's what'll happen when |
I'm pushing a new test for OTP |
It fails on OTP |
4d5291f
to
106a057
Compare
What are the 4 versions? 1.18.4 those four? |
Correct, but in any case I think there's no follow-up here. The consumer should know what they're asking for, especially if they want a specific Elixir version. |
Does it make sense to have an exception for this? Because we're not execution the OTP bin to fetch a version, from
|
7839da3
to
b1ab773
Compare
rebar3 is saying something about SSL, most likely because our tests are installing a bunch of OTPs which makes for unpredictable behavior
b1ab773
to
65e1798
Compare
I think I'm done for now, again. I'll re-summarise at the top. |
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.
LGTM, It’s great that we get rid of those regexes.
@wojtekmach, when you test this out (or just comment based on the content) I'll be ready to merge and release as patch. |
Looks good in my tests: https://github.com/wojtekmach/setup_beam_bug/actions/runs/15993638443, 👍 |
This was released in v1.20.2. |
Description
We keep the previous constraint of "user-defined version as 1.19-otp-28" winning over the OTP input, but we now use the
otpVersion
from the installed OTP instead of the user input, which also simplifies code around regular expressions.What changes
process.env.NODE_ENV
to allow bypassing the initial action run during testsotpVersionMajor
based on input and regex, we make an actual system call (sync) to determine it and use itmaster
/ Elixirmain
from becoming Elixirmain
and notmain-otp-29
, for example, when that one's out... everything else remains the same
Version matching examples (from the tests)
<26
/ Elixir<1.17
results in Elixirv1.16.3-otp-25
master
/ Elixir> 0
results in Elixirv1.19-otp-28
master
/ Elixirmain
results in Elixirmain-otp-28
OTP-27
/ Elixir1.18.x
results in Elixirv1.18.4-otp-27
OTP-26
/ Elixirv1.15.0-rc.2
results in Elixirv1.15.0-rc.2-otp-26
25.2
/ Elixirmain
results in Elixirmain-otp-25