ipetkov / crane

A Nix library for building cargo projects. Never build twice thanks to incremental artifact caching.
https://crane.dev
MIT License
920 stars 86 forks source link

synology nas's unknown linux.. proc-macro2 build failed #524

Closed PlumpMath closed 6 months ago

PlumpMath commented 8 months ago

Hello.

  1. OS & Hardware : Linux synology 4.4.302+ #69057 SMP Fri Jan 12 17:02:59 CST 2024 x86_64 GNU/Linux synology_apollolake_620slim

  2. OS & Hardware : Linux synology 4.4.302+ #69057 SMP Fri Jan 12 17:01:55 CST 2024 aarch64 GNU/Linux synology_rtd1296_ds418

This is just a hobby of mine, but I am currently testing Nix on a NAS platform. Later on, I want to install Nix on an Android smartphone and try building Crane Rust. It seems like the error might be because proc-macro2 is not built for unknown Linux. Is there any way to solve this? On a related note, I am interested in writing a cache server for Rust Crane for cross-building on other systems. What alternatives or methods should I look into? Would reading the entire Crane manual provide an answer to that?

Thanks! ipetkov.

@nix { "action": "setPhase", "phase": "unpackPhase" } Running phase: unpackPhase unpacking source archive /nix/store/xyiprvkkzy9xsh7l5xha1vxzy7h6hck1-source source root is source Executing cargoSetupPostUnpackHook unpacking source archive /nix/store/yzsgan8d482f2qj8q7ip7nxy1szbnp4s-crane-utils-0.0.1-vendor.tar.gz Finished cargoSetupPostUnpackHook @nix { "action": "setPhase", "phase": "patchPhase" } Running phase: patchPhase Executing cargoSetupPostPatchHook Validating consistency between /tmp/nix-build-crane-utils-0.0.1.drv-0/source/Cargo.lock and /tmp/nix-build-crane-utils-0.0.1.drv-0/crane-utils-0.0.1-vendor.tar.gz/Cargo.lock Finished cargoSetupPostPatchHook @nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" } Running phase: updateAutotoolsGnuConfigScriptsPhase @nix { "action": "setPhase", "phase": "configurePhase" } Running phase: configurePhase @nix { "action": "setPhase", "phase": "buildPhase" } Running phase: buildPhase Executing cargoBuildHook ++ env CC_X86_64_UNKNOWN_LINUX_GNU=/nix/store/4cjqvbp1jbkps185wl8qnbjpf8bdy8j9-gcc-wrapper-13.2.0/bin/cc CXX_X86_64_UNKNOWN_LINUX_GNU=/nix/store/4cjqvbp1jbkps185wl8qnbjpf8bdy8j9-gcc-wrapper-13.2.0/bin/c++ CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/nix/store/4cjqvbp1jbkps185wl8qnbjpf8bdy8j9-gcc-wrapper-13.2.0/bin/cc CC_X86_64_UNKNOWN_LINUX_GNU=/nix/store/4cjqvbp1jbkps185wl8qnbjpf8bdy8j9-gcc-wrapper-13.2.0/bin/cc CXX_X86_64_UNKNOWN_LINUX_GNU=/nix/store/4cjqvbp1jbkps185wl8qnbjpf8bdy8j9-gcc-wrapper-13.2.0/bin/c++ CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=/nix/store/4cjqvbp1jbkps185wl8qnbjpf8bdy8j9-gcc-wrapper-13.2.0/bin/cc CARGO_BUILD_TARGET=x86_64-unknown-linux-gnu HOST_CC=/nix/store/4cjqvbp1jbkps185wl8qnbjpf8bdy8j9-gcc-wrapper-13.2.0/bin/cc HOST_CXX=/nix/store/4cjqvbp1jbkps185wl8qnbjpf8bdy8j9-gcc-wrapper-13.2.0/bin/c++ cargo build -j 1 --target x86_64-unknown-linux-gnu --frozen --profile release Compiling proc-macro2 v1.0.78 error: failed to run custom build command for proc-macro2 v1.0.78

Caused by: could not execute process /tmp/nix-build-crane-utils-0.0.1.drv-0/source/target/release/build/proc-macro2-c67fd9908d0db7e7/build-script-build (never executed)

Caused by: Permission denied (os error 13)

ipetkov commented 8 months ago

Executing cargoBuildHook

Are you building with crane or using the upstream rustPlatform.buildPackage? cargoBuildHook comes from the latter, but I can't say more without looking at the configuration for this build!