Supersonido / rebar_mix

rebar3 plugin for building Elixir dependencies with mix
Apache License 2.0
53 stars 20 forks source link

No valid version ([]) of .app file found #21

Open auror opened 3 years ago

auror commented 3 years ago

Hello guys,

OS: Mac OSX

Erlang/OTP 23 [erts-11.1.8] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [hipe] [dtrace]

IEx 1.11.3 (compiled with Erlang/OTP 23)

We're using rebar_mix to use Elixir dependencies inside our rebar3 project. There's a problem while generating a release

===> Compiling oauth
Consolidating 13 implementations of protocol Elixir.Jason.Encoder
===> [relup_helper] running gen_appups
===> Assembling release myapp...
===> Error generating release:
jason: No valid version ([]) of .app file found. Found file "/Users/YYYYYY/Programs/myapp/_build/myapp/rel/myapp/lib/jason-/ebin/jason.app" with version "1.2.2"

make: *** [myapp] Error 1

jason is the transitive dependency and added to the rebar.config deps

    {jason, {git, "git@github.com:michalmuskala/jason.git", {tag, "v1.2.2"}}}

Although, the next attempt seems to be solving it..

$ make
===> Compiling oauth
Consolidating 13 implementations of protocol Elixir.Jason.Encoder
===> [relup_helper] running gen_appups
===> Assembling release myapp...
===> Release successfully assembled: _build/myapp/rel/myapp

Not sure what's happening here.. Please let us know if you need more information !

Regards

auror commented 3 years ago

Hello @Supersonido / @tsloughter , now i've been getting another crash while releasing...

Error: function_clause
[{filename,join1,
           [<<"1.2.2">>,[],
            "-nosaj/bil/ppaym/ler/ppaym/dliub_/ppaym/smargorP/YYYYYY/sresU/",
            unix],
           [{file,"filename.erl"},{line,472}]},
 {filename,join,1,[{file,"filename.erl"},{line,433}]},
 {rlx_assemble,copy_app,4,
               [{file,"/src/_build/default/lib/relx/src/rlx_assemble.erl"},
                {line,94}]},
 {rlx_assemble,'-copy_app_directories_to_output/3-lc$^0/1-1-',4,
               [{file,"/src/_build/default/lib/relx/src/rlx_assemble.erl"},
                {line,79}]},
 {rlx_assemble,copy_app_directories_to_output,3,
               [{file,"/src/_build/default/lib/relx/src/rlx_assemble.erl"},
                {line,79}]},
 {rlx_assemble,do,2,
               [{file,"/src/_build/default/lib/relx/src/rlx_assemble.erl"},
                {line,18}]},
 {relx,build_release_,3,
       [{file,"/src/_build/default/lib/relx/src/relx.erl"},{line,171}]},
 {relx,build_release,3,
       [{file,"/src/_build/default/lib/relx/src/relx.erl"},{line,77}]},
 {rebar_relx,do,2,[{file,"rebar_relx.erl"},{line,67}]},
 {rebar_core,do,2,[{file,"rebar_core.erl"},{line,155}]},
 {rebar_prv_do,do_task,5,[{file,"rebar_prv_do.erl"},{line,75}]},
 {rebar_core,do,2,[{file,"rebar_core.erl"},{line,155}]},
 {rebar3,run_aux,2,[{file,"rebar3.erl"},{line,181}]},
 {rebar3,main,1,[{file,"rebar3.erl"},{line,66}]},
 {escript,run,2,[{file,"escript.erl"},{line,758}]},
 {escript,start,1,[{file,"escript.erl"},{line,277}]},
 {init,start_em,1,[]},
 {init,do_boot,3,[]}]

Notice the name, which has been reversed ?

"-nosaj/bil/ppaym/ler/ppaym/dliub_/ppaym/smargorP/YYYYYY/sresU/"

What could be happening here ?

Regards

ferd commented 3 years ago

it's trying to add a version to the end of the filepath and failing because it's a binary instead of a list. I can't recall if that was patched in rebar3 (try a newer version) or judged to be a problem with the dep, or just not addressed yet

auror commented 3 years ago

We're checking this on rebar3 3.14.3.

tsloughter commented 3 years ago

Can you check if the jason.app file has a binary for vsn.

auror commented 3 years ago

@tsloughter Hmmm it's a string.

➜ cat _build/myapp/lib/jason/ebin/jason.app
{application,jason,
             [{applications,[kernel,stdlib,elixir]},
              {description,"A blazing fast JSON parser and generator in pure Elixir.\n"},
              {modules,['Elixir.Jason','Elixir.Jason.Codegen',
                        'Elixir.Jason.DecodeError','Elixir.Jason.Decoder',
                        'Elixir.Jason.Decoder.Unescape','Elixir.Jason.Encode',
                        'Elixir.Jason.EncodeError','Elixir.Jason.Encoder',
                        'Elixir.Jason.Encoder.Any',
                        'Elixir.Jason.Encoder.Atom',
                        'Elixir.Jason.Encoder.BitString',
                        'Elixir.Jason.Encoder.Date',
                        'Elixir.Jason.Encoder.DateTime',
                        'Elixir.Jason.Encoder.Decimal',
                        'Elixir.Jason.Encoder.Float',
                        'Elixir.Jason.Encoder.Integer',
                        'Elixir.Jason.Encoder.Jason.Fragment',
                        'Elixir.Jason.Encoder.List',
                        'Elixir.Jason.Encoder.Map',
                        'Elixir.Jason.Encoder.NaiveDateTime',
                        'Elixir.Jason.Encoder.Time','Elixir.Jason.Formatter',
                        'Elixir.Jason.Fragment','Elixir.Jason.Helpers']},
              {registered,[]},
              {vsn,"1.2.2"}]}.

The vsns for apps are usually UTF-8 strings i believe !

zmstone commented 3 years ago

the vsn suffix is appended correctly if we revert this commit: https://github.com/erlang/rebar3/commit/80671df57a06915a23493b9fc721d1ae8f493964

zmstone commented 3 years ago

and the workaround is to run rebar3 as profile do compile,release instead of rebar3 as profile release

zmstone commented 3 years ago

This does not seem to be an issue of rebar_mix. Rather something to improve in rebar3 (maybe?) so I created https://github.com/erlang/rebar3/pull/2518