#Linux: How to specify custom interpreter? (rustc / cargo)

12 messages · Page 1 of 1 (latest)

cerulean ocean
#

I have a very odd issue, and I don't know if it's Cargo / rustc itself or the plugin cargo-c. But when I try to compile binaries in a Flatpak environment, where the Linux ELF interepreter is at /lib64/ld-linux-x86-64.so.2 the built build scripts are still compiled with my hosts interpreter which is at /nix/store/c10zhkbp6jmyh0xc5kd123ga8yy2p4hk-glibc-2.39-52/lib/ld-linux-x86-64.so.2. Is there any way to tell Rustc / Cargo / cargo-c to compile build scripts using another / standard interpreter path?

#

Other Flatpaks not using cargo-c build fine, so that's why I'm guessing it has something to do with it, but I skimmed the source and its issues and I don't see how it could.

#

Command executed: cargo cinstall --release --destdir=inst --prefix=/app --libdir=/app/lib64

#

and the file output for one of the build binaries: /run/build/docs/target/release/build/usbredirparser-sys-66e4dafdc8d48d55/build-script-build: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /nix/store/3dyw8dzj9ab4m8hv5dpyx7zii8d0w6fi-glibc-2.39-52/lib/ld-linux-x86-64.so.2, for GNU/Linux 3.10.0, not stripped

#

/nix/store/3dyw8dzj9ab4m8hv5dpyx7zii8d0w6fi-glibc-2.39-52/lib/ld-linux-x86-64.so.2 does not exist within the Flatpak builder sandbox, so executing the binary fails with No such file or directory (os error 2)

#

okay this has nothing to do with cargo-c, it also happens with just cargo build

#

Linux: How to specify custom interpreter? (rustc / cargo)

#

I don't really understand this, this library is building fine with Cargo in another Flatpak I'm using, but there I am pulling it in as a dependency of my app instead of building it directly.

#

full env: