Skip to content

Keep :erts in release applications without colliding with the ERTS copy - #15935

Merged
josevalim merged 3 commits into
elixir-lang:mainfrom
rgfaber:release-erts-application
Sep 25, 2026
Merged

josevalim merged 3 commits into
elixir-lang:mainfrom
rgfaber:release-erts-application

Conversation

@rgfaber

@rgfaber rgfaber commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Closes #15934.

bea1c6c (for #14236) removed :erts from release.applications, but :erts stays in the boot modes. So any release where an application lists :erts (for example a dependency on horus, used by khepri) fails with Unknown application :erts.

#14236 itself came from a name collision in Mix.Tasks.Release.assemble/1: the application :erts was dispatched to copy(:erts, release), the ERTS binaries step. That ran copy_erts/1 twice concurrently and never copied lib/erts-VSN. This PR keeps :erts in release.applications and tags application copies as {:app, app}, so the two can no longer collide.

Tests:

  • Mix.ReleaseTest: the unit test added in bea1c6c now asserts :erts is present when requested.
  • Mix.Tasks.ReleaseTest: new test that assembles and boots a release with applications: [erts: :permanent], and asserts both erts-VSN/bin/erl and lib/erts-VSN/ebin/erts.app. It fails on main with Unknown application :erts and passes with this change.

Also checked outside the suite on OTP 28.4.3: a project depending on {:horus, "0.3.1"} assembles and boots with this change (Application.ensure_all_started(:horus) returns {:ok, [:erts, :tools, :horus]}).

bea1c6c removed :erts from release.applications to avoid the copy race
in elixir-lang#14236, but :erts stays in the boot modes, so any release where an
application lists :erts (for example a dependency on horus) now fails
with "Unknown application :erts".

Keep :erts in release.applications and tag application copies as
{:app, app}, so an application named :erts no longer dispatches to the
ERTS binaries copy step.
Comment thread lib/mix/lib/mix/tasks/release.ex Outdated
Comment thread lib/mix/lib/mix/tasks/release.ex Outdated
Co-authored-by: José Valim <jose.valim@gmail.com>
@josevalim
josevalim merged commit 4835eca into elixir-lang:main Sep 25, 2026
15 checks passed
@josevalim

Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

mix release fails with "Unknown application :erts" when an application lists :erts

2 participants