Concentratord rpi5

Hello,
following the steps in the concentratod repository I find this:
[nix-shell:/home/ccinterodlo/repos/chirpstack-concentratord]# make test
cross clippy --target x86_64-unknown-linux-musl
[+] Building 0.4s (3/3) FINISHED
=> [internal] load build definition from Dockerfile.x86_64-unknown-linux-musl 0.0s
=> => transferring dockerfile: 2.32kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> ERROR [internal] load metadata for Package x86_64-unknown-linux-musl Ā· GitHub 0.3s

[internal] load metadata for ghcr.io/cross-rs/x86_64-unknown-linux-musl:main:


failed to solve with frontend dockerfile.v0: failed to create LLB definition: no match for platform in manifest sha256:1edd264e76843b7513cb765ff7452cf8165b95db28ec45b51f3a1a55e2f9ca6c: not found
Error:
0: could not run container
1: when building custom image
2: when building dockerfile
3: docker build --label 'org.cross-rs.for-cross-target=x86_64-unknown-linux-musl' --label 'org.cross-rs.workspace_root=/home/ccinterodlo/repos/chirpstack-concentratord' --tag cross-custom-chirpstack-concentratord:x86_64-unknown-linux-musl-3c438 --build-arg 'CROSS_DEB_ARCH=musl-linux-amd64' --build-arg 'CROSS_BASE_IMAGE=ghcr.io/cross-rs/x86_64-unknown-linux-musl:0.2.5' --file cross/Dockerfile.x86_64-unknown-linux-musl /home/ccinterodlo/repos/chirpstack-concentratord failed with exit status: 1
make: *** [Makefile:106: test] Error 1

Iā€™m using raspbian 64

1 Like

I think that instructions maybe aims to cross-compiling on Intel base linux system (x86_64-unknown-linux-musl). On the Intel base linux can cross-compile binaries that can be run in arm64 cpu architecture (I.E Raspberry 4,5).

Instead make command try following:

cross build --target aarch64-unknown-linux-musl --release

Does it compiles now?

Compiled binary can be run in rpi5 + Docker if you use Alpine linux container (aarch64-unknown-linux-musl) in docker.

I tested this case and it not compiles on RPi (arm64) systems. You should do the compilation on Intel linux PC or WSL environment in Windows.

Following works on intel PC where I run linux (ubuntu 22.04)

$ git clone  https://github.com/chirpstack/chirpstack-concentratord.git
$ cd chirpstack-concentratord
$ nix-shell
$ make build-aarch64-unknown-linux-musl

...
warning: field `enable` is never read
  --> chirpstack-concentratord-sx1302/src/config/vendor/mod.rs:41:9
   |
40 | pub struct RadioConfig {
   |            ----------- field in this struct
41 |     pub enable: bool,
   |         ^^^^^^
   |
   = note: `RadioConfig` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
   = note: `#[warn(dead_code)]` on by default

warning: `chirpstack-concentratord-2g4` (bin "chirpstack-concentratord-2g4") generated 1 warning
warning: `chirpstack-concentratord-sx1302` (bin "chirpstack-concentratord-sx1302") generated 1 warning
    Finished `release` profile [optimized] target(s) in 2m 50s

Concentratord code compiles nicely and aarch64-unknown-linux-musl binary found in target/aarch64-unknown-linux-musl/release/ folder.

[nix-shell:~/tmp2/chirpstack-concentratord]$ ls -ls target/aarch64-unknown-linux-musl/release/
total 240716
    4 drwxr-xr-x 18 tapsa tapsa     4096 Nov 21 02:00 build
 4488 -rwxr-xr-x  2 tapsa tapsa  4592672 Nov 21 02:03 chirpstack-concentratord-2g4
    4 -rw-r--r--  1 tapsa tapsa     3135 Nov 21 02:03 chirpstack-concentratord-2g4.d
 4900 -rwxr-xr-x  2 tapsa tapsa  5013976 Nov 21 02:03 chirpstack-concentratord-sx1301
    8 -rw-r--r--  1 tapsa tapsa     4718 Nov 21 02:03 chirpstack-concentratord-sx1301.d
 5084 -rwxr-xr-x  2 tapsa tapsa  5202952 Nov 21 02:03 chirpstack-concentratord-sx1302
    8 -rw-r--r--  1 tapsa tapsa     4821 Nov 21 02:03 chirpstack-concentratord-sx1302.d
   28 drwxr-xr-x  2 tapsa tapsa    24576 Nov 21 02:03 deps
    4 drwxr-xr-x  2 tapsa tapsa     4096 Nov 21 02:00 examples
 2384 -rwxr-xr-x  2 tapsa tapsa  2439232 Nov 21 02:02 gateway-id
    4 -rw-r--r--  1 tapsa tapsa       87 Nov 21 02:03 gateway-id.d
    4 drwxr-xr-x  2 tapsa tapsa     4096 Nov 21 02:00 incremental
    4 -rw-r--r--  1 tapsa tapsa     1475 Nov 21 02:03 liblibconcentratord.d
56392 -rw-r--r--  2 tapsa tapsa 57742262 Nov 21 02:02 liblibconcentratord.rlib
    4 -rw-r--r--  1 tapsa tapsa      370 Nov 21 02:03 liblibloragw_2g4.d
55464 -rw-r--r--  2 tapsa tapsa 56793986 Nov 21 02:02 liblibloragw_2g4.rlib
    4 -rw-r--r--  1 tapsa tapsa      510 Nov 21 02:03 liblibloragw_sx1301.d
55944 -rw-r--r--  2 tapsa tapsa 57285676 Nov 21 02:02 liblibloragw_sx1301.rlib
    4 -rw-r--r--  1 tapsa tapsa      473 Nov 21 02:03 liblibloragw_sx1302.d
55980 -rw-r--r--  2 tapsa tapsa 57322768 Nov 21 02:02 liblibloragw_sx1302.rlib

ā€“
Cheers