8000 Override OTP version when specified in Elixir spec by kevinschweikert · Pull Request #330 · erlef/setup-beam · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Override OTP version when specified in Elixir spec #330

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

Merged

Conversation

kevinschweikert
Copy link
Contributor

Description

When specifying an Elixir version like 1.18.4-otp-27and OTP version 28.0 the action would overwrite this to 1.18.4-otp-28 which does not exist, although the versions are compatible. This fixes the issue by overriding the OTP major version when specified in the spec

Closes #329 .

const userSuppliedOtp = exSpec0.match(/-otp-(\d+)/)?.[1] ?? null

if (userSuppliedOtp && isVersion(userSuppliedOtp) && userSuppliedOtp !== otpVersionMajor) {
8000 core.warning(`Elixir built for Erlang/OTP ${userSuppliedOtp} does not match the specified Erlang/OTP version ${otpVersionMajor}`)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is subjective but to me this is not a warning, it's a feature not a bug. Btw, does the warning appear in tests? do we have something like ExUnit.CaptureLog?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the warning shows up in the test but also all debug messages. I found this actions/toolkit#118 but it seems there is no built in way to capture the log for a single test case.

I have no preference if we want to handle it silently or warn the user that they have a mismatch. Just let me know what works best for you.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, please remove the warning. We can always add it later.

@kevinschweikert kevinschweikert force-pushed the fix/explicit-elixir-otp-versions branch from 591632b to fc46e54 Compare May 22, 2025 15:44
@wojtekmach
Copy link
Collaborator
wojtekmach commented May 23, 2025

@paulo-ferraz-oliveira let's ship this? At the moment there's no way to pick Elixir with OTP 28. Upcoming Elixir 1.19 will be precompiled against it but we shouldn't wait for it IMHO, I think it is entirely reasonable for folks to pick, say, elixir-version: 1.18.4-otp-27, otp-version: 28.0 in the meantime.

@paulo-ferraz-oliveira
Copy link
Collaborator

@wojtekmach, I'm Ok to ship it. I was just expecting CI to pass.

@paulo-ferraz-oliveira
Copy link
Collaborator

What's probably failing here is that npm run build-dist (or similar) is not being executed - it's mentioned in the contributing guide, but maybe not explicitly so -, so the code used for testing would not be the one used for distributing.

@kevinschweikert kevinschweikert force-pushed the fix/explicit-elixir-otp-versions branch from fc46e54 to 3155eef Compare May 24, 2025 21:03
@kevinschweikert
Copy link
Contributor Author

Ah my bad! I thought the /dist directory would be generated by CI. I ran the command and added the files to the PR. CI should now succeed!

@paulo-ferraz-oliveira
Copy link
Collaborator

Argh, CI's now failing because of rebar3 3.25 (and nightly) it seems. I didn't dig into the details...

@paulo-ferraz-oliveira
Copy link
Collaborator

I've created a draft (for now) PR: #331. This'll hopefully remove the issues with testing around the latest rebar3.

@paulo-ferraz-oliveira
Copy link
Collaborator

#331 proposes changes to fix the tests. I think it'd be best to rebase this one and release only after that one's merged...

@starbelly starbelly force-pushed the fix/explicit-elixir-otp-versions branch from 3155eef to abfd95a Compare May 25, 2025 15:43
Copy link
Member
@starbelly starbelly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@starbelly starbelly merged commit 3e793a7 into erlef:main May 25, 2025
47 checks passed
@paulo-ferraz-oliveira
Copy link
Collaborator

This change was released in v1.19.0, also tagged v1.19 and v1 (moved).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot use Elixir 1.18-otp-27 with OTP 28
4 participants
0