grisp / mix_grisp

Mix plug-in for GRiSP
https://www.grisp.org
Apache License 2.0
5 stars 6 forks source link

Erlexec compile error in mix grisp.deploy #13

Open ziopio opened 2 months ago

ziopio commented 2 months ago

In grisp_tools 2.7.0 erlexec is introduced in the dependency tree, but somehow mix cannot build it.

mix grisp.deploy                                                                                                                                                   
===> Error reading file /Users/***/Desktop/grisp/testex/_build/dev/lib/erlexec/mix.rebar.config: 8: cannot translate from UTF-8
** (Mix) Could not compile dependency :erlexec, "/Users/***/.asdf/installs/elixir/1.16.3-otp-26/.mix/elixir/1-16/rebar3 bare compile --paths /Users/***/Desktop/grisp/testex/_build/dev/lib/*/ebin" command failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile erlexec --force", update it with "mix deps.update erlexec" or clean it with "mix deps.clean erlexec"

This is the generated file _build/dev/lib/erlexec/mix.rebar.config

{hex,[{doc,ex_doc}]}.
{ex_doc,[{extras,[{"README.md",#{title => "Overview"}},
                  {"LICENSE",#{title => "License"}}]},
         {main,"README.md"},
         {authors,["Serge Aleynikov"]},
         {source_url,"https://github.com/saleyn/erlexec"}]}.
{erl_opts,[debug_info,warn_export_all]}.
{edoc_opts,[{def,{vsn,"fatal: .git non � un repository Git (n� lo � alcuna delle directory genitrici)"}}]}.
{plugins,[rebar3_hex,rebar3_ex_doc]}.
{post_hooks,[{"(freebsd|netbsd|openbsd)",clean,"gmake -C c_src clean"},
             {"(linux|darwin|solaris)",clean,"make -C c_src clean"}]}.
{pre_hooks,[{"(freebsd|netbsd|openbsd)",compile,"gmake -C c_src"},
            {"(linux|darwin|solaris)",compile,"make -C c_src"}]}.
{overrides,[]}.

Line 8 is giving error, why is there that edoc_opts list? the vsn string is a git error so no wonder it fails...

ziopio commented 2 months ago

Checking deps/erlexec/rebar.config.script I can see the source of the problem

%% vim:ts=2:sw=2:et

Vsn = string:strip(os:cmd("git describe --always --tags --abbrev=0 | sed 's/^v//'"), right, $\n),

maps:to_list(maps:merge(maps:from_list(CONFIG), #{edoc_opts => [{def, {vsn, Vsn}}]})).
ziopio commented 2 months ago

@sylane Pinging you in case I am not able to sort this out until you are available.

This dinamic config script kicks-in only under mix, it does not give any problem in rebar3. If I edit the script I can workaround this obstacle, I do not know if there is a way to make rebar3 ignore this script.