Release name not used in release bin scripts

Hi, I have either found a bug in Elixir’s mix release task or I am doing something wrong.

I added a releases section to my mix.exs def project do section as follows:

  app: :nai,
  default_release: :naiims,
  releases: [
    naiims: [
      include_executables_for: [:unix],
      applications: [runtime_tools: :permanent],
      steps: [:assemble, :tar]

The actual module namespace I use in my code is Nai. and all my config’s are config :nai, ....

After running MIX_ENV=prod mix release I have executables in _build/prod/rel/naiims/bin/, the main executable being _build/prod/rel/naiims/bin/naiims, which is right. But the other scripts (server and migrate) are calling nai! Here is the server script for example:

cd -P -- "$(dirname -- "$0")"
PHX_SERVER=true exec ./nai start

It should be ./naiims not ./nai.

Btw, I also noticed it is still generates the windows .bat files even though my config specifies :unix.

(Personally I wish there was just the one exectuable (e.g. naiims) and neither of other two, and one could just say naiims migrate for migrations.)

1 Like

Likely a stupid advice but have you tried removing the _build and deps directories and do mix do deps.get, release?

I realized that these files were being produced by mix phx.gen.release and that I don’t have to run that task every time I do a mix release. Just need to run it the one time. So even though it generates slightly incorrect scripts, I can fix them and forget about it (at least for a while).

I guess I should report this as a bug to the Phoenix project.

BTW I tried your suggestion to fix a more insidious issue I am having. But to no avail. Nonetheless, thanks for the suggestion.