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
doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
checkPhase = ''
runHook preCheck

View File

@ -29,7 +29,7 @@ buildGoModule rec {
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
$out/bin/executor completion $shell > executor.$shell
installShellCompletion executor.$shell

View File

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

View File

@ -40,7 +40,7 @@ buildGoModule rec {
'';
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd vela \
--bash <($out/bin/vela completion bash) \
--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"
'';
doInstallCheck = stdenv.hostPlatform == stdenv.buildPlatform;
doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
# In particular, this detects missing python imports in some of the tools.
postFixup = let
# 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"}"
];
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
nativeCheckInputs = [ check ];
meta = with lib; {

View File

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

View File

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

View File

@ -54,7 +54,7 @@ stdenv.mkDerivation (finalAttrs: {
enableParallelBuilding = true;
# 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;
# all it does is attempt to `mkdir` the `localstatedir`.

View File

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

View File

@ -26,7 +26,7 @@ buildGoModule rec {
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
export HOME=$(mktemp -d)
installShellCompletion --cmd mangal \

View File

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

View File

@ -31,7 +31,7 @@ buildGoModule rec {
'';
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 zsh > velero.zsh
installShellCompletion velero.{bash,zsh}

View File

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

View File

@ -29,7 +29,7 @@ stdenv.mkDerivation {
];
# 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";
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?
checkPhase = let

View File

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

View File

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

View File

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

View File

@ -29,7 +29,7 @@ in stdenv.mkDerivation (finalAttrs: {
"-DJSON_MultipleHeaders=ON"
] ++ 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”
preCheck = ''

View File

@ -87,7 +87,7 @@ stdenv.mkDerivation rec {
'';
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
# The various tcti implementation should be placed in their target directory
# 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";
nativeCheckInputs = [ gtest ];
doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
meta = with lib; {
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
'';
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd k6 \
--bash <($out/bin/k6 completion bash) \
--fish <($out/bin/k6 completion fish) \