| 13 Jul 2025 |
QuadRadical (Ping) | Hello, I'm trying to resolve this cross-compilation build issue: https://github.com/NixOS/nixpkgs/issues/424694
I tried based on a suggestion in #NixOS on ARM to move lvm2 from buildInputs to depsBuildBuild, which results in a different error (just adding it to both makes no difference, original error):
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `devicemapper-sys v0.3.2`
Caused by:
process didn't exit successfully: `/build/source/target/release/build/devicemapper-sys-9444e4d34953f84b/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-env-changed=DEVMAPPER_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_aarch64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_aarch64_unknown_linux_gnu
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
cargo:rerun-if-env-changed=PKG_CONFIG_aarch64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_aarch64_unknown_linux_gnu
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=DEVMAPPER_STATIC
cargo:rerun-if-env-changed=DEVMAPPER_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_aarch64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_aarch64_unknown_linux_gnu
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_aarch64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_aarch64_unknown_linux_gnu
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64_unknown_linux_gnu
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
--- stderr
thread 'main' panicked at /build/thin-provisioning-tools-1.2.0-vendor/devicemapper-sys-0.3.2/build.rs:18:19:
Suitable version of libdevmapper not found:
pkg-config exited with status code 1
> PKG_CONFIG_PATH=/nix/store/dgkyx5chvihgvmgb8pvc8qxq4gqm37b6-systemd-minimal-libs-aarch64-unknown-linux-gnu-257.6-dev/lib/pkgconfig:/nix/store/dgkyx5chvihgvmgb8pvc8qxq4gqm37b6-systemd-minimal-libs-aarch64-unknown-linux-gnu-257.6-dev/share/pkgconfig PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 aarch64-unknown-linux-gnu-pkg-config --libs --cflags devmapper 'devmapper >= 1.02.151'
The system library `devmapper` required by crate `devicemapper-sys` was not found.
The file `devmapper.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
PKG_CONFIG_PATH contains the following:
- /nix/store/dgkyx5chvihgvmgb8pvc8qxq4gqm37b6-systemd-minimal-libs-aarch64-unknown-linux-gnu-257.6-dev/lib/pkgconfig
- /nix/store/dgkyx5chvihgvmgb8pvc8qxq4gqm37b6-systemd-minimal-libs-aarch64-unknown-linux-gnu-257.6-dev/share/pkgconfig
HINT: you may need to install a package such as devmapper, devmapper-dev or devmapper-devel.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
| 20:04:56 |
QuadRadical (Ping) | Any help would be appreciated, thanks. | 20:05:05 |
Grimmauld (any/all) | oh god that thing | 20:24:03 |
Grimmauld (any/all) | i poked it briefly until i decided the rust crate is just semi-broken in a way that is pain to patch | 20:24:34 |
QuadRadical (Ping) | oh no haha | 20:24:41 |
QuadRadical (Ping) | its a dependency of udisks | 20:24:45 |
QuadRadical (Ping) | so i cant cross compile gnome otherwise | 20:24:49 |
Grimmauld (any/all) | is it a hard dep of udisks? | 20:25:02 |
QuadRadical (Ping) | I dont know i just know i built and i got an error from this | 20:25:36 |
Grimmauld (any/all) | https://github.com/storaged-project/libblockdev/blob/3dce2444723a3d5781a5de3c0d35faf82e7104e4/Makefile.am#L16
you might get away with disabling device mapper support on libblockdev when on cross, then drop thin-provisioning-tools from that. Not nice, but maybe the simplest to get a full cross gnome again | 20:30:04 |
QuadRadical (Ping) | hmm | 20:31:39 |
Grimmauld (any/all) | you might lose some LVM support though, so not great | 20:31:46 |
QuadRadical (Ping) | i cannot fix the cross compilation? | 20:31:48 |
Grimmauld (any/all) | i couldn't fix it, doesn't mean you can't | 20:32:01 |
QuadRadical (Ping) | right so the issue is in the crate itself? | 20:32:11 |
QuadRadical (Ping) | yeah but youre better with nix than me lol | 20:32:22 |
Grimmauld (any/all) | eh, i only stabbed it for like half an hour, wasn't too serious about it | 20:32:51 |
QuadRadical (Ping) | ah oke | 20:33:26 |
QuadRadical (Ping) | the issue is in the crate right? | 20:33:32 |
QuadRadical (Ping) | thats what you said? | 20:33:39 |
QuadRadical (Ping) | the devicemapper crate? | 20:33:45 |
Grimmauld (any/all) | from what i can tell (realy i am not good with this) it seems either the pkg-config path is a little broken or its using the wrong ld | 20:34:56 |
Grimmauld (any/all) | linker says "skipping incompatible", the log says /nix/store/pbqah1qk4b5y14fqinr1h8zvhqy71v81-gcc-wrapper-14.3.0/bin/cc. The compiler should probably be more like /nix/store/xspnj9pmwz481xdfvwh365b6fzgch4k9-aarch64-unknown-linux-gnu-gcc-wrapper-14.2.1.20250322/bin/aarch64-unknown-linux-gnu-gcc, but i am not sure how to force that | 20:38:13 |
QuadRadical (Ping) | hmm i see | 20:44:05 |
QuadRadical (Ping) | So putting lvm2 in depsBuildBuild like emily said isn't required, you think? | 20:44:34 |
emily | if it's using the wrong compiler then that's what needs fixing rather than the architecture of the dep | 20:44:52 |
emily | it just looked like a build script thing to me | 20:45:02 |
QuadRadical (Ping) | ah i see thank you | 20:45:15 |
Grimmauld (any/all) | dunno, emily knows more than me | 20:45:21 |
Grimmauld (any/all) | to me the compiler looked wonky, but i am also not super familiar with the internals of the cargo builder and how it wraps gcc/binutils | 20:45:51 |