Open
Description
Running rebar3 release
on Windows with cygwin results in the following error:
$ ./rebar3 release
�[0;32m===> Verifying dependencies...
�[0mmake: Nothing to be done for 'all'.
�[0;32m===> Compiling mta
�[0m�[0;32m===> Compiling misc
�[0m�[0;32m===> Starting relx build process ...
�[0m�[0;32m===> Resolving OTP Applications from directories:
d:/data/projects/mta/build/default/lib
d:/data/projects/mta/apps
c:/Program Files/erl7.1/lib
d:/data/projects/mta/build/default/rel�[0m
�[0;35m===> Missing beam file elf_format <<"c:/Program Files/erl7.1/lib/hipe-3.13/ebin/elf_format.beam">>
�[0m�[0;32m===> Resolved mta-0.1
�[0m�[0;32m===> Dev mode enabled, release will be symlinked
�[0mCannot create a file when that file already exists.
Cannot create a file when that file already exists.
Cannot create a file when that file already exists.
Cannot create a file when that file already exists.
�[0;32m===> release successfully created!
�[0m�[0;31m===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace
�[0m�[0;32m===> When submitting a bug report, please include the output of `rebar3 report "your command"`
�[0m
I am not sure if the erl_format
issue above is bogus.
The failing bit is in the overlay section which has:
{relx, [
{overlay, [
{link, "apps/mta/etc/mta.test.config","{{output_dir}}/releases/{{rel_vsn}}/mta.test.config"}
...
]}.
The error below indicates that relx
is failing with eperm
though when creating the link by hand it works fine:
$ ln -s apps/mta/etc/mta.test.config build/default/rel/mta/releases/0.1/mta.test.config
�[0m�[0;31m===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace
�[0m�[0;36m===> Uncaught error: function_clause
�[0m�[0;36m===> Stack trace to the error location: [{rlx_prv_overlay,
format_error,
[{link_failed,
<<"d:/data/projects/mta/apps/mta/etc/mta.test.config">>,
<<"d:/data/projects/mta/build/default/rel/mta/releases/0.1/mta.test.config">>,
eperm}],
[{file,
"/home/travis/build/rebar/rebar3/_build/default/lib/relx/src/rlx_prv_overlay.erl"},
{line,72}]},
{rlx_prv_overlay,
'-format_error/1-lc$^0/1-1-',
1,
[{file,
"/home/travis/build/rebar/rebar3/_build/default/lib/relx/src/rlx_prv_overlay.erl"},
{line,84}]},
Executing the same code in erlang by hand results in:
1> file:make_symlink("apps/mta/etc/mta.test.config", "build/default/rel/mta/releases/0.1/mta.test.config").
{error,eperm}
So, this works in cygwin's bash without issues, but fails when making file:make_symlink/2
call. Maybe a bug in this function that needs to be worked around by relx?