Help with cross-compilation aarch64-darwin
--> aarch64-unknown-linux-musl
#829
-
Hello! Following conversations from an issue and its recent PR, I have attempted to cross-compile an existing project from a macOS machine targeting { inputs, ... }:
{
perSystem =
{ system, ... }:
let
target = "aarch64-unknown-linux-musl";
pkgs = import inputs.nixpkgs {
crossSystem = {
config = target;
};
localSystem = system;
};
inherit (pkgs) lib;
# Bring the functionality of `crane` into the current scope, with a selected Rust toolchain.
craneLib = (inputs.crane.mkLib pkgs).overrideToolchain (
_:
with inputs.fenix.packages.${system};
combine [
stable.toolchain
targets.${target}.stable.rust-std
]
);
crateExpression =
{
libiconv,
lib,
stdenv,
}:
craneLib.buildPackage
({
src = ../.;
strictDeps = true;
CARGO_BUILD_RUSTFLAGS = "-C target-feature=+crt-static";
nativeBuildInputs =
[ ]
++ lib.optionals stdenv.buildPlatform.isDarwin [
libiconv
];
}
// craneLib.crateNameFromCargoToml { cargoToml = ../workspace-member/Cargo.toml; });
my-crate = pkgs.callPackage crateExpression { };
in
{
checks = { inherit my-crate; };
packages.my-crate = my-crate;
};
} I was under the impression that the relevant environment variables and linker references would be resolved automatically with what #794 had added, and in fact it kind of shows the variables being set up in the $ bat /nix/store/wb0bwmv5b65i17ijcy51hnnifnrsipwn-<REDACTED>-aarch64-unknown-linux-musl-0.36.1.drv
Derive([("out","/nix/store/7ga8np7sn9h8sfgqd2w66f0dbgih3zcz-<REDACTED>-aarch64-unknown-linux-musl-0.36.1","","")],[("/nix/store/0h5npx2qpx294071rw7i1kmy84dww750-installFromCargoBuildLogHook.drv",["out"]),("/nix/store/15ivc1hkmh8sk6lw9wxbpspypw1xcc8n-inheritCargoArtifactsHook.drv",["out"]),("/nix/store/19kfqz8ms2m90nxvlx3yalv3ci5wjgbg-rsync-3.4.1.drv",["out"]),("/nix/store/d0armws6j3kfp9sazl0n9dbxihcmzx2c-aarch64-unknown-linux-musl-gcc-wrapper-13.3.0.drv",["out"]),("/nix/store/f5alh6zdm70kczpj17wvx81kb4pcmr04-installCargoArtifactsHook.drv",["out"]),("/nix/store/jcmq21whggqlwvqvapj5f70wvswf5h65-configureCargoVendoredDepsHook.drv",["out"]),("/nix/store/jkpdhpd03wf4cgi2ikakfxy60mm128fl-replaceCargoLockHook.drv",["out"]),("/nix/store/kfzmpgrn7ak82w72nrmi3n0swxgwdbms-configureCargoCommonVarsHook.drv",["out"]),("/nix/store/kr0383fm1xw1c4cwnnwy9pszq88c65y5-libiconv-109.drv",["dev"]),("/nix/store/mnxw4zjs9pbisybnf6a1vr1c9cqc6daq-cargoHelperFunctionsHook.drv",["out"]),("/nix/store/njyyp3qjdka3l8rsc1sn99pnlf6z1d4m-zstd-1.5.6.drv",["dev"]),("/nix/store/pjz23hwbaqalnxv2hnx7cja7wk7wfzvq-removeReferencesToVendoredSourcesHook.drv",["out"]),("/nix/store/pmvabpmdk82agba64fl2fp93pc1xydmr-<REDACTED>-deps-aarch64-unknown-linux-musl-0.36.1.drv",["out"]),("/nix/store/qr7c2z3iwllns6nz5cflv33zs8nv948x-rust-mixed.drv",["out"]),("/nix/store/rfd5p10r2lvjcznjck6k078mnv9pqpm3-bash-5.2p37.drv",["out"]),("/nix/store/rhmhxhwjwmykhk8fhv62p53c9slawwxs-clang-wrapper-16.0.6.drv",["out"]),("/nix/store/xvyqhfpblv3qddmvm1xiah0mh9xf069f-removeReferencesToRustToolchainHook.drv",["out"]),("/nix/store/y0ns8vlj8g888gawbi2x5rmcmw0rrq37-vendor-cargo-deps.drv",["out"]),("/nix/store/zffbgxarwi5iyf1rmi288zg8gh50m8g6-stdenv-darwin.drv",["out"])],["/nix/store/i3wg8ia7pwqnm09bh3ky6xdcipbvzdk3-source","/nix/store/qa848i01y1iw4i4hhdsa4v4qw00br594-cross-file.conf","/nix/store/v6x3cs394jgqfbi0a42pam708flxaphh-default-builder.sh"],"aarch64-darwin","/nix/store/qzwsj5ihx6kjwikr0g77dnhcfxm1by68-bash-5.2p37/bin/bash",["-e","/nix/store/v6x3cs394jgqfbi0a42pam708flxaphh-default-builder.sh"],[("CARGO_BUILD_RUSTFLAGS","-C target-feature=+crt-static"),("NIX_HARDENING_ENABLE","bindnow format fortify fortify3 pic relro stackprotector strictoverflow zerocallusedregs pie"),("__CRANE_EXPORT_AR_AARCH64_APPLE_DARWIN","ar"),("__CRANE_EXPORT_AR_AARCH64_UNKNOWN_LINUX_MUSL","aarch64-unknown-linux-musl-ar"),("__CRANE_EXPORT_CARGO_BUILD_TARGET","aarch64-unknown-linux-musl"),("__CRANE_EXPORT_CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER","cc"),("__CRANE_EXPORT_CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER","aarch64-unknown-linux-musl-cc"),("__CRANE_EXPORT_CC_AARCH64_APPLE_DARWIN","cc"),("__CRANE_EXPORT_CC_AARCH64_UNKNOWN_LINUX_MUSL","aarch64-unknown-linux-musl-cc"),("__CRANE_EXPORT_CXX_AARCH64_APPLE_DARWIN","c++"),("__CRANE_EXPORT_CXX_AARCH64_UNKNOWN_LINUX_MUSL","aarch64-unknown-linux-musl-c++"),("__CRANE_EXPORT_HOST_AR","ar"),("__CRANE_EXPORT_HOST_CC","cc"),("__CRANE_EXPORT_HOST_CXX","c++"),("__CRANE_EXPORT_TARGET_AR","aarch64-unknown-linux-musl-ar"),("__CRANE_EXPORT_TARGET_CC","aarch64-unknown-linux-musl-cc"),("__CRANE_EXPORT_TARGET_CXX","aarch64-unknown-linux-musl-c++"),("__darwinAllowLocalNetworking",""),("__impureHostDeps","/bin/sh /usr/lib/libSystem.B.dylib /usr/lib/system/libunc.dylib /dev/zero /dev/random /dev/urandom /bin/sh"),("__propagatedImpureHostDeps",""),("__propagatedSandboxProfile",""),("__sandboxProfile",""),("__structuredAttrs",""),("buildInputs",""),("buildPhase","runHook preBuild\ncargo --version\ncargoBuildLog=$(mktemp cargoBuildLogXXXX.json)\ncargoWithProfile build --message-format json-render-diagnostics --locked >\"$cargoBuildLog\"\n\nrunHook postBuild\n"),("builder","/nix/store/qzwsj5ihx6kjwikr0g77dnhcfxm1by68-bash-5.2p37/bin/bash"),("cargoArtifacts","/nix/store/8ihmk89v2l5fgchkwygi2zzv8y4kax55-<REDACTED>-deps-aarch64-unknown-linux-musl-0.36.1"),("cargoVendorDir","/nix/store/v7rih35k5axzdfpkpss05zhd44yd7zy3-vendor-cargo-deps"),("checkPhase","runHook preCheck\ncargoWithProfile test --locked \n\nrunHook postCheck\n"),("cmakeFlags","-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_HOST_SYSTEM_NAME=Darwin -DCMAKE_HOST_SYSTEM_PROCESSOR=aarch64"),("configureFlags","--build=aarch64-apple-darwin --host=aarch64-unknown-linux-musl"),("configurePhase","runHook preConfigure\necho default configurePhase, nothing to do\nrunHook postConfigure\n"),("depsBuildBuild",""),("depsBuildBuildPropagated",""),("depsBuildTarget",""),("depsBuildTargetPropagated",""),("depsHostHost",""),("depsHostHostPropagated",""),("depsTargetTarget",""),("depsTargetTargetPropagated",""),("doCheck",""),("doInstallCargoArtifacts",""),("doInstallCheck",""),("installPhase","runHook preInstall\nif [ -n \"$postBuildInstallFromCargoBuildLogOut\" -a -d \"$postBuildInstallFromCargoBuildLogOut\" ]; then\n echo \"actually installing contents of $postBuildInstallFromCargoBuildLogOut to $out\"\n mkdir -p $out\n find \"$postBuildInstallFromCargoBuildLogOut\" -mindepth 1 -maxdepth 1 | xargs -r mv -t $out\nelse\n echo '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n$postBuildInstallFromCargoBuildLogOut is either undefined or does not point to a\nvalid location! By default `buildPackage` will expect that cargo'\\''s output was\ncaptured and the resulting binaries preinstalled in a temporary location to avoid\ninterference by the check phase.\n\nIf you are defining your own custom build step, you have two options:\n1. override `installPhaseCommand` with the appropriate installation steps\n2. ensure that cargo'\\''s build log is captured in a file and point\n $postBuildInstallFromCargoBuildLogOut at it\n\nAt a minimum, the latter option can be achieved with a build phase that runs:\n cargoBuildLog=$(mktemp cargoBuildLogXXXX.json)\n cargo build --release --message-format json-render-diagnostics >\"$cargoBuildLog\"\n postBuildInstallFromCargoBuildLogOut=$(mktemp -d cargoBuildTempOutXXXX)\n installFromCargoBuildLog \"$postBuildInstallFromCargoBuildLogOut\" \"$cargoBuildLog\"\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n'\n\n false\nfi\n\nrunHook postInstall\n"),("mesonFlags","--cross-file=/nix/store/qa848i01y1iw4i4hhdsa4v4qw00br594-cross-file.conf"),("name","<REDACTED>-aarch64-unknown-linux-musl-0.36.1"),("nativeBuildInputs","/nix/store/yxac2lhw00d1gi6c7kl6dlwnrmddhp23-libiconv-109-dev /nix/store/vpnz8l9qk2q04r72ji6lflg68na95fab-installFromCargoBuildLogHook /nix/store/26qfz98bmiifdybxcjamkmgwbdfnl4f9-removeReferencesToRustToolchainHook /nix/store/m83ky4dy8crdwl8cs3cm0q9h4p917l8f-removeReferencesToVendoredSourcesHook /nix/store/9fbzrya8pqaw0lfhg9q0g3pscy2aw7kz-clang-wrapper-16.0.6 /nix/store/2vj1s2r39dl0rb87lp41sl48pmj98170-aarch64-unknown-linux-musl-gcc-wrapper-13.3.0 /nix/store/zjl03z3r8h3zycp55m41kvlqz28k5had-rust-mixed /nix/store/gh6j5fcjngf9310p41aap7918ngqdy5b-cargoHelperFunctionsHook /nix/store/kf7jf539a0lnn0y6p4w63pfm725pqyfn-configureCargoCommonVarsHook /nix/store/dhhvckqp9y4d6glbbh1fcin03c6q1y75-configureCargoVendoredDepsHook /nix/store/arii4abzhkh6d0g3jaj8y6hww1kz2nx9-inheritCargoArtifactsHook /nix/store/yc1qbivka3h54p288mgwwqbpkrqs802w-installCargoArtifactsHook /nix/store/xx7h7dfvnb5w7hc5wihd69xfs7bq61hc-replaceCargoLockHook /nix/store/7frifb58kqclnd2a5gjarimkcily05q9-rsync-3.4.1 /nix/store/zjl03z3r8h3zycp55m41kvlqz28k5had-rust-mixed /nix/store/m53a8mrkhjdrvsy8jgcs5s7n3gk5x179-zstd-1.5.6-dev"),("out","/nix/store/7ga8np7sn9h8sfgqd2w66f0dbgih3zcz-<REDACTED>-aarch64-unknown-linux-musl-0.36.1"),("outputs","out"),("patches",""),("pname","<REDACTED>"),("propagatedBuildInputs",""),("propagatedNativeBuildInputs",""),("src","/nix/store/i3wg8ia7pwqnm09bh3ky6xdcipbvzdk3-source"),("stdenv","/nix/store/jaqbj4kyf88gp2h5k6984k594nfv4gz4-stdenv-darwin"),("strictDeps","1"),("system","aarch64-darwin"),("version","0.36.1")]) However, when attempting to build I get the error of $ nix build .#package
error: builder for '/nix/store/pmvabpmdk82agba64fl2fp93pc1xydmr-<REDACTED>-deps-aarch64-unknown-linux-musl-0.36.1.drv' failed with exit code 101;
last 25 log lines:
> Checking deranged v0.4.0
> Checking concurrent-queue v2.5.0
> Checking event-listener v5.4.0
> Compiling aws-lc-rs v1.13.0
> error: linking with `cc` failed: exit status: 1
> |
> = note: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET -u XROS_DEPLOYMENT_TARGET LC_ALL="C" PATH="/nix/store/zjl03z3r8h3zycp55m41kvlqz28k5had-rust-mixed/lib/rustlib/aarch64-apple-darwin/bin:/nix/store/csjwwprnp033h6gbqrarifa0f76m61rd-libiconv-109/bin:/nix/store/9fbzrya8pqaw0lfhg9q0g3pscy2aw7kz-clang-wrapper-16.0.6/bin:/nix/store/a3cb7da0k1k4px3r6i0ar3nxr605g5yv-clang-16.0.6/bin:/nix/store/628n22773lxvj5w8pmn0wq9zag7nzd7w-coreutils-9.5/bin:/nix/store/kvx50ndpfcx73w39inrk63fnfi47wqwy-cctools-binutils-darwin-wrapper-1010.6/bin:/nix/store/5lyy560i21kd9flai0g81kwdkh82pr0m-cctools-binutils-darwin-1010.6/bin:/nix/store/2vj1s2r39dl0rb87lp41sl48pmj98170-aarch64-unknown-linux-musl-gcc-wrapper-13.3.0/bin:/nix/store/dwdqz6zcy38mbycl878dg7bkkjigcnfh-aarch64-unknown-linux-musl-gcc-13.3.0/bin:/nix/store/igdkqqq5zzhbqqbcz5jxv1fi3fw0mqah-musl-aarch64-unknown-linux-musl-1.2.5-bin/bin:/nix/store/13jcszfcc8xl1dz6phl36f3vmb7zpyid-coreutils-9.5/bin:/nix/store/6nkq4fljfki89v0mm8wf441w8y2w6say-aarch64-unknown-linux-musl-binutils-wrapper-2.43.1/bin:/nix/store/ivwqfvlzg2iry0lf1ga3bp8wc0nlwrfl-aarch64-unknown-linux-musl-binutils-2.43.1/bin:/nix/store/zjl03z3r8h3zycp55m41kvlqz28k5had-rust-mixed/bin:/nix/store/7frifb58kqclnd2a5gjarimkcily05q9-rsync-3.4.1/bin:/nix/store/w4qfr9w2pxbpz7ksy1y3rl43wiagvcpv-zstd-1.5.6-bin/bin:/nix/store/5g4pw9bc43xbhrdcjv6j4sdi1l9yldrr-zstd-1.5.6/bin:/nix/store/v8zqq0qg2hky6dzawb26ym1rdv5gs512-patchelf-0.15.0/bin:/nix/store/628n22773lxvj5w8pmn0wq9zag7nzd7w-coreutils-9.5/bin:/nix/store/70jvidma235cyw4gg80bz9vlc0d6184d-findutils-4.10.0/bin:/nix/store/gcsymgijgn2lh5d3n9k90gjjps7lcwmj-diffutils-3.10/bin:/nix/store/aqqchdzlk623ic39hcnd8irwgcpl8s2f-gnused-4.9/bin:/nix/store/vk5kab83vjh7ihvygdfbv72w838klc1d-gnugrep-3.11/bin:/nix/store/fsx7qv5fkc4r6bigcpddg88qhh24sp1i-gawk-5.3.1/bin:/nix/store/yy7y4mk7jy6imwfk8fjy9nhh53ihz7s3-gnutar-1.35/bin:/nix/store/4d1h0gzca9992cmx2ivmmjqfwl2432px-gzip-1.13/bin:/nix/store/b23vn7ragh7jwz5i3z3vhn6m00rrkiax-bzip2-1.0.8-bin/bin:/nix/store/60h3w4y3av3ss1bw6hbqivk59f9ydqxl-gnumake-4.4.1/bin:/nix/store/qzwsj5ihx6kjwikr0g77dnhcfxm1by68-bash-5.2p37/bin:/nix/store/g4s3mv5d6sk845kqspcrkp7xkaa9s5j2-patch-2.7.6/bin:/nix/store/x82gz86ymhj9mivikyf77ny9j1ajic7p-xz-5.6.3-bin/bin:/nix/store/pp6kblicnsalm9q3adbm0a51kvsxv9n0-file-5.45/bin" VSLANG="1033" ZERO_AR_DATE="1" "cc" "/private/tmp/nix-build-<REDACTED>-deps-aarch64-unknown-linux-musl-0.36.1.drv-0/rustcDOHGQQ/symbols.o" "<5 object files omitted>" "/private/tmp/nix-build-<REDACTED>-deps-aarch64-unknown-linux-musl-0.36.1.drv-0/source/target/release/deps/{libcc-2055fdd5e3d64d09.rlib,libjobserver-5a5fc4f341d03f3a.rlib,liblibc-b1fda287d7a91569.rlib,libshlex-16a10314ad0b1e79.rlib}" "/nix/store/ird7hdw2zm65s2vmj6sjkd546vzv78ax-rust-stable-2025-03-18/lib/rustlib/aarch64-apple-darwin/lib/{libstd-9a8d4c925c11f507.rlib,libpanic_unwind-864f89af2b80e78c.rlib,libobject-41cb223da1b4bed5.rlib,libmemchr-dfdf7ff940af38f7.rlib,libaddr2line-4a8dfd2690e2969c.rlib,libgimli-ea3151e8f32ae0e2.rlib,librustc_demangle-7d770bf01ba1b6e5.rlib,libstd_detect-ebcf70da46ad6d83.rlib,libhashbrown-aef539cf033a4071.rlib,librustc_std_workspace_alloc-5808e7d6a699cb55.rlib,libminiz_oxide-e213ed6ae6f0cecb.rlib,libadler-31dd64c4c2d6f7b8.rlib,libunwind-667dd716eab04722.rlib,libcfg_if-4be5021d033c1d12.rlib,liblibc-c8bf557a67c1a091.rlib,liballoc-0b46c1dfa44283ca.rlib,librustc_std_workspace_core-b75d392d32c1a8ee.rlib,libcore-9ba39e499d30418c.rlib,libcompiler_builtins-a94b6215175cddb2.rlib}" "-liconv" "-lSystem" "-lc" "-lm" "-arch" "arm64" "-mmacosx-version-min=11.0.0" "-o" "/private/tmp/nix-build-<REDACTED>-deps-aarch64-unknown-linux-musl-0.36.1.drv-0/source/target/release/build/ring-d3b701c6fa20df45/build_script_build-d3b701c6fa20df45" "-Wl,-dead_strip" "-nodefaultlibs"
> = note: some arguments are omitted. use `--verbose` to show all linker arguments
> = note: clang-16: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
> ld: library not found for -liconv
> clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
>
>
> error: could not compile `ring` (build script) due to 1 previous error
> warning: build failed, waiting for other jobs to finish...
> error: linking with `cc` failed: exit status: 1
> |
> = note: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET -u XROS_DEPLOYMENT_TARGET LC_ALL="C" PATH="/nix/store/zjl03z3r8h3zycp55m41kvlqz28k5had-rust-mixed/lib/rustlib/aarch64-apple-darwin/bin:/nix/store/csjwwprnp033h6gbqrarifa0f76m61rd-libiconv-109/bin:/nix/store/9fbzrya8pqaw0lfhg9q0g3pscy2aw7kz-clang-wrapper-16.0.6/bin:/nix/store/a3cb7da0k1k4px3r6i0ar3nxr605g5yv-clang-16.0.6/bin:/nix/store/628n22773lxvj5w8pmn0wq9zag7nzd7w-coreutils-9.5/bin:/nix/store/kvx50ndpfcx73w39inrk63fnfi47wqwy-cctools-binutils-darwin-wrapper-1010.6/bin:/nix/store/5lyy560i21kd9flai0g81kwdkh82pr0m-cctools-binutils-darwin-1010.6/bin:/nix/store/2vj1s2r39dl0rb87lp41sl48pmj98170-aarch64-unknown-linux-musl-gcc-wrapper-13.3.0/bin:/nix/store/dwdqz6zcy38mbycl878dg7bkkjigcnfh-aarch64-unknown-linux-musl-gcc-13.3.0/bin:/nix/store/igdkqqq5zzhbqqbcz5jxv1fi3fw0mqah-musl-aarch64-unknown-linux-musl-1.2.5-bin/bin:/nix/store/13jcszfcc8xl1dz6phl36f3vmb7zpyid-coreutils-9.5/bin:/nix/store/6nkq4fljfki89v0mm8wf441w8y2w6say-aarch64-unknown-linux-musl-binutils-wrapper-2.43.1/bin:/nix/store/ivwqfvlzg2iry0lf1ga3bp8wc0nlwrfl-aarch64-unknown-linux-musl-binutils-2.43.1/bin:/nix/store/zjl03z3r8h3zycp55m41kvlqz28k5had-rust-mixed/bin:/nix/store/7frifb58kqclnd2a5gjarimkcily05q9-rsync-3.4.1/bin:/nix/store/w4qfr9w2pxbpz7ksy1y3rl43wiagvcpv-zstd-1.5.6-bin/bin:/nix/store/5g4pw9bc43xbhrdcjv6j4sdi1l9yldrr-zstd-1.5.6/bin:/nix/store/v8zqq0qg2hky6dzawb26ym1rdv5gs512-patchelf-0.15.0/bin:/nix/store/628n22773lxvj5w8pmn0wq9zag7nzd7w-coreutils-9.5/bin:/nix/store/70jvidma235cyw4gg80bz9vlc0d6184d-findutils-4.10.0/bin:/nix/store/gcsymgijgn2lh5d3n9k90gjjps7lcwmj-diffutils-3.10/bin:/nix/store/aqqchdzlk623ic39hcnd8irwgcpl8s2f-gnused-4.9/bin:/nix/store/vk5kab83vjh7ihvygdfbv72w838klc1d-gnugrep-3.11/bin:/nix/store/fsx7qv5fkc4r6bigcpddg88qhh24sp1i-gawk-5.3.1/bin:/nix/store/yy7y4mk7jy6imwfk8fjy9nhh53ihz7s3-gnutar-1.35/bin:/nix/store/4d1h0gzca9992cmx2ivmmjqfwl2432px-gzip-1.13/bin:/nix/store/b23vn7ragh7jwz5i3z3vhn6m00rrkiax-bzip2-1.0.8-bin/bin:/nix/store/60h3w4y3av3ss1bw6hbqivk59f9ydqxl-gnumake-4.4.1/bin:/nix/store/qzwsj5ihx6kjwikr0g77dnhcfxm1by68-bash-5.2p37/bin:/nix/store/g4s3mv5d6sk845kqspcrkp7xkaa9s5j2-patch-2.7.6/bin:/nix/store/x82gz86ymhj9mivikyf77ny9j1ajic7p-xz-5.6.3-bin/bin:/nix/store/pp6kblicnsalm9q3adbm0a51kvsxv9n0-file-5.45/bin" VSLANG="1033" ZERO_AR_DATE="1" "cc" "/private/tmp/nix-build-<REDACTED>-deps-aarch64-unknown-linux-musl-0.36.1.drv-0/rustc4SuA59/symbols.o" "<6 object files omitted>" "/private/tmp/nix-build-<REDACTED>-deps-aarch64-unknown-linux-musl-0.36.1.drv-0/source/target/release/deps/{libfs_extra-502e5a53f1648bba.rlib,libdunce-770f9b9482119578.rlib,libcmake-6630aabf95d0f2c2.rlib,libcc-2055fdd5e3d64d09.rlib,libjobserver-5a5fc4f341d03f3a.rlib,liblibc-b1fda287d7a91569.rlib,libshlex-16a10314ad0b1e79.rlib}" "/nix/store/ird7hdw2zm65s2vmj6sjkd546vzv78ax-rust-stable-2025-03-18/lib/rustlib/aarch64-apple-darwin/lib/{libstd-9a8d4c925c11f507.rlib,libpanic_unwind-864f89af2b80e78c.rlib,libobject-41cb223da1b4bed5.rlib,libmemchr-dfdf7ff940af38f7.rlib,libaddr2line-4a8dfd2690e2969c.rlib,libgimli-ea3151e8f32ae0e2.rlib,librustc_demangle-7d770bf01ba1b6e5.rlib,libstd_detect-ebcf70da46ad6d83.rlib,libhashbrown-aef539cf033a4071.rlib,librustc_std_workspace_alloc-5808e7d6a699cb55.rlib,libminiz_oxide-e213ed6ae6f0cecb.rlib,libadler-31dd64c4c2d6f7b8.rlib,libunwind-667dd716eab04722.rlib,libcfg_if-4be5021d033c1d12.rlib,liblibc-c8bf557a67c1a091.rlib,liballoc-0b46c1dfa44283ca.rlib,librustc_std_workspace_core-b75d392d32c1a8ee.rlib,libcore-9ba39e499d30418c.rlib,libcompiler_builtins-a94b6215175cddb2.rlib}" "-liconv" "-lSystem" "-lc" "-lm" "-arch" "arm64" "-mmacosx-version-min=11.0.0" "-o" "/private/tmp/nix-build-<REDACTED>-deps-aarch64-unknown-linux-musl-0.36.1.drv-0/source/target/release/build/aws-lc-sys-67c41b1bd876175d/build_script_main-67c41b1bd876175d" "-Wl,-dead_strip" "-nodefaultlibs"
> = note: some arguments are omitted. use `--verbose` to show all linker arguments
> = note: clang-16: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
> ld: library not found for -liconv
> clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
>
>
> error: could not compile `aws-lc-sys` (build script) due to 1 previous error
For full logs, run:
nix log /nix/store/pmvabpmdk82agba64fl2fp93pc1xydmr-<REDACTED>-deps-aarch64-unknown-linux-musl-0.36.1.drv
error: 1 dependencies of derivation '/nix/store/wb0bwmv5b65i17ijcy51hnnifnrsipwn-<REDACTED>-aarch64-unknown-linux-musl-0.36.1.drv' failed to build I don't know why the Could I get some advice? Thank you very much! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello! Without a full reproduction the best I can do is speculate but this part of the config looks a bit suspect to me: craneLib = (inputs.crane.mkLib pkgs).overrideToolchain (
_:
with inputs.fenix.packages.${system};
combine [
stable.toolchain
targets.${target}.stable.rust-std
]
); Normally I don't use Hope this helps! |
Beta Was this translation helpful? Give feedback.
Hello!
Without a full reproduction the best I can do is speculate but this part of the config looks a bit suspect to me:
Normally
.overrideToolchain
calls the provided function with differentpkg
instances configured for cross compilation, and usually when usingrust-overlay
that results in picking the correctly configured compilers for things, but your config is ignoring that input entirely and always using whatever (likely, non-cross-compilation-enabled) derivations t…