erlang / rebar3

Erlang build tool that makes it easy to compile and test Erlang applications and releases.
http://www.rebar3.org
Apache License 2.0
1.7k stars 519 forks source link

rebar3 as develop release failed #2062

Open helloyan opened 5 years ago

helloyan commented 5 years ago

Pre-Check

Environment

E:\Dev\DM\meplat>D:\PortableProgram\Develop\erl10.3\bin\escript.exe D:\PortableProgram\Develop\rebar3\rebar3 report "rebar3 as develop release"
===> Expanded command sequence to be run: [{default,report}]
===> Provider: {default,report}
Rebar3 report
 version 3.9.1+build.4351.refec224b79
 generated at 2019-04-29T13:13:59+00:00
=================
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any)
-----------------
Task: rebar3
Entered as:
  rebar3 as develop release
-----------------
Operating System: win32
ERTS: Erlang/OTP 21 [erts-10.3] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]
Root Directory: d:/PortableProgram/Develop/erl10.3
Library directory: d:/PortableProgram/Develop/erl10.3/lib
-----------------
Loaded Applications:
bbmustache: 1.6.1
certifi: 2.5.1
cf: 0.2.2
common_test: 1.17
compiler: 7.3.2
crypto: 4.4.1
cth_readable: 1.4.3
dialyzer: 3.3.2
edoc: 0.10
erlware_commons: 1.3.1
eunit: 2.3.7
eunit_formatters: 0.5.0
getopt: 1.0.1
hipe: 3.18.3
inets: 7.0.6
kernel: 6.3
providers: 1.7.0
public_key: 1.6.5
relx: 3.31.0
sasl: 3.3
snmp: 5.2.12
ssl_verify_fun: 1.1.4
stdlib: 3.8
syntax_tools: 2.1.7
tools: 3.1

-----------------
Escript path: d:/PortableProgram/Develop/rebar3/rebar3
Providers:
  app_discovery as clean compile compile cover ct deps dialyzer do edoc escriptize eunit get-deps help install install_deps list lock new path pkgs release relup report repos shell state tar tree unlock update upgrade upgrade upgrade version xref
...

Current behaviour

Describe the current behaviour. In case of a failure, crash, or exception, please include the result of running the command with debug information:

DEBUG=1 rebar3 <my failing command>

E:\Dev\DM\meplat>D:\PortableProgram\Develop\erl10.3\bin\escript.exe D:\PortableProgram\Develop\rebar3\rebar3 as develop release
===> Expanded command sequence to be run: [{default,as}]
===> Provider: {default,as}
===> Expanded command sequence to be run: [{default,app_discovery},
                                                  {default,install_deps},
                                                  {default,lock},
                                                  {default,compile},
                                                  {default,release}]
===> Provider: {default,app_discovery}
===> Evaluating config script "e:/Dev/DM/meplat/_build/default/lib/lager/rebar.config.script"
===> Provider: {default,install_deps}
===> Verifying dependencies...
===> Provider: {default,lock}
===> Provider: {default,compile}
===> run_hooks("e:/Dev/DM/meplat", pre_hooks, compile) -> no hooks defined

===> Compiling meplat
===> run_hooks("e:/Dev/DM/meplat", pre_hooks, compile) -> no hooks defined

===> run_hooks("e:/Dev/DM/meplat", pre_hooks, erlc_compile) -> no hooks defined

===> erlopts [debug_info,{parse_transform,lager_transform},{d,dev}]
===> files to compile ["e:/Dev/DM/meplat/src/meplat_sup.erl",
                              "e:/Dev/DM/meplat/src/meplat_app.erl"]
===> Couldn't read debug info from "e:/Dev/DM/meplat/_build/develop/lib/meplat/ebin/meplat_sup" for reason: {not_a_beam_file,

   'e:/Dev/DM/meplat/_build/develop/lib/meplat/ebin/meplat_sup.beam'}
===> Couldn't read debug info from "e:/Dev/DM/meplat/_build/develop/lib/meplat/ebin/meplat_app" for reason: {not_a_beam_file,

   'e:/Dev/DM/meplat/_build/develop/lib/meplat/ebin/meplat_app.beam'}
===> Starting 2 compile worker(s)
===>      Compiled e:/Dev/DM/meplat/src/meplat_app.erl
===>      Compiled e:/Dev/DM/meplat/src/meplat_sup.erl
===> run_hooks("e:/Dev/DM/meplat", post_hooks, erlc_compile) -> no hooks defined

===> run_hooks("e:/Dev/DM/meplat", pre_hooks, app_compile) -> no hooks defined

===> run_hooks("e:/Dev/DM/meplat", post_hooks, app_compile) -> no hooks defined

===> run_hooks("e:/Dev/DM/meplat", post_hooks, compile) -> no hooks defined

===> run_hooks("e:/Dev/DM/meplat", post_hooks, compile) -> no hooks defined

===> Provider: {default,release}
===> run_hooks("e:/Dev/DM/meplat", pre_hooks, release) -> no hooks defined

===> run_hooks("e:/Dev/DM/meplat", pre_hooks, release) -> no hooks defined

===> Starting relx build process ...
===> state(api):
          log: (3:debug),
          config file:
          goals:
          output_dir: e:/Dev/DM/meplat/_rel
          lib_dirs:
          providers:
               tar,
               relup,
               release,
               resolve_release,
               overlay,
               rel_discover,
               app_discover,
          provider config values:
               {overlay_vars,[]},
               {system_libs,true},
               {default_libs,true},

===> Running provider app_discover
===> Resolving OTP Applications from directories:
          e:/Dev/DM/meplat/_build/develop/lib
          d:/PortableProgram/Develop/erl10.3/lib
          e:/Dev/DM/meplat/_build/develop/rel
