Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
105 lines
3.0 KiB
Nix
105 lines
3.0 KiB
Nix
{
|
|
rustPlatform,
|
|
stdenv,
|
|
cargo,
|
|
}:
|
|
{
|
|
/*
|
|
test each hook individually, to make sure that:
|
|
- each hook works properly outside of buildRustPackage
|
|
- each hook is usable independently from each other
|
|
*/
|
|
cargoSetupHook = stdenv.mkDerivation {
|
|
name = "test-cargoSetupHook";
|
|
src = ./example-rust-project;
|
|
cargoVendorDir = "hello";
|
|
nativeBuildInputs = [
|
|
rustPlatform.cargoSetupHook
|
|
cargo
|
|
];
|
|
buildPhase = ''
|
|
cargo build --profile release --target ${stdenv.hostPlatform.rust.rustcTarget}
|
|
'';
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
mv target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/hello $out/bin/
|
|
'';
|
|
};
|
|
|
|
cargoBuildHook = stdenv.mkDerivation {
|
|
name = "test-cargoBuildHook";
|
|
src = ./example-rust-project;
|
|
cargoBuildType = "release";
|
|
"CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_LINKER" =
|
|
"${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
|
|
nativeBuildInputs = [
|
|
rustPlatform.cargoBuildHook
|
|
cargo
|
|
];
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
mv target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/hello $out/bin/
|
|
'';
|
|
};
|
|
|
|
cargoInstallHook = stdenv.mkDerivation {
|
|
name = "test-cargoInstallHook";
|
|
src = ./example-rust-project;
|
|
cargoBuildType = "release";
|
|
"CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_LINKER" =
|
|
"${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
|
|
nativeBuildInputs = [
|
|
rustPlatform.cargoInstallHook
|
|
cargo
|
|
];
|
|
buildPhase = ''
|
|
cargo build --profile release --target ${stdenv.hostPlatform.rust.rustcTarget}
|
|
runHook postBuild
|
|
'';
|
|
};
|
|
|
|
cargoCheckHook = stdenv.mkDerivation {
|
|
name = "test-cargoCheckHook";
|
|
src = ./example-rust-project;
|
|
cargoBuildType = "release";
|
|
"CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_LINKER" =
|
|
"${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
|
|
nativeBuildInputs = [
|
|
rustPlatform.cargoCheckHook
|
|
cargo
|
|
];
|
|
buildPhase = ''
|
|
cargo build --profile release --target ${stdenv.hostPlatform.rust.rustcTarget}
|
|
runHook postBuild
|
|
'';
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
mv target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/hello $out/bin/
|
|
'';
|
|
cargoCheckType = "release";
|
|
doCheck = true;
|
|
};
|
|
|
|
cargoNextestHook = stdenv.mkDerivation {
|
|
name = "test-cargoNextestHook";
|
|
src = ./example-rust-project;
|
|
cargoBuildType = "release";
|
|
"CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_LINKER" =
|
|
"${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
|
|
nativeBuildInputs = [
|
|
rustPlatform.cargoNextestHook
|
|
cargo
|
|
];
|
|
buildPhase = ''
|
|
cargo build --profile release --target ${stdenv.hostPlatform.rust.rustcTarget}
|
|
runHook postBuild
|
|
'';
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
mv target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/hello $out/bin/
|
|
'';
|
|
cargoCheckType = "release";
|
|
doCheck = true;
|
|
};
|
|
}
|