You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NixOS is a Linux distribution which does not obey the FHS, and as such, the protoc supplied by protoc-bin-vendored-linux will fail to run:
error: failed to run custom build command for `meshtastic v0.1.6`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.
Caused by:
process didn't exit successfully: `/home/ablyve/my/83e_meshtastic-bot/target/debug/build/meshtastic-bf53c0c18fbe98d1/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-changed=src/protobufs/
--- stderr
thread 'main' panicked at /home/ablyve/.cargo/registry/src/index.crates.io-6f17d22bba15001f/meshtastic-0.1.6/build.rs:49:54:
called `Result::unwrap()` on an `Err` value: Custom { kind: NotFound, error: "failed to invoke protoc (hint: https://docs.rs/prost-build/#sourcing-protoc): (path: \"/home/ablyve/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protoc-bin-vendored-linux-x86_64-3.0.0/bin/protoc\"): No such file or directory (os error 2)" }
If we run the binary manually:
/home/ablyve/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protoc-bin-vendored-linux-x86_64-3.0.0/bin/protoc
bash: /home/ablyve/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protoc-bin-vendored-linux-x86_64-3.0.0/bin/protoc: cannot execute: required file not found
As a workaround, doing this patchelf manually on NixOS lets the build finish:
Same thing on Alpine Linux - provided protoc binary expects /lib64 to be present. It is unfortunate that tokio-rs/prost#771 got stalled - downloading precompiled binary is a terrible solution and Rust ecosystem deserves better.
I think the issue is the installation of the vendored protoc is successful so even if PROTOC is already set to use the Nix provided version, the build.rs will always replace the environment variable even if already set.
NixOS is a Linux distribution which does not obey the FHS, and as such, the
protoc
supplied byprotoc-bin-vendored-linux
will fail to run:If we run the binary manually:
As a workaround, doing this
patchelf
manually on NixOS lets the build finish:patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) /home/ablyve/.cargo/registry/src/index.crates.io-6f17d22bba15001f/protoc-bin-vendored-linux-x86_64-3.0.0/bin/protoc
The text was updated successfully, but these errors were encountered: