grisp / rebar3_grisp

Rebar plug-in for GRiSP
https://www.grisp.org
Apache License 2.0
21 stars 10 forks source link

Error in build phase #55

Closed lin7sh closed 4 years ago

lin7sh commented 5 years ago

Hi, I'm following the guide and found the following error

$ DEBUG=1 rebar3 grisp build
===> Load global config file /home/mko_io/.config/rebar3/rebar.config
===> 22.0.7 satisfies the requirement for minimum OTP version 18
===> Expanded command sequence to be run: []
===> Provider: {default,do}
===> Expanded command sequence to be run: [{default,app_discovery},
                                                  {default,install_deps},
                                                  {grisp,build}]
===> Provider: {default,app_discovery}
===> Evaluating config script "/usr/home/mko_io/beam/grisp_simple/_build/default/lib/grisp/rebar.config.script"
===> Provider: {default,install_deps}
===> Verifying dependencies...
===> Provider: {grisp,build}
===> Checking out Erlang/OTP 22.0
* Using existing checkout
===> sh info:
    cwd: "/usr/home/mko_io/beam/grisp_simple"
    cmd: git checkout grisp/OTP-22.0

===>    opts: [{cd,"/usr/home/mko_io/beam/grisp_simple/_grisp/otp/22.0/build"},
                       abort_on_error]

===> Port Cmd: git checkout grisp/OTP-22.0
Port Opts: [{cd,"/usr/home/mko_io/beam/grisp_simple/_grisp/otp/22.0/build"},
            exit_status,
            {line,16384},
            use_stdio,stderr_to_stdout,hide,eof]

* Copying C code...
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: {badmatch,{#{"erts/emulator/sys/unix/erl_main.c" =>
                                             "/usr/home/mko_io/beam/grisp_simple/_build/default/lib/grisp/grisp/grisp_base/sys/erl_main.c"},
                                       #{"erts/emulator/drivers/unix/grisp_gpio_drv.c" =>
                                             "/usr/home/mko_io/beam/grisp_simple/_build/default/lib/grisp/grisp/grisp_base/drivers/grisp_gpio_drv.c",
                                         "erts/emulator/drivers/unix/grisp_i2c_drv.c" =>
                                             "/usr/home/mko_io/beam/grisp_simple/_build/default/lib/grisp/grisp/grisp_base/drivers/grisp_i2c_drv.c",
                                         "erts/emulator/drivers/unix/grisp_spi_drv.c" =>
                                             "/usr/home/mko_io/beam/grisp_simple/_build/default/lib/grisp/grisp/grisp_base/drivers/grisp_spi_drv.c",
                                         "erts/emulator/drivers/unix/grisp_termios_drv.c" =>
                                             "/usr/home/mko_io/beam/grisp_simple/_build/default/lib/grisp/grisp/grisp_base/drivers/grisp_termios_drv.c"}}}
===> Stack trace to the error location:
[{rebar3_grisp_build,copy_files,3,
                     [{file,"/home/mko_io/.cache/rebar3/plugins/rebar3_grisp/src/rebar3_grisp_build.erl"},
                      {line,110}]},
 {rebar3_grisp_build,do,1,
                     [{file,"/home/mko_io/.cache/rebar3/plugins/rebar3_grisp/src/rebar3_grisp_build.erl"},
                      {line,65}]},
 {rebar_core,do,2,
             [{file,"/usr/home/mko_io/beam/rebar3/src/rebar_core.erl"},
              {line,154}]},
 {rebar_prv_do,do_task,5,
               [{file,"/usr/home/mko_io/beam/rebar3/src/rebar_prv_do.erl"},
                {line,87}]},
 {rebar_core,do,2,
             [{file,"/usr/home/mko_io/beam/rebar3/src/rebar_core.erl"},
              {line,154}]},
 {rebar3,run_aux,2,
         [{file,"/usr/home/mko_io/beam/rebar3/src/rebar3.erl"},{line,182}]},
 {rebar3,main,1,
         [{file,"/usr/home/mko_io/beam/rebar3/src/rebar3.erl"},{line,66}]},
 {escript,run,2,[{file,"escript.erl"},{line,758}]}]

and there my rebar report

$ rebar3 report
Rebar3 report
 version 3.12.0+build.4448.refe2ac3217
 generated at 2019-09-15T17:55:19+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: 
Entered as:

-----------------
Operating System: amd64-portbld-freebsd12.0
ERTS: Erlang/OTP 22 [erts-10.4.4] [source] [64-bit] [smp:24:24] [ds:24:24:10] [async-threads:1] [dtrace]
Root Directory: /home/mko_io/beam/otp
Library directory: /home/mko_io/beam/otp/lib
-----------------
Loaded Applications:
bbmustache: 1.6.1
certifi: 2.5.1
cf: 0.2.2
common_test: 1.17.3
compiler: 7.4.4
crypto: 4.5.1
cth_readable: 1.4.5
dialyzer: 4.0.3
edoc: 0.11
erlware_commons: 1.3.1
eunit: 2.3.7
eunit_formatters: 0.5.0
getopt: 1.0.1
hipe: 3.19.1
inets: 7.0.9
kernel: 6.4.1
providers: 1.8.1
public_key: 1.6.7
relx: 3.33.0
sasl: 3.4
snmp: 5.3
ssl_verify_fun: 1.1.5
stdlib: 3.9.2
syntax_tools: 2.2
tools: 3.2

-----------------
Escript path: /home/mko_io/beam/bin/rebar3
Providers:
  app_discovery as build clean compile compile cover ct cut deploy deps dialyzer do docs edoc escriptize eunit get-deps help install install_deps key list lock new owner path pkgs publish release relup repo report repos retire revert search shell state tar tree unlock update upgrade upgrade upgrade user version version xref 
holzingk commented 5 years ago

Are you using the versions from hex.pm?

lin7sh commented 5 years ago

@nextl00p I don't quite understand your question. But in my reber.config the rebar3_grisp plugin is sylane/fix-otp-22-patches branch which I think compatible with the OTP version I'm using which is 22.

holzingk commented 5 years ago

I just merged @sylane 's fix.

Please try to use current master of both rebar3_grisp and grisp_tools. I think you forgot to include the latter as well.

I usually place it as symlinks pointing to local repo workspaces in the _checkouts directory.

lin7sh commented 5 years ago

@nextl00p ok I'll try it. Indeed I don't use grisp_tools, I'll have a look as well, thanks

eproxus commented 5 years ago

@mko-io A bit late to the party, but I added some development instructions to the README to clarify things: https://github.com/grisp/rebar3_grisp#development

holzingk commented 4 years ago

@mko-io is this issue resolved?

lin7sh commented 4 years ago

@nextl00p Sorry for not updating this issue, I'll give it a try tomorrow and report back

lin7sh commented 4 years ago

I'm using the master branch of grisp/otp, good thing is that there's no error is time, but the erl-xcomp-22.conf not found. Here's my rebar.conf and the full log

{deps, [grisp]}.

{erl_opts, [debug_info]}.

{grisp, [
    {otp, [
        {version, "22.0"}
    ]},
    {build, [
        {toolchain, [
            {directory, "/usr/home/mko_io/mcu/grisp-software/rtems-install/rtems/5"}
        ]}
    ]},
    {deploy, [
        {destination, "foo.bin"}
    ]}
]}.

{shell, [{apps, []}]}.

{relx, [
    {release, {foo, "0.1.0"}, [foo]}
]}.
mko_io@j4:$ DEBUG=1 rebar3 grisp build
===> Load global config file /home/mko_io/.config/rebar3/rebar.config
===> 22.0.7 satisfies the requirement for minimum OTP version 18
===> Compiling grisp_tools
===> run_hooks("/usr/home/mko_io/mcu/foo/_checkouts/grisp_tools", pre_hooks, compile) -> no hooks defined

===> run_hooks("/usr/home/mko_io/mcu/foo/_checkouts/grisp_tools", pre_hooks, erlc_compile) -> no hooks defined

===> erlopts [debug_info]
===> files to compile ["/usr/home/mko_io/mcu/foo/_checkouts/grisp_tools/src/grisp_tools_template.erl",
                              "/usr/home/mko_io/mcu/foo/_checkouts/grisp_tools/src/grisp_tools_handler.erl",
                              "/usr/home/mko_io/mcu/foo/_checkouts/grisp_tools/src/grisp_tools_util.erl",
                              "/usr/home/mko_io/mcu/foo/_checkouts/grisp_tools/src/grisp_tools.erl",
                              "/usr/home/mko_io/mcu/foo/_checkouts/grisp_tools/src/grisp_tools_deploy.erl"]
