"No rule to make target" when compiling locally

I’ve probably done something silly, but trying to follow the instructions in the readme for locally building using Nix/docker and I keep getting No rule to make target 'release-amd64'. Stop.

I didn’t include the complete output from make build-ui because it seems to complete successfully, so just the tail end of that is included below and make dev-dep also completed without errors:

Find out more about deployment here:

  https://cra.link/deployment

Done in 75.66s.
make[1]: Leaving directory '/home/myusername/repositories/chirpstack/ui'

[nix-shell:~/repositories/chirpstack]$ make dev-dependencies
cargo install cross --version 0.2.5
     Ignored package `cross v0.2.5` is already installed, use --force to override
cargo install diesel_cli --version 2.1.0 --no-default-features --features postgres
     Ignored package `diesel_cli v2.1.0` is already installed, use --force to override
cargo install cargo-deb --version 1.43.1
     Ignored package `cargo-deb v1.43.1` is already installed, use --force to override
cargo install cargo-generate-rpm --version 0.12.1
     Ignored package `cargo-generate-rpm v0.12.1` is already installed, use --force to override

[nix-shell:~/repositories/chirpstack]$ make debug-amd64
make: *** No rule to make target 'debug-amd64'.  Stop.

[nix-shell:~/repositories/chirpstack]$ make release-amd64
make: *** No rule to make target 'release-amd64'.  Stop.

Interestingly I’m getting “sh: line 1: jq: command not found” when running “make dist”.

[nix-shell:~/repositories/chirpstack]$ make dist
cd api && make grpc-web
make[1]: Entering directory '/home/myusername/repositories/chirpstack/api'
cd grpc-web && make
make[2]: Entering directory '/home/myusername/repositories/chirpstack/api/grpc-web'
yarn install
yarn install v1.22.19
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.08s.
mkdir -p common
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/common/common.proto
mkdir -p api
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/internal.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/user.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/tenant.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/application.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/device_profile.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/device_profile_template.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/device.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/gateway.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/multicast_group.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/relay.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/google/api/*.proto
make[2]: Leaving directory '/home/myusername/repositories/chirpstack/api/grpc-web'
make[1]: Leaving directory '/home/myusername/repositories/chirpstack/api'
cd chirpstack && make dist
make[1]: Entering directory '/home/myusername/repositories/chirpstack/chirpstack'
sh: line 1: jq: command not found
# Keep these in this order, as aarch64 is based on Debian Buster (older),
# the others on Bullseye. For some build scripts we want to build against
# least recent LIBC.
cross build --target aarch64-unknown-linux-musl --release
make[1]: cross: No such file or directory
make[1]: *** [Makefile:15: dist] Error 127
make[1]: Leaving directory '/home/myusername/repositories/chirpstack/chirpstack'
make: *** [Makefile:6: dist] Error 2

I’m going to remove/re-clone the repo and report back in a moment if that fixes it because I tried doing things the wrong way first with cargo build inside docker.

Edit so I’m not commenting too much: reclone did not help. Still seeing “No Rule to make target” for building with Nix

  1. For the second part, I was able to resolve the “jq: command not found” by running nix-env -iA nixpkgs.jq. Found this solution here: How to build chirpstack V4 - #4 by siasjack

  2. The “No rule to make target” errors were “solved(?)” by changing directory into the chirpstack directory where the make file defines them :face_exhaling:

I still cannot build though. The “cross” command isn’t in the path. Below is the actual output, but just running cross build --target x86_64-unknown-linux-musl results in a command not found which I assume is where the below “No such file or directory” is coming from.

(Total rust newbie here if it wasn’t obvious)

[nix-shell:~/repositories/chirpstack]$ make dist
make[1]: Entering directory '/home/myusername/repositories/chirpstack'
cd api && make grpc-web
make[2]: Entering directory '/home/myusername/repositories/chirpstack/api'
cd grpc-web && make
make[3]: Entering directory '/home/myusername/repositories/chirpstack/api/grpc-web'
yarn install
yarn install v1.22.19
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.09s.
mkdir -p common
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/common/common.proto
mkdir -p api
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/internal.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/user.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/tenant.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/application.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/device_profile.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/device_profile_template.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/device.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/gateway.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/multicast_group.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/api/relay.proto
./node_modules/grpc-tools/bin/protoc -I=../proto --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs+dts,mode=grpcwebtext:. ../proto/google/api/*.proto
make[3]: Leaving directory '/home/myusername/repositories/chirpstack/api/grpc-web'
make[2]: Leaving directory '/home/myusername/repositories/chirpstack/api'
cd chirpstack && make dist
make[2]: Entering directory '/home/myusername/repositories/chirpstack/chirpstack'
# Keep these in this order, as aarch64 is based on Debian Buster (older),
# the others on Bullseye. For some build scripts we want to build against
# least recent LIBC.
#cross build --target aarch64-unknown-linux-musl --release
cross build --target x86_64-unknown-linux-musl --release
make[2]: cross: No such file or directory
make[2]: *** [Makefile:16: dist] Error 127
make[2]: Leaving directory '/home/myusername/repositories/chirpstack/chirpstack'
make[1]: *** [Makefile:6: dist] Error 2
make[1]: Leaving directory '/home/myusername/repositories/chirpstack'

A cd chirpstack should solve the make debug-amd64 issue. You can find it here in the Makefile:

Thanks Brocaar! I actually put that as the solution in my second post. we can probably close this thread since the topic is resolved.

For the other details which are not relevant. I was able to build Chirpstack locally, but not with docker or Nix. I just installed the correct versions of Rust, Node, and etc.

Hope this all helps anyone else Googling this problem :stuck_out_tongue: