nixpkgs/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 rust/hooks: ensure the build output ends up in the right place 2021-12-26 11:04:07 +03:00
cargo-check-hook.sh rustPlatform: add support for features 2021-10-27 08:08:03 -04:00
cargo-install-hook.sh cargo/hooks: allow hooks to be disabled 2021-03-08 19:17:03 +01:00
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 maturin: 0.12.9 -> 0.13.0 2022-07-21 22:35:32 +02:00
rust-bindgen-hook.sh rustPlatform.bindgenHook: init 2022-02-22 19:37:07 +01:00