===> run_hooks("/usr/home/mko_io/mcu/foo/_checkouts/grisp_tools", post_hooks, erlc_compile) -> no hooks defined

===> run_hooks("/usr/home/mko_io/mcu/foo/_checkouts/grisp_tools", pre_hooks, app_compile) -> no hooks defined

===> run_hooks("/usr/home/mko_io/mcu/foo/_checkouts/grisp_tools", post_hooks, app_compile) -> no hooks defined

===> run_hooks("/usr/home/mko_io/mcu/foo/_checkouts/grisp_tools", post_hooks, compile) -> no hooks defined

===> Compiling rebar3_grisp
===> run_hooks("/usr/home/mko_io/mcu/foo/_checkouts/rebar3_grisp", pre_hooks, compile) -> no hooks defined

===> run_hooks("/usr/home/mko_io/mcu/foo/_checkouts/rebar3_grisp", pre_hooks, erlc_compile) -> no hooks defined

===> erlopts [debug_info]
===> files to compile ["/usr/home/mko_io/mcu/foo/_checkouts/rebar3_grisp/src/rebar3_grisp_build.erl",
                              "/usr/home/mko_io/mcu/foo/_checkouts/rebar3_grisp/src/rebar3_grisp.erl",
                              "/usr/home/mko_io/mcu/foo/_checkouts/rebar3_grisp/src/rebar3_grisp_version.erl",
                              "/usr/home/mko_io/mcu/foo/_checkouts/rebar3_grisp/src/rebar3_grisp_deploy.erl",
                              "/usr/home/mko_io/mcu/foo/_checkouts/rebar3_grisp/src/rebar3_grisp_util.erl"]
===> run_hooks("/usr/home/mko_io/mcu/foo/_checkouts/rebar3_grisp", post_hooks, erlc_compile) -> no hooks defined

===> run_hooks("/usr/home/mko_io/mcu/foo/_checkouts/rebar3_grisp", pre_hooks, app_compile) -> no hooks defined

===> run_hooks("/usr/home/mko_io/mcu/foo/_checkouts/rebar3_grisp", post_hooks, app_compile) -> no hooks defined

===> run_hooks("/usr/home/mko_io/mcu/foo/_checkouts/rebar3_grisp", post_hooks, compile) -> no hooks defined

===> Expanded command sequence to be run: []
===> Provider: {default,do}
===> Expanded command sequence to be run: [{default,app_discovery},
                                                  {default,install_deps},
                                                  {grisp,build}]
===> Provider: {default,app_discovery}
===> Evaluating config script "/usr/home/mko_io/mcu/foo/_build/default/lib/grisp/rebar.config.script"
===> Provider: {default,install_deps}
===> Verifying dependencies...
===> Provider: {grisp,build}
===> Checking out Erlang/OTP 22.0
* Using existing checkout
===> sh info:
    cwd: "/usr/home/mko_io/mcu/foo"
    cmd: git checkout grisp/OTP-22.0

===>    opts: [{cd,"/usr/home/mko_io/mcu/foo/_grisp/otp/22.0/build"},
                       abort_on_error]

===> Port Cmd: git checkout grisp/OTP-22.0
Port Opts: [{cd,"/usr/home/mko_io/mcu/foo/_grisp/otp/22.0/build"},
            exit_status,
            {line,16384},
            use_stdio,stderr_to_stdout,hide,eof]

* Copying C code...
===> Apps [{mapz,"/usr/home/mko_io/mcu/foo/_build/default/lib/mapz"},
                  {grisp,"/usr/home/mko_io/mcu/foo/_build/default/lib/grisp"},
                  {foo,"/usr/home/mko_io/mcu/foo"}], Board "grisp_base"

===> Detected the following C files:
SystemFiles #{"erts/emulator/sys/unix/erl_main.c" =>
                  "/usr/home/mko_io/mcu/foo/_build/default/lib/grisp/grisp/grisp_base/sys/erl_main.c"}
, DriverFiles #{"erts/emulator/drivers/unix/grisp_gpio_drv.c" =>
                    "/usr/home/mko_io/mcu/foo/_build/default/lib/grisp/grisp/grisp_base/drivers/grisp_gpio_drv.c",
                "erts/emulator/drivers/unix/grisp_i2c_drv.c" =>
                    "/usr/home/mko_io/mcu/foo/_build/default/lib/grisp/grisp/grisp_base/drivers/grisp_i2c_drv.c",
                "erts/emulator/drivers/unix/grisp_spi_drv.c" =>
                    "/usr/home/mko_io/mcu/foo/_build/default/lib/grisp/grisp/grisp_base/drivers/grisp_spi_drv.c",
                "erts/emulator/drivers/unix/grisp_termios_drv.c" =>
                    "/usr/home/mko_io/mcu/foo/_build/default/lib/grisp/grisp/grisp_base/drivers/grisp_termios_drv.c"}
, NIFFiles #{}

===> GRiSP - Copy "/usr/home/mko_io/mcu/foo/_build/default/lib/grisp/grisp/grisp_base/drivers/grisp_gpio_drv.c" -> "/usr/home/mko_io/mcu/foo/_grisp/otp/22.0/build/erts/emulator/drivers/unix/grisp_gpio_drv.c"
===> GRiSP - Copy "/usr/home/mko_io/mcu/foo/_build/default/lib/grisp/grisp/grisp_base/drivers/grisp_i2c_drv.c" -> "/usr/home/mko_io/mcu/foo/_grisp/otp/22.0/build/erts/emulator/drivers/unix/grisp_i2c_drv.c"
===> GRiSP - Copy "/usr/home/mko_io/mcu/foo/_build/default/lib/grisp/grisp/grisp_base/drivers/grisp_spi_drv.c" -> "/usr/home/mko_io/mcu/foo/_grisp/otp/22.0/build/erts/emulator/drivers/unix/grisp_spi_drv.c"
===> GRiSP - Copy "/usr/home/mko_io/mcu/foo/_build/default/lib/grisp/grisp/grisp_base/drivers/grisp_termios_drv.c" -> "/usr/home/mko_io/mcu/foo/_grisp/otp/22.0/build/erts/emulator/drivers/unix/grisp_termios_drv.c"
===> GRiSP - Copy "/usr/home/mko_io/mcu/foo/_build/default/lib/grisp/grisp/grisp_base/sys/erl_main.c" -> "/usr/home/mko_io/mcu/foo/_grisp/otp/22.0/build/erts/emulator/sys/unix/erl_main.c"
* Patching OTP to include sys, driver and NIF files
===> Patching OTP Version "22.0"
===> Using Template "/usr/home/mko_io/mcu/foo/_checkouts/rebar3_grisp/priv/patches/otp-22.0.patch.mustache"
===> sh info:
    cwd: "/usr/home/mko_io/mcu/foo"
    cmd: git apply otp.patch --ignore-whitespace --reverse --check

===>    opts: [{cd,"/usr/home/mko_io/mcu/foo/_grisp/otp/22.0/build"},
                       return_on_error,abort_on_error]

===> Port Cmd: git apply otp.patch --ignore-whitespace --reverse --check
Port Opts: [{cd,"/usr/home/mko_io/mcu/foo/_grisp/otp/22.0/build"},
            exit_status,
            {line,16384},
            use_stdio,stderr_to_stdout,hide,eof]

  (skipped, already patched)
===> sh info:
    cwd: "/usr/home/mko_io/mcu/foo"
    cmd: rm otp.patch

===>    opts: [{cd,"/usr/home/mko_io/mcu/foo/_grisp/otp/22.0/build"},
                       abort_on_error]

===> Port Cmd: rm otp.patch
Port Opts: [{cd,"/usr/home/mko_io/mcu/foo/_grisp/otp/22.0/build"},
            exit_status,
            {line,16384},
            use_stdio,stderr_to_stdout,hide,eof]

===> Building
===> File grisp/grisp_base/xcomp/erl-xcomp-22.0.conf not found
lin7sh commented 4 years ago

rebar3 clean and rebar3 upgrade solve the problem. thanks