nerves-project / nerves_system_mangopi_mq_pro

Nerves system for the MangoPi MQ Pro
Apache License 2.0
20 stars 6 forks source link

`mix firmeware` fails with `nerves_runtime is not a known OTP application` #26

Closed aseigo closed 1 year ago

aseigo commented 1 year ago

Installed following the instructions in the README.md, and building a RPI image with mix firmware works, however if I try to build a mangopi pro image, this is the result:

aseigo@serenity:~/src/mango_nerves> mix firmware
==> nerves
==> mango_nerves

Nerves environment
  MIX_TARGET:   mangopi_mq_pro
  MIX_ENV:      dev

Generated mango_nerves app
|nerves| Building OTP Release...

** (Shoehorn.ReleaseError) nerves_runtime is not a known OTP application
    (shoehorn 0.9.1) lib/shoehorn/release.ex:182: Shoehorn.Release.check_app/2
    (elixir 1.14.2) lib/enum.ex:975: Enum."-each/2-lists^foreach/1-0-"/2
    (shoehorn 0.9.1) lib/shoehorn/release.ex:32: Shoehorn.Release.init/1
    (mix 1.14.2) lib/mix/tasks/release.ex:1068: Mix.Tasks.Release.run_steps/1
    (mix 1.14.2) lib/mix/task.ex:421: anonymous fn/3 in Mix.Task.run_task/4
    (nerves 1.9.1) lib/mix/tasks/firmware.ex:49: Mix.Tasks.Firmware.run/1
    (mix 1.14.2) lib/mix/task.ex:421: anonymous fn/3 in Mix.Task.run_task/4
    (mix 1.14.2) lib/mix/cli.ex:84: Mix.CLI.run_task/2

Erlang and Elixir versions:

Erlang/OTP 25 [erts-13.1.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Interactive Elixir (1.14.2) - press Ctrl+C to exit (type h() ENTER for help)

Unfortunately, I don't know enough about the internals of Nerves to start debugging this. Any pointers, or requests for additional information, etc? Thanks!

aseigo commented 1 year ago

Other potentially useful information: I'm using the 0.3.1 release from hex.pm and an on Linux.

fhunleth commented 1 year ago

Hi @aseigo,

Could you look at your project's mix.exs and check that :mangopi_mq_pro is listed in @all_target? Like this: https://github.com/elixir-circuits/circuits_quickstart/blob/e76b5b69c7356d2003887e55e13cea9c74e658b4/mix.exs#L18

What I'm thinking is that the :nerves_runtime dependency in your mix.exs is only listed for @all_targets, so it's not included. This is the default, so it would make sense.

One last thing, I'm assuming that you added :nerves_system_mangopi_mq_pro to your deps like this: https://github.com/elixir-circuits/circuits_quickstart/blob/e76b5b69c7356d2003887e55e13cea9c74e658b4/mix.exs#L74.

If that doesn't work, could you take a quick skim of the circuits_quickstart mix.exs and see if any other differences pop out when you compare it to your project's mix.exs?

And yes, there's got to be a way to make that error message better. I'll think about that.

aseigo commented 1 year ago

Could you look at your project's mix.exs and check that :mangopi_mq_pro is listed in @all_target

This was it! Thanks! I somehow missed that part in the README.md, and as this is my first nerves project on hardware that isn't one of the "regular suspects" I hadn't touched that before. Thanks for the swift and accurate response! :)