nixpkgs-suyu/pkgs/build-support/rust/hooks
Ivar Scholten 987d32bbac buildRustPackage: dont rely on NIX_BUILD_TOP in cargoSetupPostPatchHook
This breaks the builder when a nix-shell or keepBuildTree is used. The
issue occurs because paths to cargo lockfiles are read with NIX_BUILD_TOP,
which is not reliable.

This breaks a nix-shell because NIX_BUILD_TOP simply is not set, causing
an invalid path to be used. This can be worked around using
NIX_BUILD_TOP=$PWD, but that obviously is not great.

This breaks keepBuildTree because it changes the working directory to a
different path than NIX_BUILD_TOP. Since the lockfiles are copied based
on the working directory, but read based on NIX_BUILD_TOP, this causes
the hook to not be able to find them.

This was solved by both reading these files based on the working directory,
using absolute paths to avoid having to traverse back in the directory tree.

Fixes: #138554
2022-09-25 16:17:36 +02:00
..
cargo-build-hook.sh
cargo-check-hook.sh
cargo-install-hook.sh
cargo-setup-hook.sh buildRustPackage: dont rely on NIX_BUILD_TOP in cargoSetupPostPatchHook 2022-09-25 16:17:36 +02:00
default.nix cargoSetupHook: set crt-static 2022-08-13 15:25:41 +02:00
maturin-build-hook.sh
rust-bindgen-hook.sh