Skip to content

Warn when Erlang shipment is run on a different OTP version#5420

Open
nootr wants to merge 1 commit intogleam-lang:mainfrom
nootr:otp-version-warning-erlang-shipment
Open

Warn when Erlang shipment is run on a different OTP version#5420
nootr wants to merge 1 commit intogleam-lang:mainfrom
nootr:otp-version-warning-erlang-shipment

Conversation

@nootr
Copy link

@nootr nootr commented Mar 3, 2026

When an Erlang shipment is built with one OTP version and run with a different one, the program crashes with a cryptic undef error. This commit embeds a version check into the generated entrypoint scripts that prints a clear warning to stderr when a mismatch is detected, without booting the Erlang VM twice.

Closes #4769

Test plan

  • cargo check / cargo clippy / cargo fmt pass
  • cargo test -p gleam-core -p gleam-cli passes
  • Created a test project, exported shipment, verified OTP version is embedded in both scripts
  • Test POSIX entrypoint, with matching version and version mismatch
  • Test PowerShell entrypoint, with matching version and version mismatch

@nootr nootr marked this pull request as draft March 3, 2026 21:37
@nootr nootr marked this pull request as ready for review March 3, 2026 22:33
Detect the OTP version at build time and embed a check into the
entrypoint scripts. If the running OTP version differs, a warning
is printed to stderr before the program runs.

Closes gleam-lang#4769
@nootr nootr force-pushed the otp-version-warning-erlang-shipment branch from 76a8ad6 to bc984e1 Compare March 4, 2026 13:06
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.

Have Erlang shipments print a warning if being run with a different OTP major version

1 participant