nerves-web-kiosk / kiosk_system_rpi3

Nerves QtWebEngine Kiosk system for Raspberry Pi 3
Apache License 2.0
67 stars 25 forks source link

mix compile fails under macOS #16

Closed NickNeck closed 6 years ago

NickNeck commented 6 years ago

Hello, I try to make a customized nerves system with the kiosk_system_rpi3 as a starting point, under macOS. For now, I have copied the repo and removed the artifact_sites entry in mix.exs. After that, I have tried mix deps.get && mix compile. After nearly three hours of happy compiling, I get an error.

build.log:

umask 0022 && make -C /nerves/env/platform/buildroot-2017.11.2 O=/nerves/build/.
/usr/bin/make -j1 O=/nerves/build HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" silentoldconfig
  GEN     /nerves/build/Makefile
>>> nerves-config 0.6 Building
# Create the relx configuration file
m4 /nerves/env/platform/package/nerves-config/relx.config.m4 > /nerves/build/build/nerves-config-0.6/relx.config
# Create the vm.args file for starting the Erlang runtime
m4 /nerves/env/platform/package/nerves-config/vm.args.m4 > /nerves/build/build/nerves-config-0.6/vm.args
# Run relx to create a sample release. Real projects will have
# their own relx.config scripts and be in a separate repo, but
# this release is a good one for playing around with Nerves.
NERVES_SDK_SYSROOT=/nerves/build/host PATH="/nerves/build/host/bin:/nerves/build/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" PKG_CONFIG="/nerves/build/host/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_LIBDIR="/nerves/build/host/lib/pkgconfig:/nerves/build/host/share/pkgconfig" /nerves/build/host/usr/bin/relx --system_libs /nerves/build/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/erlang/lib -o /nerves/build/build/nerves-config-0.6/_rel  --vm_args /nerves/build/build/nerves-config-0.6/vm.args -c /nerves/build/build/nerves-config-0.6/relx.config
===> Starting relx build process ...
===> Resolving OTP Applications from directories:
          /nerves/build/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/erlang/lib

=ERROR REPORT==== 13-Feb-2018::15:52:05 ===
Error in process <0.887.0> with exit value:
{{case_clause,{error,tokens}},
 [{file,consult_stream,3,[{file,"file.erl"},{line,1380}]},
  {file,consult,1,[{file,"file.erl"},{line,989}]},
  {rlx_app_discovery,gather_application_info,2,
                     [{file,"src/rlx_app_discovery.erl"},{line,216}]},
  {rlx_dscv_util,discover_dir,3,[{file,"src/rlx_dscv_util.erl"},{line,95}]},
  {lists,map,2,[{file,"lists.erl"},{line,1239}]},
  {ec_plists,'-local_runmany/3-fun-0-',3,
             [{file,"src/ec_plists.erl"},{line,753}]}]}
escript: exception exit: {{case_clause,{error,tokens}},
                 [{file,consult_stream,3,[{file,"file.erl"},{line,1380}]},
                  {file,consult,1,[{file,"file.erl"},{line,989}]},
                  {rlx_app_discovery,gather_application_info,2,
                                     [{file,"src/rlx_app_discovery.erl"},
                                      {line,216}]},
                  {rlx_dscv_util,discover_dir,3,
                                 [{file,"src/rlx_dscv_util.erl"},{line,95}]},
                  {lists,map,2,[{file,"lists.erl"},{line,1239}]},
                  {ec_plists,'-local_runmany/3-fun-0-',3,
                             [{file,"src/ec_plists.erl"},{line,753}]}]}
  in function  ec_plists:handle_error/3 (src/ec_plists.erl, line 900)
  in call from ec_plists:local_runmany/3 (src/ec_plists.erl, line 764)
  in call from rlx_dscv_util:do/2 (src/rlx_dscv_util.erl, line 52)
  in call from rlx_app_discovery:resolve_app_metadata/2 (src/rlx_app_discovery.erl, line 103)
  in call from rlx_prv_app_discover:do/1 (src/rlx_prv_app_discover.erl, line 59)
  in call from providers:run_all/2 (src/providers.erl, line 82)
  in call from relx:run_provider/2 (src/relx.erl, line 286)
  in call from lists:foldl/3 (lists.erl, line 1263)
package/pkg-generic.mk:234: recipe for target '/nerves/build/build/nerves-config-0.6/.stamp_built' failed
make[1]: *** [/nerves/build/build/nerves-config-0.6/.stamp_built] Error 127
Makefile:16: recipe for target '_all' failed
make: *** [_all] Error 2
mobileoverlord commented 6 years ago

This looks like its related to the version of erlang that is being compiled, but, I have seen this system fail to build for strange reasons when docker does not have enough resources allocated to it. On linux, this requires more than 8gb of ram for compiling. For example, to build this on circle ci, we had to choose the largest resource class which has 16 gb of ram because the resource class with only 8gb would also fail.

NickNeck commented 6 years ago

Thank you for your response. I have now a successful build. I gave all my resources to Docker (8 CPUs and 16 GB Memory).

There is another little bug when I run mix nerves.artifact.

Creating Artifact Archive
|Elixir.Docker| Creating artifact archive

..........|Elixir.Docker| Copying artifact archive to host

.** (File.CopyError) could not copy from "/Users/nick/.nerves/dl/my_system_rpi3-portable-0.13.0.tar.gz" to "/Users/nick/Projects/xyz/my_system_rpi3/my_system_rpi3-portable-0.13.0-E5EC7CCC89A211938F48FEAA86AB57E1FB88166EDC3579360C59E99FA69102EC.tar.gz/my_system_rpi3-portable-0.13.0-E5EC7CCC89A211938F48FEAA86AB57E1FB88166EDC3579360C59E99FA69102EC.tar.gz": no such file or directory
    (elixir) lib/file.ex:701: File.cp!/3
    lib/nerves/artifact.ex:48: Nerves.Artifact.archive/3
    lib/mix/tasks/nerves.artifact.ex:59: Mix.Tasks.Nerves.Artifact.run/1
    (mix) lib/mix/task.ex:314: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:80: Mix.CLI.run_task/2

But I have my artifact. The file /Users/nick/.nerves/dl/my_system_rpi3-portable-0.13.0.tar.gz exists.

mobileoverlord commented 6 years ago

The bug described above was fixed in nerves >= v0.10.0. If you run mix deps.update nerves you should be able to get past that part 👍 Please open a new issue if you are still having issues. Thanks!