treewide: fix mismatched runHook invocations in Phase (#428951)

This commit is contained in:
Aleksana
2025-08-01 17:07:28 +08:00
committed by GitHub
21 changed files with 55 additions and 37 deletions

View File

@@ -162,11 +162,11 @@ let
patches = [ ../patches/kotlinc-path.patch ]; patches = [ ../patches/kotlinc-path.patch ];
postPatch = "sed -i 's|KOTLIN_PATH_HERE|${kotlin'}|' src/main/java/org/jetbrains/jpsBootstrap/KotlinCompiler.kt"; postPatch = "sed -i 's|KOTLIN_PATH_HERE|${kotlin'}|' src/main/java/org/jetbrains/jpsBootstrap/KotlinCompiler.kt";
buildPhase = '' buildPhase = ''
runHook preInstall runHook preBuild
ant -Duser.home=${jpsRepo} -Dbuild.dir=/build/out -f jps-bootstrap-classpath.xml ant -Duser.home=${jpsRepo} -Dbuild.dir=/build/out -f jps-bootstrap-classpath.xml
runHook postInstall runHook postBuild
''; '';
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall

View File

@@ -42,7 +42,7 @@ let
doInstallCheck = true; doInstallCheck = true;
installCheckPhase = '' installCheckPhase = ''
runHook preCheck runHook preInstallCheck
# Smoke check: run a test notebook using Papermill by creating a simple kernelspec # Smoke check: run a test notebook using Papermill by creating a simple kernelspec
mkdir -p kernels/cpp17 mkdir -p kernels/cpp17
@@ -61,7 +61,7 @@ let
exit 1 exit 1
fi fi
runHook postCheck runHook postInstallCheck
''; '';
passthru = (oldAttrs.passthru or { }) // { passthru = (oldAttrs.passthru or { }) // {

View File

@@ -57,11 +57,11 @@ stdenv.mkDerivation rec {
''; '';
installPhase = '' installPhase = ''
runHook preBuild runHook preInstall
./build install x ./build install x
runHook postBuild runHook postInstall
''; '';
meta = with lib; { meta = with lib; {

View File

@@ -25,9 +25,11 @@ stdenv.mkDerivation (finalAttrs: {
doInstallCheck = true; doInstallCheck = true;
installCheckPhase = '' checkPhase = ''
runHook preCheck runHook preCheck
make test make test
runHook postCheck runHook postCheck
''; '';

View File

@@ -15,12 +15,12 @@ stdenvNoCC.mkDerivation (finalAttrs: {
dontUnpack = true; dontUnpack = true;
installPhase = '' installPhase = ''
runHook preBuild runHook preInstall
gzip -c -d "$src" > dbip-city-lite.mmdb gzip -c -d "$src" > dbip-city-lite.mmdb
install -Dm444 dbip-city-lite.mmdb "$out/share/dbip/dbip-city-lite.mmdb" install -Dm444 dbip-city-lite.mmdb "$out/share/dbip/dbip-city-lite.mmdb"
runHook postBuild runHook postInstall
''; '';
passthru.mmdb = "${finalAttrs.finalPackage}/share/dbip/dbip-city-lite.mmdb"; passthru.mmdb = "${finalAttrs.finalPackage}/share/dbip/dbip-city-lite.mmdb";

View File

@@ -15,12 +15,12 @@ stdenvNoCC.mkDerivation (finalAttrs: {
dontUnpack = true; dontUnpack = true;
installPhase = '' installPhase = ''
runHook preBuild runHook preInstall
gzip -c -d "$src" > dbip-country-lite.mmdb gzip -c -d "$src" > dbip-country-lite.mmdb
install -Dm444 dbip-country-lite.mmdb "$out/share/dbip/dbip-country-lite.mmdb" install -Dm444 dbip-country-lite.mmdb "$out/share/dbip/dbip-country-lite.mmdb"
runHook postBuild runHook postInstall
''; '';
passthru.mmdb = "${finalAttrs.finalPackage}/share/dbip/dbip-country-lite.mmdb"; passthru.mmdb = "${finalAttrs.finalPackage}/share/dbip/dbip-country-lite.mmdb";

View File

@@ -30,12 +30,12 @@ stdenv.mkDerivation rec {
]; ];
installPhase = '' installPhase = ''
runHook preBuild runHook preInstall
install -Dm555 dhcpdump "$out/bin/dhcpdump" install -Dm555 dhcpdump "$out/bin/dhcpdump"
installManPage dhcpdump.8 installManPage dhcpdump.8
runHook postBuild runHook postInstall
''; '';
meta = { meta = {

View File

@@ -36,9 +36,11 @@ stdenvNoCC.mkDerivation rec {
doInstallCheck = true; doInstallCheck = true;
installCheckPhase = '' installCheckPhase = ''
runHook preCheck runHook preInstallCheck
$out/bin/discord.sh --help $out/bin/discord.sh --help
runHook postCheck
runHook postInstallCheck
''; '';
installPhase = '' installPhase = ''

View File

@@ -93,11 +93,11 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: {
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isAarch64 "-flax-vector-conversions"; env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isAarch64 "-flax-vector-conversions";
installCheckPhase = '' installCheckPhase = ''
runHook preCheck runHook preInstallCheck
$out/share/duckstation/common-tests $out/share/duckstation/common-tests
runHook postCheck runHook postInstallCheck
''; '';
installPhase = '' installPhase = ''

View File

@@ -36,7 +36,7 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
installPhase = '' installPhase = ''
runHook preInstallPhase runHook preInstall
mkdir -p $out/share/icons/hicolor/512x512/apps/ mkdir -p $out/share/icons/hicolor/512x512/apps/
ln -s ${finalAttrs.src}/io.edcd.EDMarketConnector.png $out/share/icons/hicolor/512x512/apps/io.edcd.EDMarketConnector.png ln -s ${finalAttrs.src}/io.edcd.EDMarketConnector.png $out/share/icons/hicolor/512x512/apps/io.edcd.EDMarketConnector.png
@@ -47,7 +47,7 @@ stdenv.mkDerivation (finalAttrs: {
makeWrapper ${pythonEnv}/bin/python $out/bin/edmarketconnector \ makeWrapper ${pythonEnv}/bin/python $out/bin/edmarketconnector \
--add-flags "${finalAttrs.src}/EDMarketConnector.py $@" --add-flags "${finalAttrs.src}/EDMarketConnector.py $@"
runHook postInstallPhase runHook postInstall
''; '';
meta = { meta = {

View File

@@ -34,10 +34,10 @@ stdenv.mkDerivation {
]; ];
installPhase = '' installPhase = ''
runHook preBuild runHook preInstall
mkdir -p $out/bin mkdir -p $out/bin
install hello-wayland $out/bin install hello-wayland $out/bin
runHook postBuild runHook postInstall
''; '';
passthru.updateScript = unstableGitUpdater { }; passthru.updateScript = unstableGitUpdater { };

View File

@@ -32,7 +32,7 @@ stdenv.mkDerivation {
checkPhase = '' checkPhase = ''
runHook preCheck runHook preCheck
./checktests ./checktests
runHook postChck runHook postCheck
''; '';
doCheck = false; # hasdescriptor.c test fails, hrm. doCheck = false; # hasdescriptor.c test fails, hrm.

View File

@@ -46,13 +46,13 @@ stdenv.mkDerivation {
]; ];
buildPhase = '' buildPhase = ''
runHook preConfigure runHook preBuild
for f in SuiteSparse_config Mongoose; do for f in SuiteSparse_config Mongoose; do
(cd $f && cmakeConfigurePhase && make -j$NIX_BUILD_CORES) (cd $f && cmakeConfigurePhase && make -j$NIX_BUILD_CORES)
done done
runHook postConfigure runHook postBuild
''; '';
installPhase = '' installPhase = ''

View File

@@ -56,13 +56,13 @@ let
''; '';
installPhase = '' installPhase = ''
runHook preInstallPhase runHook preInstall
mkdir -p $out/{Applications,bin} mkdir -p $out/{Applications,bin}
mv Quiet.app $out/Applications mv Quiet.app $out/Applications
makeWrapper $out/Applications/Quiet.app/Contents/MacOS/Quiet $out/bin/${pname} makeWrapper $out/Applications/Quiet.app/Contents/MacOS/Quiet $out/bin/${pname}
runHook postInstallPhase runHook postInstall
''; '';
meta = meta // { meta = meta // {

View File

@@ -41,7 +41,7 @@ stdenv.mkDerivation {
''; '';
installPhase = '' installPhase = ''
runHook preBuild runHook preInstall
mkdir -p $out/bin $out/resources mkdir -p $out/bin $out/resources
find . -type f -executable -exec cp {} $out/bin \; find . -type f -executable -exec cp {} $out/bin \;
for d in *; do for d in *; do
@@ -49,7 +49,7 @@ stdenv.mkDerivation {
cp -ar "$d/src/resources" "$out/resources/$d" cp -ar "$d/src/resources" "$out/resources/$d"
fi fi
done done
runHook postBuild runHook postInstall
''; '';
meta = with lib; { meta = with lib; {

View File

@@ -72,11 +72,11 @@ stdenv.mkDerivation (finalAttrs: {
dontUseCmakeConfigure = true; dontUseCmakeConfigure = true;
buildPhase = '' buildPhase = ''
runHook preInstall runHook preBuild
sh build.sh sh build.sh
runHook postInstall runHook postBuild
''; '';
installPhase = '' installPhase = ''

View File

@@ -31,7 +31,7 @@ stdenv.mkDerivation (finalAttrs: {
]; ];
patchPhase = '' patchPhase = ''
runHook preHook runHook prePatch
substituteInPlace ./custom_video_xrandr.cpp \ substituteInPlace ./custom_video_xrandr.cpp \
--replace-fail libX11.so ${xorg.libX11}/lib/libX11.so \ --replace-fail libX11.so ${xorg.libX11}/lib/libX11.so \
@@ -40,7 +40,7 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace ./custom_video_drmkms.cpp \ substituteInPlace ./custom_video_drmkms.cpp \
--replace-fail libdrm.so ${libdrm}/lib/libdrm.so \ --replace-fail libdrm.so ${libdrm}/lib/libdrm.so \
runHook postHook runHook postPatch
''; '';
env = { env = {

View File

@@ -153,7 +153,8 @@ stdenv.mkDerivation (finalAttrs: {
"io.sockets.secure.unix" "io.sockets.secure.unix"
]; ];
installCheckPhase = '' installCheckPhase = ''
runHook preCheck runHook preInstallCheck
export HOME=$TMPDIR export HOME=$TMPDIR
$out/bin/factor -e='USING: tools.test tools.test.private $out/bin/factor -e='USING: tools.test tools.test.private
zealot.factor sequences namespaces formatting ; zealot.factor sequences namespaces formatting ;
@@ -162,7 +163,8 @@ stdenv.mkDerivation (finalAttrs: {
"compiler" suffix "compiler" suffix
[ test-vocab ] each :test-failures [ test-vocab ] each :test-failures
test-failures get length "Number of failed tests: %d\n" printf' test-failures get length "Number of failed tests: %d\n" printf'
runHook postCheck
runHook postInstallCheck
''; '';
passthru = { passthru = {

View File

@@ -699,12 +699,16 @@ stdenv.mkDerivation rec {
installShellCompletion --fish \ installShellCompletion --fish \
--name bazel.fish \ --name bazel.fish \
./bazel_src/output/bazel-complete.fish ./bazel_src/output/bazel-complete.fish
runHook postInstall
''; '';
# Install check fails on `aarch64-darwin` # Install check fails on `aarch64-darwin`
# https://github.com/NixOS/nixpkgs/issues/145587 # https://github.com/NixOS/nixpkgs/issues/145587
doInstallCheck = stdenv.hostPlatform.system != "aarch64-darwin"; doInstallCheck = stdenv.hostPlatform.system != "aarch64-darwin";
installCheckPhase = '' installCheckPhase = ''
runHook preInstallCheck
export TEST_TMPDIR=$(pwd) export TEST_TMPDIR=$(pwd)
hello_test () { hello_test () {
@@ -737,7 +741,7 @@ stdenv.mkDerivation rec {
# second call succeeds because it defers to $out/bin/bazel-{version}-{os_arch} # second call succeeds because it defers to $out/bin/bazel-{version}-{os_arch}
hello_test hello_test
runHook postInstall runHook postInstallCheck
''; '';
# Save paths to hardcoded dependencies so Nix can detect them. # Save paths to hardcoded dependencies so Nix can detect them.

View File

@@ -779,12 +779,16 @@ stdenv.mkDerivation rec {
installShellCompletion --fish \ installShellCompletion --fish \
--name bazel.fish \ --name bazel.fish \
./bazel_src/output/bazel-complete.fish ./bazel_src/output/bazel-complete.fish
runHook postInstall
''; '';
# Install check fails on `aarch64-darwin` # Install check fails on `aarch64-darwin`
# https://github.com/NixOS/nixpkgs/issues/145587 # https://github.com/NixOS/nixpkgs/issues/145587
doInstallCheck = stdenv.hostPlatform.system != "aarch64-darwin"; doInstallCheck = stdenv.hostPlatform.system != "aarch64-darwin";
installCheckPhase = '' installCheckPhase = ''
runHook preInstallCheck
export TEST_TMPDIR=$(pwd) export TEST_TMPDIR=$(pwd)
hello_test () { hello_test () {
@@ -829,7 +833,7 @@ stdenv.mkDerivation rec {
exit 1 exit 1
fi fi
runHook postInstall runHook postInstallCheck
''; '';
# Save paths to hardcoded dependencies so Nix can detect them. # Save paths to hardcoded dependencies so Nix can detect them.

View File

@@ -635,9 +635,13 @@ stdenv.mkDerivation rec {
installShellCompletion --fish \ installShellCompletion --fish \
--name bazel.fish \ --name bazel.fish \
./bazel_src/output/bazel-complete.fish ./bazel_src/output/bazel-complete.fish
runHook postInstall
''; '';
installCheckPhase = '' installCheckPhase = ''
runHook preInstallCheck
export TEST_TMPDIR=$(pwd) export TEST_TMPDIR=$(pwd)
hello_test () { hello_test () {
@@ -683,7 +687,7 @@ stdenv.mkDerivation rec {
exit 1 exit 1
fi fi
runHook postInstall runHook postInstallCheck
''; '';
# Save paths to hardcoded dependencies so Nix can detect them. # Save paths to hardcoded dependencies so Nix can detect them.