Getting nerves_bootstrap (Hex package)
All dependencies are up to date
Compiling 12 files (.ex)
== Compilation error in file lib/attic/env.ex ==
** (ArgumentError) could not call Module.put_attribute/3 because the module Nerves.Bootstrap.Aliases is in read-only mode (@after_compile)
(elixir 1.15.1) lib/module.ex:2305: Module.assert_not_readonly!/2
(elixir 1.15.1) lib/module.ex:2007: Module.put_attribute/5
lib/attic/env.ex:2: (module)
I think this is the first time we’ve seen this error. I just tried reproducing the error on an M1 Mac w/ Elixir 1.15.1 and Erlang 26.0.2 and couldn’t.
Could you give more details on your setup? How did you install Elixir and are there other archives installed? (run mix archive to get the installed archive list)
I installed elixir with asdf as described in the Nerves installation page. It’s a fresh install of elixir, so there are no other–aside from hex–archives installed.
So, I blitzed my asdf dir and started over. Now I get a different error:
$ mix archive.install hex nerves_bootstrap
Resolving Hex dependencies…
Resolution completed in 0.018s
New:
nerves_bootstrap 1.11.5
Getting nerves_bootstrap (Hex package)
All dependencies are up to date
Compiling 12 files (.ex)
** (FunctionClauseError) no function clause matching in Mix.Tasks.Local.Nerves.info/1
The following arguments were given to Mix.Tasks.Local.Nerves.info/1:
Even more puzzling, if I run it again, I get a third error:
$ mix archive.install hex nerves_bootstrap
Resolving Hex dependencies…
Resolution completed in 0.019s
New:
nerves_bootstrap 1.11.5
Getting nerves_bootstrap (Hex package)
All dependencies are up to date
Compiling 12 files (.ex)
== Compilation error in file lib/attic/deps.get.ex ==
** (ArgumentError) could not call Module.put_attribute/3 because the module Mix.Nerves.IO is already compiled
(elixir 1.15.1) lib/module.ex:2310: Module.assert_not_readonly!/2
(elixir 1.15.1) lib/module.ex:2007: Module.put_attribute/5
lib/attic/deps.get.ex:2: (module)
I’m really grasping, though. If you could copy all output starting from installing asdf, Erlang, and Elixir and finally the mix install hex nerves_bootstrap line, perhaps there’s a warning buried in there.
$ asdf install erlang 26.0.2
Downloading kerl…
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 85117 100 85117 0 0 340k 0 --:–:-- --:–:-- --:–:-- 344k
asdf_26.0.2 is not a kerl-managed Erlang/OTP installation
No build named asdf_26.0.2
Downloading 26.0.2 to /Users/toby/.asdf/downloads/erlang/26.0.2…
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
100 102M 100 102M 0 0 10.3M 0 0:00:09 0:00:09 --:–:-- 11.1M
Extracting source code
Building Erlang/OTP 26.0.2 (asdf_26.0.2), please wait…
DOCUMENTATION INFORMATION (See: /Users/toby/.asdf/plugins/erlang/kerl-home/builds/asdf_26.0.2/otp_build_26.0.2.log)
documentation :
fop is missing.
Using fakefop to generate placeholder PDF files.
Erlang/OTP 26.0.2 (asdf_26.0.2) has been successfully built
Cleaning up compilation products for 26.0.2
Cleaned up compilation products for 26.0.2 under /Users/toby/.asdf/plugins/erlang/kerl-home/builds
$ asdf install elixir 1.15.1-otp-26
==> Checking whether specified Elixir release exists…
==> Downloading 1.15.1-otp-26 to /Users/toby/.asdf/downloads/elixir/1.15.1-otp-26/elixir-precompiled-1.15.1-otp-26.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6641k 100 6641k 0 0 5945k 0 0:00:01 0:00:01 --:–:-- 5972k
==> Copying release into place
$ brew info openssl
==> openssl@3: stable 3.1.2 (bottled)
Cryptography and SSL/TLS Toolkit
https://openssl.org/
/usr/local/Cellar/openssl@3/3.1.2 (6,495 files, 30.0MB) *
Poured from bottle on 2023-08-12 at 12:39:26
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/openssl@3.rb
License: Apache-2.0
==> Dependencies
Required: ca-certificates ✔
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl@3/certs
and run
/usr/local/opt/openssl@3/bin/c_rehash
==> Analytics
install: 419,609 (30 days), 945,723 (90 days), 1,199,741 (365 days)
install-on-request: 42,295 (30 days), 196,058 (90 days), 264,268 (365 days)
build-error: 1,658 (30 days)
Sorry for the delays in responding. It seems like mid-August caught up with Jon and me.
As far as I can tell, you’re doing everything right. The error that you’re getting should have been a good hint, but I can not reproduce it. I created an issue to track it.
Could you try installing nerves_bootstrap like this and let me know if it works?
mix archive.install github nerves-project/nerves_bootstrap branch support-nerves-1.8-and-later
# If successful, try this
mix nerves.new test_project # answer y to the question
cd test_project
export MIX_TARGET=rpi0
mix deps.get
mix firmware
You won’t be able to use Nerves versions before v1.8.0, but that version is over a year old now.
Thanks for your patience with what should have been an easy step.
@tobytripp Can you try the newly released nerves_boostrap v1.12.1? It completely removes the legacy tasks that are showing in your failure traces here so I’m hopeful it fixes things for you