!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

661 Members
Rust152 Servers

Load older messages


SenderMessageTime
3 Aug 2025
@ryoeuyo:matrix.orgryo joined the room.06:06:26
4 Aug 2025
@diniamo:matrix.org@diniamo:matrix.org left the room.06:06:51
@entro:matrix.orgentro joined the room.12:29:05
@kjeremy:matrix.orgkjeremy I'm struggling a little with cross-compilation. If I import nixpkgs with { system = "x86_64-linux"; crossSystem = lib.systems.examples.aarch64-multiplatform; }; then my my rust project ends up running rustc under qemu. Is there a way to get it to run natively and do a cross build? 13:34:39
@dramforever:matrix.orgdramforeverwe need more information ... do you have a more complete example?13:53:28
@qyliss:fairydust.spaceAlyssa Rossthat sounds like you're using rustc somewhere where you should be using buildPackages.rustc13:54:11
@emilazy:matrix.orgemilythe best way to ensure you're doing cross right is to disable binfmt14:37:04
@emilazy:matrix.orgemily(although Nixpkgs will sometimes QEMU on your behalf regardless)14:37:13
@kjeremy:matrix.orgkjeremyThank you. I wish I could share this but it's an overlay based on nix-ros-overlay with some giant overrides buried in our repo so it's not easily shareable14:39:27
@kjeremy:matrix.orgkjeremyand at some point cmake gets invoked which confuses things14:40:02
@kjeremy:matrix.orgkjeremy Using buildPackages.rustPlatform.cargoSetupHook gets me a little farther and avoids qemu 15:06:59
@kjeremy:matrix.orgkjeremy

I'm ending up with something like this:

ros-humble-zenoh-cpp-vendor-aarch64-unknown-linux-gnu> cargo:warning=aarch64-unknown-linux-gnu-gcc: error: unrecognized command line option '-m64'
ros-humble-zenoh-cpp-vendor-aarch64-unknown-linux-gnu>
ros-humble-zenoh-cpp-vendor-aarch64-unknown-linux-gnu> --- stderr
ros-humble-zenoh-cpp-vendor-aarch64-unknown-linux-gnu>
ros-humble-zenoh-cpp-vendor-aarch64-unknown-linux-gnu>
ros-humble-zenoh-cpp-vendor-aarch64-unknown-linux-gnu> error occurred: Command "aarch64-unknown-linux-gnu-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "include" "-I" "/build/rmw_zenoh-release-release-humble-zenoh_cpp_vendor-0.1.1-1/build/zenoh_c_vendor-prefix/src/zenoh_c_vendor-build/release/target/release/build/ring-224694a13d0c6d7a/out" "-Wall" "-Wextra" "-fvisibility=hidden" "-std=c1x" "-Wall" "-Wbad-function-cast" "-Wcast-align" "-Wcast-qual" "-Wconversion" "-Wmissing-field-initializers" "-Wmissing-include-dirs" "-Wnested-externs" "-Wredundant-decls" "-Wshadow" "-Wsign-compare" "-Wsign-conversion" "-Wstrict-prototypes" "-Wundef" "-Wuninitialized" "-g3" "-DNDEBUG" "-o" "/build/rmw_zenoh-release-release-humble-zenoh_cpp_vendor-0.1.1-1/build/zenoh_c_vendor-prefix/src/zenoh_c_vendor-build/release/target/release/build/ring-224694a13d0c6d7a/out/fad98b632b8ce3cc-curve25519.o" "-c" "crypto/curve25519/curve25519.c" with args aarch64-unknown-linux-gnu-gcc did not execute successfully (status code exit status: 1).

16:00:20
@dramforever:matrix.orgdramforever so no -m64 will not possibly work for arm 16:31:13
@dramforever:matrix.orgdramforever it sounds like ring is doing something wrong 16:32:14
@kjeremy:matrix.orgkjeremy I know that -m64 is definitely wrong. All the environment variables LOOK correct 16:33:43
@dramforever:matrix.orgdramforeveri ... i think this is cc-rs?16:36:57
@dramforever:matrix.orgdramforever what's the version of ring used here? it should say it earlier in the log 16:40:26
@dramforever:matrix.orgdramforever actually maybe it will be more helpful if you just tell me the "cc" version in Cargo.lock that it uses 16:49:14
@kjeremy:matrix.orgkjeremyring 0.17.8, cc 1.1.2016:53:41
@dramforever:matrix.orgdramforeveri just noticed this17:16:51
@dramforever:matrix.orgdramforeveri don't think this is right17:17:05
@dramforever:matrix.orgdramforever rustPlatform.cargoSetupHook should be correct 17:17:24
@qyliss:fairydust.spaceAlyssa RossNo? Usually the hook goes in nativeBuildInputs, and when they weren't doing that it used rustc built for aarch6417:17:54
@dramforever:matrix.orgdramforever rustPlatform is like stdenv, i think 17:18:39
@dramforever:matrix.orgdramforever rustPlatform.rust.rustc == buildPackages.rustc 17:18:42
@emilazy:matrix.orgemily it's correct in nativeBuildInputs 17:19:16
@emilazy:matrix.orgemily perhaps it is not going in nativeBuildInputs 17:19:20
@emilazy:matrix.orgemily the hooks go in nativeBuildInputs though right? 17:19:42
@dramforever:matrix.orgdramforever it should definitely be in nativeBuildInputs 17:19:43
@emilazy:matrix.orgemily so rustPlatform.cargoSetupHook cannot be buildPackages.* w/o splicing 17:19:50

Show newer messages


Back to Room ListRoom Version: 6