mnishiguchi

mnishiguchi

Nerves Core Team

It seems like currently any Elixir package can be locally installed using
mix archive.install hex <package-name> command; however locally installing a
wrong package can negatively affect our local development environment particularly when dependencies are involved.

As an example, for Nerves project, we need to locally install one package called
nerves_bootstrap by running mix archive.install hex nerves_bootstrap.

But when we accidentally install nerves instead of nerves_bootstrap,
mix deps.get suddenly stops working in all the local Nerves firmware projects.

$ mix archive
* hex-2.0.4
* nerves-1.9.3   #<-- this is bad because it should not exist locally
* nerves_bootstrap-1.11.3
* phx_new-1.6.15
Archives installed at: /Users/mnishiguchi/.asdf/installs/elixir/1.14.3-otp-25/.mix/archives

We get an error that is not directly related to the mistake we make. The error
may looks like this:

mix deps.get
...
All dependencies are up to date

Nerves environment
  MIX_TARGET:   grisp2
  MIX_ENV:      dev

Checking for prebuilt Nerves artifacts...
  Checking nerves_system_grisp2...
  => Trying https://github.com/nerves-project/nerves_system_grisp2/releases/download/v0.6.0/nerves_system_grisp2
-portable-0.6.0-3B7C7BE.tar.gz

22:32:18.982 [notice] Application eex exited: :stopped
** (MatchError) no match of right hand side value: {:error, {:castore, {'no such file or directory', 'castore.ap
p'}}}
    (nerves 1.9.3) lib/nerves/utils/http_client.ex:24: Nerves.Utils.HTTPClient.start_link/0
    (nerves 1.9.3) lib/nerves/artifact/resolvers/uri.ex:14: Nerves.Artifact.Resolvers.URI.get/1
    (nerves 1.9.3) lib/nerves/artifact/resolver.ex:20: Nerves.Artifact.Resolver.do_get/3
    (nerves 1.9.3) lib/mix/tasks/nerves.artifact.get.ex:65: Mix.Tasks.Nerves.Artifact.Get.get_artifact/2
    (elixir 1.14.3) lib/enum.ex:975: Enum."-each/2-lists^foreach/1-0-"/2
    (mix 1.14.3) lib/mix/task.ex:421: anonymous fn/3 in Mix.Task.run_task/4
    (nerves_bootstrap 1.11.3) lib/mix/tasks/nerves.deps.get.ex:15: Mix.Tasks.Nerves.Deps.Get.run/1
    (mix 1.14.3) lib/mix/task.ex:421: anonymous fn/3 in Mix.Task.run_task/4``

Now I know the error occurs because the archive does not have dependencies but when
making this type mistake accidentally, the error message might not be so helpful in debugging.

Is there a way to prevent an improper archive from being accidentally installed locally, or
somehow show a little more informative error message?

Showing Posts 1 to 1

fhunleth

fhunleth

Co-author of Nerves

Installing :nerves instead of :nerves_bootstrap will be prevented in the next release by this change. The way it works is by aliasing archive.build to raise with an error message.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
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
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
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
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
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
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews