Skip to content

Escript programs not building properly with 4.1.0 #13965

@bneumeier

Description

@bneumeier

Describe the bug

I am trying to build rabbitmq-server 4.1.0 from source on a Linux machine. I'm using Erlang 27.3.4 and I've tried using Elixir 1.18.4 and 1.17.3.

The broker itself builds and works fine. However, the escript programs under /usr/lib/erlang/lib/rabbitmq-server-4.1.0/escript fail with "escript: exception error: undefined function 'Elixir.RabbitMQCtl':main/1".

When I unzip the archives, I find that they contain basically the entirety of the /usr/lib directory, but do not contain what they're expected to. Looking at the compile log, I see a number of failures that I think are responsible for the problem but am not proficient enough with Erlang to diagnose. The first sample is:

make[4]: Entering directory '/usr/src/rabbitmq-server/rabbitmq-server-4.1.0/deps/csv'
 DEPEND csv.d
Error! Failed to eval:  {ok, _} = application:ensure_all_started(elixir),       {ok, _} = application:ensure_all_started(mix),  ModCode = list_to_atom("Elixir.Code"),  ModCode:put_compiler_option(ignore_module_conflict, true),    ModComp = list_to_atom("Elixir.Kernel.ParallelCompiler"),       ModMixProject = list_to_atom("Elixir.Mix.Project"),     erlang:group_leader(whereis(standard_error), self()), ModMixProject:in_project(csv, ".", [], fun(_MixFile) ->         case ModComp:compile_to_path([<<"lib/csv.ex">>,<<"lib/csv/decoding/decoder.ex">>,<<"lib/csv/decoding/parser.ex">>,<<"lib/csv/defaults.ex">>,<<"lib/csv/encoding/encode.ex">>,<<"lib/csv/encoding/encoder.ex">>,<<"lib/csv/exceptions.ex">>], <<"ebin/">>) of                  {ok, Modules, _} ->                             lists:foreach(fun(E) -> io:format(user, "~p ", [E]) end, Modules),                            halt(0);                        {error, _ErroredModules, _WarnedModules} ->                             io:format(user, "_ERROR_", []),                               halt(1)         end     end)

Runtime terminating during boot ({{badmatch,{error,{elixir,{"no such file or directory","elixir.app"}}}},[{erl_eval,expr,6,[{file,"erl_eval.erl"},{line,667}]},{erl_eval,exprs,6,[{file,"erl_eval.erl"},{line,271}]},{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done
 EXC    7 files
 APP    csv

Any help would be greatly appreciated!

Reproduction steps

  1. Build and install erlang 27.3.4
  2. Build and install elixir 1.17 or 1.18
  3. Build rabbitmq-server 4.1.0 with "make -j1 PREFIX=/usr ELIXIR_BIN=/bin/elixir"
    ...

Expected behavior

escripts have content similar to what is found in rabbitmq-server-generic-unix-4.1.0.tar.xz distribution

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions