[erlang-bugs] erl -make has unexpected return value when it fails

Magnus Henoch magnus@REDACTED
Fri Jan 23 15:14:37 CET 2015


Stavros Aronis <aronisstav@REDACTED> writes:

> Hello!
>
> Uncommon as it may be, "erl -make" is a valid way to make small projects
> that use an Emakefile. However, it can be the case that such a command
> fails:
>
> $ erl -pa ebin -make
> Recompile: src/packets
> src/packets.erl:1: parameterized modules are no longer supported
> src/packets.erl:10: variable 'PacketVer' is unbound
>
> Contrary to other 'make' tools, this failure is *not* reflected in the
> return value of "erl -make":
>
> $ echo $?
> 0
>
> A simple way to fix this would be to add a function (say
> 'make:all_and_exit/0') which matches the return value of 'make:all/0' and
> exits with the correct code and also modify erlexec.c to call that function
> instead of 'make:all/0'.
>
> Would such a patch be acceptable?

I submitted such a patch a while ago, but never heard anything back:

http://erlang.org/pipermail/erlang-patches/2009-March/000390.html

Feel free to turn it into a pull request :)

Regards,
Magnus



More information about the erlang-bugs mailing list