===> Missing beam file elf_format d:/PortableProgram/Develop/erl10.3/lib/hipe-3.18.3/ebin/elf_format.beam
===> Resolved the following OTP Applications from the system:
          cowboy-2.6.3: e:/Dev/DM/meplat/_build/develop/lib/cowboy
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
                    crypto,
                    cowlib,
                    ranch,
               Library Dependencies:

          cowlib-2.7.3: e:/Dev/DM/meplat/_build/develop/lib/cowlib
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
                    crypto,
               Library Dependencies:

          goldrush-0.1.9: e:/Dev/DM/meplat/_build/develop/lib/goldrush
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
                    syntax_tools,
                    compiler,
               Library Dependencies:

          lager-3.6.9: e:/Dev/DM/meplat/_build/develop/lib/lager
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
                    goldrush,
               Library Dependencies:

          meck-0.8.13: e:/Dev/DM/meplat/_build/develop/lib/meck
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
                    tools,
               Library Dependencies:

          meplat-0.1.0: e:/Dev/DM/meplat/_build/develop/lib/meplat
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          ranch-1.7.1: e:/Dev/DM/meplat/_build/develop/lib/ranch
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
                    ssl,
               Library Dependencies:

          asn1-5.0.8: d:/PortableProgram/Develop/erl10.3/lib/asn1-5.0.8
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          common_test-1.17: d:/PortableProgram/Develop/erl10.3/lib/common_test-1.17
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          compiler-7.3.2: d:/PortableProgram/Develop/erl10.3/lib/compiler-7.3.2
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          crypto-4.4.1: d:/PortableProgram/Develop/erl10.3/lib/crypto-4.4.1
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          debugger-4.2.6: d:/PortableProgram/Develop/erl10.3/lib/debugger-4.2.6
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          dialyzer-3.3.2: d:/PortableProgram/Develop/erl10.3/lib/dialyzer-3.3.2
               Symlink: false
               Active Dependencies:
                    compiler,
                    hipe,
                    kernel,
                    stdlib,
                    wx,
               Library Dependencies:

          diameter-2.2: d:/PortableProgram/Develop/erl10.3/lib/diameter-2.2
               Symlink: false
               Active Dependencies:
                    stdlib,
                    kernel,
               Library Dependencies:

          edoc-0.10: d:/PortableProgram/Develop/erl10.3/lib/edoc-0.10
               Symlink: false
               Active Dependencies:
                    compiler,
                    kernel,
                    stdlib,
                    syntax_tools,
               Library Dependencies:

          eldap-1.2.6: d:/PortableProgram/Develop/erl10.3/lib/eldap-1.2.6
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          erl_docgen-0.9: d:/PortableProgram/Develop/erl10.3/lib/erl_docgen-0.9
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          erl_interface-3.11: d:/PortableProgram/Develop/erl10.3/lib/erl_interface-3.11
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          erts-10.3: d:/PortableProgram/Develop/erl10.3/lib/erts-10.3
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          et-1.6.4: d:/PortableProgram/Develop/erl10.3/lib/et-1.6.4
               Symlink: false
               Active Dependencies:
                    stdlib,
                    kernel,
               Library Dependencies:

          eunit-2.3.7: d:/PortableProgram/Develop/erl10.3/lib/eunit-2.3.7
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          ftp-1.0.2: d:/PortableProgram/Develop/erl10.3/lib/ftp-1.0.2
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          inets-7.0.6: d:/PortableProgram/Develop/erl10.3/lib/inets-7.0.6
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          jinterface-1.9.1: d:/PortableProgram/Develop/erl10.3/lib/jinterface-1.9.1
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          kernel-6.3: d:/PortableProgram/Develop/erl10.3/lib/kernel-6.3
               Symlink: false
               Active Dependencies:
               Library Dependencies:

          megaco-3.18.4: d:/PortableProgram/Develop/erl10.3/lib/megaco-3.18.4
               Symlink: false
               Active Dependencies:
                    stdlib,
                    kernel,
               Library Dependencies:

          mnesia-4.15.6: d:/PortableProgram/Develop/erl10.3/lib/mnesia-4.15.6
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          observer-2.9: d:/PortableProgram/Develop/erl10.3/lib/observer-2.9
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          odbc-2.12.3: d:/PortableProgram/Develop/erl10.3/lib/odbc-2.12.3
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          os_mon-2.4.7: d:/PortableProgram/Develop/erl10.3/lib/os_mon-2.4.7
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
                    sasl,
               Library Dependencies:

          otp_mibs-1.2.1: d:/PortableProgram/Develop/erl10.3/lib/otp_mibs-1.2.1
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
                    snmp,
               Library Dependencies:

          parsetools-2.1.8: d:/PortableProgram/Develop/erl10.3/lib/parsetools-2.1.8
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          public_key-1.6.5: d:/PortableProgram/Develop/erl10.3/lib/public_key-1.6.5
               Symlink: false
               Active Dependencies:
                    asn1,
                    crypto,
                    kernel,
                    stdlib,
               Library Dependencies:

          reltool-0.7.8: d:/PortableProgram/Develop/erl10.3/lib/reltool-0.7.8
               Symlink: false
               Active Dependencies:
                    stdlib,
                    kernel,
               Library Dependencies:

          runtime_tools-1.13.2: d:/PortableProgram/Develop/erl10.3/lib/runtime_tools-1.13.2
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          sasl-3.3: d:/PortableProgram/Develop/erl10.3/lib/sasl-3.3
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          snmp-5.2.12: d:/PortableProgram/Develop/erl10.3/lib/snmp-5.2.12
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          ssh-4.7.4: d:/PortableProgram/Develop/erl10.3/lib/ssh-4.7.4
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
                    crypto,
                    public_key,
               Library Dependencies:

          ssl-9.2: d:/PortableProgram/Develop/erl10.3/lib/ssl-9.2
               Symlink: false
               Active Dependencies:
                    crypto,
                    public_key,
                    kernel,
                    stdlib,
               Library Dependencies:

          stdlib-3.8: d:/PortableProgram/Develop/erl10.3/lib/stdlib-3.8
               Symlink: false
               Active Dependencies:
                    kernel,
               Library Dependencies:

          syntax_tools-2.1.7: d:/PortableProgram/Develop/erl10.3/lib/syntax_tools-2.1.7
               Symlink: false
               Active Dependencies:
                    stdlib,
               Library Dependencies:

          tftp-1.0.1: d:/PortableProgram/Develop/erl10.3/lib/tftp-1.0.1
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          tools-3.1: d:/PortableProgram/Develop/erl10.3/lib/tools-3.1
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          wx-1.8.7: d:/PortableProgram/Develop/erl10.3/lib/wx-1.8.7
               Symlink: false
               Active Dependencies:
                    stdlib,
                    kernel,
               Library Dependencies:

          xmerl-1.3.19: d:/PortableProgram/Develop/erl10.3/lib/xmerl-1.3.19
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          kernel-6.3: e:/Dev/DM/meplat/_build/develop/rel/meplat/lib/kernel-6.3
               Symlink: false
               Active Dependencies:
               Library Dependencies:

          meplat-0.1.0: e:/Dev/DM/meplat/_build/develop/rel/meplat/lib/meplat-0.1.0
               Symlink: false
               Active Dependencies:
                    kernel,
                    stdlib,
               Library Dependencies:

          stdlib-3.8: e:/Dev/DM/meplat/_build/develop/rel/meplat/lib/stdlib-3.8
               Symlink: false
               Active Dependencies:
                    kernel,
               Library Dependencies:

