tobytripp

tobytripp

Hi there, I’m trying to get started with Nerves but I get an error on the final step of the installation process.

I’m on an M1 Mac,
Elixir 1.15.1
Erlang 26.0.2

When I try to install nerves_bootstrap, the following is the result:

$ 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/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)

Any ideas?

Showing Posts 1 to 10

fhunleth

fhunleth

Co-author of Nerves

Hi @tobytripp,

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)

tobytripp

tobytripp OP

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.

tobytripp

tobytripp OP

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:

      # 1
      :exports_md5
    

    Mix.Tasks.Local.Nerves.info/1
    (mix 1.15.1) lib/mix/compilers/elixir.ex:1015: Mix.Compilers.Elixir.compiler_loop/4
    (mix 1.15.1) lib/mix/compilers/elixir.ex:168: Mix.Compilers.Elixir.compile/7
    (mix 1.15.1) lib/mix/state.ex:15: Mix.State.lock/2
    (mix 1.15.1) lib/mix/task.ex:447: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.15.1) lib/mix/task.ex:502: Mix.Task.run_alias/6
    (mix 1.15.1) lib/mix/tasks/compile.all.ex:124: Mix.Tasks.Compile.All.run_compiler/2
    (mix 1.15.1) lib/mix/tasks/compile.all.ex:104: Mix.Tasks.Compile.All.compile/4

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)

fhunleth

fhunleth

Co-author of Nerves

Could you check if Erlang was built with SSL?

$ iex
Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]

Interactive Elixir (1.15.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> Application.ensure_all_started(:ssl)
{:ok, [:crypto, :asn1, :public_key, :ssl]}

If you don’t get what I got, you’ll need to brew install openssl and reinstall Erlang. There might be something else that’s helpful at GitHub - asdf-vm/asdf-erlang: Erlang plugin for asdf version manager · GitHub.

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.

tobytripp

tobytripp OP

I get:

$ iex
Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit:ns]

Interactive Elixir (1.15.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> Application.ensure_all_started(:ssl)
{:ok, [:crypto, :asn1, :public_key, :ssl]}

I’ll dig up the installation output momentarily.

tobytripp

tobytripp OP

Installation output:

$ 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

jjcarstens

jjcarstens

Nerves Core Team

Can you run echo $KERL_CONFIGURE_OPTIONS and brew info openssl

Also, is Elixir 1.15.1 a hard requirement? Are you able to try 1.15.4?

tobytripp

tobytripp OP

$ echo $KERL_CONFIGURE_OPTIONS

$ 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)

I’ll try 1.15.4

tobytripp

tobytripp OP

mix archive.install hex nerves_bootstrap

* creating /Users/toby/.asdf/installs/elixir/1.15.4-otp-26/.mix/archives/hex-2.0.6
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)

== Compilation error in file lib/mix/tasks/nerves/local.ex ==
** (ArgumentError) could not call Module.put_attribute/3 because the module Nerves.Bootstrap.MixProject is already compiled
    (elixir 1.15.4) lib/module.ex:2310: Module.assert_not_readonly!/2
    (elixir 1.15.4) lib/module.ex:2007: Module.__put_attribute__/5
    lib/mix/tasks/nerves/local.ex:2: (module)
jjcarstens

jjcarstens

Nerves Core Team

What directory are you in when running mix archive.install hex nerves_bootstrap?

Can you also try building Erlang with OpenSSL 1.1

brew install openssl@1.1
KERL_CONFIGURE_OPTIONS="--disable-debug --without-javac --with-ssl=$(brew --prefix openssl@1.1)" asdf install Erlang 26.0.2

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews