!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

581 Members
128 Servers

Load older messages


SenderMessageTime
14 Jul 2025
@quadradical:federated.nexusQuadRadical (Ping)thanks!01:26:40
@artturin:matrix.orgArtturinCould be something wonky here https://github.com/stratis-storage/devicemapper-rs/blob/59e04984047cba0be7ea743c826bf825ddc7989e/devicemapper-rs-sys/build.rs#L3001:33:30
@emilazy:matrix.orgemilyso apparently they only use it for includes and not libraries01:34:06
@emilazy:matrix.orgemily and someone added the disable_cargo_metadata feature to avoid the pkg_config crate telling Cargo how to link with the library because they were having cross issues 01:34:25
@emilazy:matrix.orgemily but AFAICT the pkg_config crate is meant to handle cross-compilation properly, so at most we should need a "useless" lvm2 dep for build platform 01:34:44
@emilazy:matrix.orgemilyit will read target-suffixed env variables01:34:55
@emilazy:matrix.orgemily otoh we also PKG_CONFIG_ALLOW_CROSS = if stdenv.buildPlatform != stdenv.hostPlatform then 1 else 0; which apparently disables its logic for detecting when you're doing cross right 01:35:15
@emilazy:matrix.orgemily so I rather suspect we are failing to set the variables it expects and our Rust + pkg-config + cross story is just kind of broken in general right now? 01:35:42
@emilazy:matrix.orgemily I am not entirely sure how pkg-config cross in Nixpkgs in general is meant to work though. (e.g. do you want a separate pkg-config dep for each platform you need to use it on?) 01:36:27
@emilazy:matrix.orgemily(use it "for" I suppose I should say)01:41:22
@quadradical:federated.nexusQuadRadical (Ping)btw i changed it to use the other on e01:41:33
@quadradical:federated.nexusQuadRadical (Ping)* btw i changed it to use the other one01:41:44
@quadradical:federated.nexusQuadRadical (Ping)i dont know what the proper solution nis though01:42:04
@colemickens:matrix.orgcolemickens 🏳️‍🌈(the latest version doesn't work for me, native or cross, from what I can tell)05:43:18
@quadradical:federated.nexusQuadRadical (Ping) You're talking about my PR or? 13:26:45
@quadradical:federated.nexusQuadRadical (Ping)It builds fine for me13:26:50
@quadradical:federated.nexusQuadRadical (Ping)Unless you mean it doesn't work properly but does build13:27:03
@quadradical:federated.nexusQuadRadical (Ping)oh wait youre right13:30:26
@quadradical:federated.nexusQuadRadical (Ping) setting PKG_CONFIG_PATH appears to make it only build with cross 13:30:52
@quadradical:federated.nexusQuadRadical (Ping)yeah it fails about udev otherwise13:35:10
@quadradical:federated.nexusQuadRadical (Ping)i think the other way was better then13:35:15
@emilazy:matrix.orgemily that is probably because of our dodgy PKG_CONFIG_ALLOW_CROSS setting 13:46:49
@emilazy:matrix.orgemily the other way is really not mergeable, we do not want a udev dependency that is not even used 13:47:15
@emilazy:matrix.orgemily it's just a hack around only having the wrong-platform pkg-config 13:47:22
@quadradical:federated.nexusQuadRadical (Ping)oh ok13:47:35
@quadradical:federated.nexusQuadRadical (Ping)ill undo it th en13:47:49
@emilazy:matrix.orgemily probably PKG_CONFIG = lib.getExe pkgsBuildHost.pkg-config; would fix the PKG_CONFIG_PATH_* form 13:47:58
@emilazy:matrix.orgemilysomething really dodgy is going on though, I don't understand how more Rust packages aren't broken cross (well maybe they just are…)13:48:10
@quadradical:federated.nexusQuadRadical (Ping)the build error was about udev btw13:48:39
@quadradical:federated.nexusQuadRadical (Ping)
>   thread 'main' panicked at /build/thin-provisioning-tools-1.2.0-vendor/libudev-sys-0.1.4/build.rs:38:41:
       >   called `Result::unwrap()` on an `Err` value: "\npkg-config exited with status code 1\n> PKG_CONFIG_PATH=/nix/store/ia5i9cgajql0rhh38yz2p0qibx66fc8d-lvm2-2.03.32-dev/lib/pkgconfig PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags libudev\n\nThe system library `libudev` required by crate `libudev-sys` was not found.\nThe file `libudev.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.\nPKG_CONFIG_PATH contains the following:\n    - /nix/store/cxy5q3kn7aq9dp3bffznb37gzflanfk5-systemd-minimal-libs-257.6-dev/lib/pkgconfig\n    - /nix/store/cxy5q3kn7aq9dp3bffznb37gzflanfk5-systemd-minimal-libs-257.6-dev/share/pkgconfig\n    - /nix/store/ia5i9cgajql0rhh38yz2p0qibx66fc8d-lvm2-2.03.32-dev/lib/pkgconfig\n\nHINT: you may need to install a package such as libudev, libudev-dev or libudev-devel.\n"
13:48:41

Show newer messages


Back to Room ListRoom Version: 6