===> Provider successfully run: app_discover
===> Running provider resolve_release
===> Solving Release meplat-0.0.1
===> Resolved meplat-0.0.1
===> release: meplat-0.0.1
           erts-10.3, realized = true
     goals:
          meplat,
     applications:
          {kernel,"6.3"},
          {stdlib,"3.8"},
          {meplat,"0.1.0"},

===> Provider successfully run: resolve_release
===> Running provider release
=ERROR REPORT==== 29-Apr-2019::21:14:43.088000 ===
Error in process <0.4667.0> with exit value:
{{badmatch,{ok,[]}},
 [{rlx_prv_assembler,rewrite_app_file,3,
                     [{file,"d:/PortableProgram/Develop/rebar3/_build/default/lib/relx/src/rlx_prv_assembler.erl"},
                      {line,238}]},
  {lists,map,2,[{file,"lists.erl"},{line,1239}]},
  {ec_plists,'-local_runmany/3-fun-0-',3,
             [{file,"d:/PortableProgram/Develop/rebar3/_build/default/lib/erlware_commons/src/ec_plists.erl"},
              {line,753}]}]}

===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: {{badmatch,{ok,[]}},
                             [{rlx_prv_assembler,rewrite_app_file,3,
                                  [{file,
                                       "d:/PortableProgram/Develop/rebar3/_build/default/lib/relx/src/rlx_prv_assembler.erl"},
                                   {line,238}]},
                              {lists,map,2,[{file,"lists.erl"},{line,1239}]},
                              {ec_plists,'-local_runmany/3-fun-0-',3,
                                  [{file,
                                       "d:/PortableProgram/Develop/rebar3/_build/default/lib/erlware_commons/src/ec_plists.erl"},
                                   {line,753}]}]}
===> Stack trace to the error location:
[{ec_plists,handle_error,3,
            [{file,"d:/PortableProgram/Develop/rebar3/_build/default/lib/erlware_commons/src/ec_plists.erl"},
             {line,917}]},
 {ec_plists,local_runmany,3,
            [{file,"d:/PortableProgram/Develop/rebar3/_build/default/lib/erlware_commons/src/ec_plists.erl"},
             {line,764}]},
 {rlx_prv_assembler,copy_app_directories_to_output,3,
                    [{file,"d:/PortableProgram/Develop/rebar3/_build/default/lib/relx/src/rlx_prv_assembler.erl"},
                     {line,176}]},
 {rlx_prv_assembler,do,1,
                    [{file,"d:/PortableProgram/Develop/rebar3/_build/default/lib/relx/src/rlx_prv_assembler.erl"},
                     {line,59}]},
 {relx,run_provider,2,
       [{file,"d:/PortableProgram/Develop/rebar3/_build/default/lib/relx/src/relx.erl"},
        {line,308}]},
 {lists,foldl,3,[{file,"lists.erl"},{line,1263}]},
 {relx,run_providers_for_actions,2,
       [{file,"d:/PortableProgram/Develop/rebar3/_build/default/lib/relx/src/relx.erl"},
        {line,291}]},
 {relx,main,2,
       [{file,"d:/PortableProgram/Develop/rebar3/_build/default/lib/relx/src/relx.erl"},
        {line,65}]}]
===> When submitting a bug report, please include the output of `rebar3 report "your command"`

Expected behaviour

successful released

but run prod release successfully

ferd commented 5 years ago

This likely points to a known problem with symlinking on windows when relx is configured to use {dev_mode, true}. If you just make it use {dev_mode, false} it should build fine. I believe there are some patches in the work for that, but I don't think they were included in 3.10.0.

ferd commented 5 years ago

let us know if any of the workarounds worked.