alde103

alde103

Issues compiling a nerves custom system with v1.29.1 (buildroot 2024.08.3)

Hello everyone, I believe this issue is more related to Buildroot version (2024.08.3) than to Nerves itself, but I would still like to hear your thoughts.

I am trying to upgrade my custom_system based on rpi4 from version 1.27 to 1.29.1. However, when I try to compile, I get the following error:

** (Mix) Nerves encountered an error while constructing the artifact
/home/alde/Documents/Elixir/Nerves/repos/valiot_system_rpi4/packages/cloudflared/cloudflared.mk:19: *** Package 'cloudflared' defined a second time in '/home/alde/Documents/Elixir/Nerves/repos/valiot_system_rpi4/packages/cloudflared'; previous definition was in 'package/cloudflared'.  Stop.
make: *** [Makefile:23: _all] Error 2

It seems that in this new Buildroot version, the package I had manually added was included by default, causing a conflict. To resolve this, I had to rename the package (cloudflaredcloudflared-bin, since Buildroot does not have the latest version available). Everything seemed to work fine until another error appeared with the mosquitto package:

>>> mosquitto 2.0.19 Extracting
gzip -d -c /home/alde/.nerves/dl/mosquitto/mosquitto-2.0.19.tar.gz | /home/alde/Documents/Elixir/Nerves/repos/valiot_system_rpi4/.nerves/artifacts/valiot_system_rpi4-portable-1.29.1-valiot.16/host/bin/tar --strip-components=1 -C /home/alde/Documents/Elixir/Nerves/repos/valiot_system_rpi4/.nerves/artifacts/valiot_system_rpi4-portable-1.29.1-valiot.16/build/mosquitto-2.0.19  --no-same-owner -xf -
>>> mosquitto 2.0.19 Patching

Applying 0001-Revert-Fix-NetBSD-build.patch using patch: 
The next patch would create the file lib/dummypthread.h,
which already exists!  Skipping patch.
1 out of 1 hunk ignored
patching file lib/handle_pubackcomp.c
Reversed (or previously applied) patch detected!  Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file lib/handle_pubackcomp.c.rej
patching file lib/mosquitto_internal.h
Reversed (or previously applied) patch detected!  Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file lib/mosquitto_internal.h.rej
patching file lib/packet_mosq.c
Reversed (or previously applied) patch detected!  Skipping patch.
15 out of 15 hunks ignored -- saving rejects to file lib/packet_mosq.c.rej
The next patch would delete the file lib/pthread_compat.h,
which does not exist!  Skipping patch.
1 out of 1 hunk ignored
patching file lib/util_mosq.c
Reversed (or previously applied) patch detected!  Skipping patch.
8 out of 8 hunks ignored -- saving rejects to file lib/util_mosq.c.rej
make[1]: *** [package/pkg-generic.mk:247: /home/alde/Documents/Elixir/Nerves/repos/valiot_system_rpi4/.nerves/artifacts/valiot_system_rpi4-portable-1.29.1-valiot.16/build/mosquitto-2.0.19/.stamp_patched] Error 1
make: *** [Makefile:23: _all] Error 2

It seems that in this Buildroot version, the patch doesn’t works. My question is: what would be the best way to handle this situation?

I could do the same as with the cloudflared package—create an external package for Buildroot (mosquitto-2), disable mosquitto (from Buildroot), and enable mosquitto-2. However, I’m not sure if that is the best approach. What do you think?

P.S. To check if there were other problematic packages, I removed mosquitto from the system, and the compilation completed successfully :slight_smile: .

Most Liked

alde103

alde103

Just to wrap up the topic, I created a mosquitto-external package as an external Buildroot package. I copied the mosquitto package from the Buildroot 2024.11.2 release (which appears to have been updated to mosquitto 2.0.20), adjusted some environment variables to match the new package name, and it compiled successfully. :slightly_smiling_face:

Thanks, everyone!

jjcarstens

jjcarstens

Nerves Core Team

FWIW, both cloudflared and mosquito provide prebuilt binaries and I’ve used them with previous firmwares just downloading the version I need. It doesn’t answer the original question, but my preference is always prebuilt binaries over buildroot unless it’s absolutely required to use and compile myself

abelino

abelino

You can take a similar approach to what you did with cloudflared-bin by creating a new mosquitto package in your Nerves system under a different name. Thanks to Git history, you can easily retrieve a previous working version [0].

Alternatively, if you’re able to debug and fix the issue in the latest Mosquitto version, you could create a patch for it. Since Buildroot tends to lag behind on package versions, someone else might have already addressed the problem. The key is to find the relevant patch in the upstream project repo and incorporate it into your Nerves system.

[0] buildroot/package/mosquitto at 236dc1015cbda9b0c3479e2f37cb09c507da04dc · buildroot/buildroot · GitHub

Where Next?

Popular in Questions Top

dotdotdotPaul
Okay, I’m having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I’m sure I’...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New

Other popular topics Top

vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39467 209
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 43487 311
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement