haskellPackages.procex: only execute tests if Kernel >= 5.9

The compile time check for close_range support is broken fundamentally
at the moment (linux-headers is always 5.14, so it'll always assume
close_range is available, upstream is aware of this issue). As a
workaround, we disable the test suite if the kernel on the builder is
too old, allowing the package to still be built.
This commit is contained in:
sternenseemann 2021-10-13 12:31:31 +02:00
parent 05482d2a1b
commit bde22ab96e
3 changed files with 17 additions and 3 deletions

View File

@ -3846,7 +3846,6 @@ broken-packages:
- process-leksah
- process-listlike
- processmemory
- procex
- procrastinating-variable
- procstat
- prof2pretty

View File

@ -978,4 +978,21 @@ self: super: builtins.intersectAttrs super {
doCheck = with pkgs.stdenv; hostPlatform == buildPlatform
&& buildPlatform.isx86;
};
# procex relies on close_range which has been introduced in Linux 5.9,
# the test suite seems to force the use of this feature (or the fallback
# mechanism is broken), so we can't run the test suite on machines with a
# Kernel < 5.9. To check for this, we use uname -r to obtain the Kernel
# version and sort -V to compare against our minimum version. If the
# Kernel turns out to be older, we disable the test suite.
procex = overrideCabal super.procex (drv: {
postConfigure = ''
minimumKernel=5.9
higherVersion=`printf "%s\n%s\n" "$minimumKernel" "$(uname -r)" | sort -rV | head -n1`
if [[ "$higherVersion" = "$minimumKernel" ]]; then
echo "Used Kernel doesn't support close_range, disabling tests"
unset doCheck
fi
'' + (drv.postConfigure or "");
});
}

View File

@ -215225,8 +215225,6 @@ self: {
testHaskellDepends = [ async base bytestring hspec unix ];
description = "Ergonomic process launching with extreme flexibility and speed";
license = lib.licenses.mit;
hydraPlatforms = lib.platforms.none;
broken = true;
}) {};
"procrastinating-structure" = callPackage