treewide: use stdenv.buildPlatform.canExecute (#350195)

This commit is contained in:
Philip Taron 2024-10-23 13:05:50 -07:00 committed by GitHub
commit 4dbb808a7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
23 changed files with 23 additions and 23 deletions

View File

@ -116,7 +116,7 @@ buildPythonApplication rec {
]; ];
# check phase uses the output bin, which is not possible when cross-compiling # check phase uses the output bin, which is not possible when cross-compiling
doCheck = stdenv.buildPlatform == stdenv.hostPlatform; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
checkPhase = '' checkPhase = ''
runHook preCheck runHook preCheck

View File

@ -29,7 +29,7 @@ buildGoModule rec {
doCheck = false; # requires docker, container-diff (unpackaged yet) doCheck = false; # requires docker, container-diff (unpackaged yet)
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
for shell in bash fish zsh; do for shell in bash fish zsh; do
$out/bin/executor completion $shell > executor.$shell $out/bin/executor completion $shell > executor.$shell
installShellCompletion executor.$shell installShellCompletion executor.$shell

View File

@ -29,7 +29,7 @@ buildGoModule rec {
''; '';
doCheck = true; doCheck = true;
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd kubeshark \ installShellCompletion --cmd kubeshark \
--bash <($out/bin/kubeshark completion bash) \ --bash <($out/bin/kubeshark completion bash) \
--fish <($out/bin/kubeshark completion fish) \ --fish <($out/bin/kubeshark completion fish) \

View File

@ -40,7 +40,7 @@ buildGoModule rec {
''; '';
nativeBuildInputs = [ installShellFiles ]; nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd vela \ installShellCompletion --cmd vela \
--bash <($out/bin/vela completion bash) \ --bash <($out/bin/vela completion bash) \
--zsh <($out/bin/vela completion zsh) --zsh <($out/bin/vela completion zsh)

View File

@ -117,7 +117,7 @@ let
--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0" --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
''; '';
doInstallCheck = stdenv.hostPlatform == stdenv.buildPlatform; doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
# In particular, this detects missing python imports in some of the tools. # In particular, this detects missing python imports in some of the tools.
postFixup = let postFixup = let
# TODO: python is a script, so it doesn't work as interpreter on darwin # TODO: python is a script, so it doesn't work as interpreter on darwin

View File

@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
"-DENABLE_TESTS=${if doCheck then "ON" else "OFF"}" "-DENABLE_TESTS=${if doCheck then "ON" else "OFF"}"
]; ];
doCheck = stdenv.hostPlatform == stdenv.buildPlatform; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
nativeCheckInputs = [ check ]; nativeCheckInputs = [ check ];
meta = with lib; { meta = with lib; {

View File

@ -59,7 +59,7 @@ stdenv.mkDerivation rec {
"kmymoney/plugins/woob/interface/kmymoneywoob.py" "kmymoney/plugins/woob/interface/kmymoneywoob.py"
''; '';
doInstallCheck = stdenv.hostPlatform == stdenv.buildPlatform; doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
nativeInstallCheckInputs = [ xvfb-run ]; nativeInstallCheckInputs = [ xvfb-run ];
installCheckPhase = installCheckPhase =
lib.optionalString doInstallCheck '' lib.optionalString doInstallCheck ''

View File

@ -36,7 +36,7 @@ stdenv.mkDerivation (finalAttrs: {
enableParallelBuilding = true; enableParallelBuilding = true;
doCheck = stdenv.hostPlatform == stdenv.buildPlatform; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
configureFlags = configureFlags =
lib.optional (!withInternalSqlite) "--disable-internal-sqlite" lib.optional (!withInternalSqlite) "--disable-internal-sqlite"

View File

@ -54,7 +54,7 @@ stdenv.mkDerivation (finalAttrs: {
enableParallelBuilding = true; enableParallelBuilding = true;
# override this to false if you don't want to build python3 # override this to false if you don't want to build python3
doCheck = stdenv.hostPlatform == stdenv.buildPlatform; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
# prevent the `install-data-local` Makefile rule from running; # prevent the `install-data-local` Makefile rule from running;
# all it does is attempt to `mkdir` the `localstatedir`. # all it does is attempt to `mkdir` the `localstatedir`.

View File

@ -28,7 +28,7 @@ buildGo123Module rec {
nativeBuildInputs = [ installShellFiles ]; nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
make manpage make manpage
installManPage share/man/man1/* installManPage share/man/man1/*
installShellCompletion --cmd glab \ installShellCompletion --cmd glab \

View File

@ -26,7 +26,7 @@ buildGoModule rec {
nativeBuildInputs = [ installShellFiles ]; nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
# Mangal creates a config file in the folder ~/.config/mangal and fails if not possible # Mangal creates a config file in the folder ~/.config/mangal and fails if not possible
export HOME=$(mktemp -d) export HOME=$(mktemp -d)
installShellCompletion --cmd mangal \ installShellCompletion --cmd mangal \

View File

@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
makeFlags = [ "AR:=$(AR)" ]; makeFlags = [ "AR:=$(AR)" ];
doCheck = stdenv.hostPlatform == stdenv.buildPlatform; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
outputs = [ outputs = [
"out" "out"

View File

@ -31,7 +31,7 @@ buildGoModule rec {
''; '';
nativeBuildInputs = [ installShellFiles ]; nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
$out/bin/velero completion bash > velero.bash $out/bin/velero completion bash > velero.bash
$out/bin/velero completion zsh > velero.zsh $out/bin/velero completion zsh > velero.zsh
installShellCompletion velero.{bash,zsh} installShellCompletion velero.{bash,zsh}

View File

@ -115,7 +115,7 @@ in stdenv.mkDerivation {
buildFlags = [ "all" "selftest" ]; buildFlags = [ "all" "selftest" ];
doCheck = stdenv.hostPlatform == stdenv.buildPlatform; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
checkPhase = '' checkPhase = ''
runHook preCheck runHook preCheck
./zerotier-selftest ./zerotier-selftest

View File

@ -29,7 +29,7 @@ stdenv.mkDerivation {
]; ];
# installCheck instead of check due to -install_name'd library on Darwin # installCheck instead of check due to -install_name'd library on Darwin
doInstallCheck = stdenv.buildPlatform == stdenv.hostPlatform; doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
installCheckTarget = "check"; installCheckTarget = "check";
meta = with lib; { meta = with lib; {

View File

@ -840,7 +840,7 @@ stdenv.mkDerivation (finalAttrs: {
]; ];
}; };
doCheck = stdenv.hostPlatform == stdenv.buildPlatform; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
# Fails with SIGABRT otherwise FIXME: Why? # Fails with SIGABRT otherwise FIXME: Why?
checkPhase = let checkPhase = let

View File

@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
"-DFLATBUFFERS_OSX_BUILD_UNIVERSAL=OFF" "-DFLATBUFFERS_OSX_BUILD_UNIVERSAL=OFF"
]; ];
doCheck = stdenv.hostPlatform == stdenv.buildPlatform; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
checkTarget = "test"; checkTarget = "test";
meta = with lib; { meta = with lib; {

View File

@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
"-DFLATBUFFERS_OSX_BUILD_UNIVERSAL=OFF" "-DFLATBUFFERS_OSX_BUILD_UNIVERSAL=OFF"
]; ];
doCheck = stdenv.hostPlatform == stdenv.buildPlatform; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
checkTarget = "test"; checkTarget = "test";
meta = with lib; { meta = with lib; {

View File

@ -48,7 +48,7 @@ stdenv.mkDerivation (finalAttrs: {
fi fi
''; '';
doCheck = stdenv.buildPlatform == stdenv.hostPlatform; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
nativeCheckInputs = [ gtest ]; nativeCheckInputs = [ gtest ];
enableParallelChecking = false; enableParallelChecking = false;

View File

@ -29,7 +29,7 @@ in stdenv.mkDerivation (finalAttrs: {
"-DJSON_MultipleHeaders=ON" "-DJSON_MultipleHeaders=ON"
] ++ lib.optional finalAttrs.finalPackage.doCheck "-DJSON_TestDataDirectory=${testData}"; ] ++ lib.optional finalAttrs.finalPackage.doCheck "-DJSON_TestDataDirectory=${testData}";
doCheck = stdenv.hostPlatform == stdenv.buildPlatform; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
# skip tests that require git or modify “installed files” # skip tests that require git or modify “installed files”
preCheck = '' preCheck = ''

View File

@ -87,7 +87,7 @@ stdenv.mkDerivation rec {
''; '';
doCheck = false; doCheck = false;
doInstallCheck = stdenv.buildPlatform == stdenv.hostPlatform; doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
# Since we rewrote the load path in the dynamic loader for the TCTI # Since we rewrote the load path in the dynamic loader for the TCTI
# The various tcti implementation should be placed in their target directory # The various tcti implementation should be placed in their target directory
# before we could run tests, so we make turn checkPhase into installCheckPhase # before we could run tests, so we make turn checkPhase into installCheckPhase

View File

@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
] ++ lib.optional (!doCheck) "-DURIPARSER_BUILD_TESTS=OFF"; ] ++ lib.optional (!doCheck) "-DURIPARSER_BUILD_TESTS=OFF";
nativeCheckInputs = [ gtest ]; nativeCheckInputs = [ gtest ];
doCheck = stdenv.buildPlatform == stdenv.hostPlatform; doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
meta = with lib; { meta = with lib; {
changelog = "https://github.com/uriparser/uriparser/blob/uriparser-${version}/ChangeLog"; changelog = "https://github.com/uriparser/uriparser/blob/uriparser-${version}/ChangeLog";

View File

@ -22,7 +22,7 @@ buildGoModule rec {
$out/bin/k6 version | grep ${version} > /dev/null $out/bin/k6 version | grep ${version} > /dev/null
''; '';
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd k6 \ installShellCompletion --cmd k6 \
--bash <($out/bin/k6 completion bash) \ --bash <($out/bin/k6 completion bash) \
--fish <($out/bin/k6 completion fish) \ --fish <($out/bin/k6 completion fish) \