Skip to content
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

Can't start Hex on OTP 28.0-rc1 #1065

Open
kipcole9 opened this issue Feb 21, 2025 · 4 comments
Open

Can't start Hex on OTP 28.0-rc1 #1065

kipcole9 opened this issue Feb 21, 2025 · 4 comments

Comments

@kipcole9
Copy link

kipcole9 commented Feb 21, 2025

I installed OTP 28.0-rc1 with mise and received the following error. I suspect just too early in the release cycle but posting here in case it has slipped by.

% mise use elixir@1.18.2
mise ~/Development/cldr/mise.toml tools: elixir@1.18.2
% mise use erlang@28.0-rc1
mise ~/Development/cldr/mise.toml tools: erlang@28.0-rc1
% mix local.hex
Found existing entry: /Users/kip/.mix/archives/hex-2.1.1
Are you sure you want to replace it with "https://builds.hex.pm/installs/1.16.0/hex-2.1.1.ez"? [Yn]
* creating /Users/kip/.mix/archives/hex-2.1.1
% iex -S mix
Erlang/OTP 28 [RELEASE CANDIDATE 1] [erts-16.0] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]


14:25:29.289 [error] beam/beam_load.c(592): Error loading function 'Elixir.Hex.State':print_invalid_config_error/2: op bs_add p x x u x:
  please re-compile this module with an Erlang/OTP 28 compiler or update your Erlang/OTP version
@wojtekmach
Copy link
Member

Hey Kip, we will fix it by the time OTP 28 is out, hopefully much sooner. The problem is we precompile Hex for given Elixir version and the oldest supported OTP for that Elixir version. So you are probably running Hex compiled against OTP 25 on OTP 28 and they aren’t compatible. We will be precompiling Hex per OTP version going forward and it will fixed.

In the meantime you can do the following:

$ mix archive.install github hexpm/hex branch latest

@kipcole9
Copy link
Author

Totally makes sense - I guess I thought he'd was already OTP versioned. Thanks for letting me know. I'll close.

@wojtekmach
Copy link
Member

Im gonna keep it open as informational until it is fixed!

@josevalim
Copy link
Member

josevalim commented Apr 6, 2025

I have been looking into this and it seems the changes are relatively straight-forward. The only downside is that we will need a new CSV file/format but at least this format does not need to be signed (although we should probably keep signing it since the code is already there anyway).

Currently the format it:

HEX_VERSION,CHECKSUM,ELIXIR_VERSION

It should be:

HEX_VERSION,CHECKSUM,ELIXIR_VERSION,OTP_VERSION

Emitting this format will be a matter of changing these two lines:

https://github.com/hexpm/hex/blob/main/scripts/release.sh#L86-L87

To be pairs, such as:

hex_csv "${hex_version}" 1.6.0,19.3 1.7.0,19.3

Except that, since we need a new file, we can start from scratch, so something like:

hex_csv "${hex_version}" 1.18.0,25.0 1.18.0,27.0

And then we must also attach the OTP version to the uploaded files.

So my overall suggestion is:

  1. Release Hex v2.2 using the old format
  2. Move both release.sh and release_rebar.sh to a scripts/old folder, theoretically we don't run it again unless for bug fixes on v2.2
  3. Create new release scripts following the format above for both rebar and elixir (for rebar, since it doesn't depend on Elixir version, we can keep it fairly static, simply the latest version we use in release_rebar today)
  4. Create the new CSV files and run the scripts
  5. Change Elixir to also match on the Erlang/OTP version

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

No branches or pull requests

3 participants