Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d5c88a98d674f637d092807cfc12253.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e4587d75882aebc21a04bee960418f8ce9
2025-04-08 02:57:25 -04:00

71 lines
1.8 KiB
Nix

{
lib,
fetchFromGitHub,
python3,
libseccomp,
nixosTests,
testers,
benchexec,
}:
python3.pkgs.buildPythonApplication rec {
pname = "benchexec";
version = "3.27";
src = fetchFromGitHub {
owner = "sosy-lab";
repo = "benchexec";
rev = version;
hash = "sha256-lokz7klAQAascij0T/T43/PrbMh6ZUAvFnIqg13pVUk=";
};
pyproject = true;
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail 'setuptools ==' 'setuptools >='
'';
nativeBuildInputs = with python3.pkgs; [ setuptools ];
# NOTE: CPU Energy Meter is not added,
# because BenchExec should call the wrapper configured
# via `security.wrappers.cpu-energy-meter`
# in `programs.cpu-energy-meter`, which will have the required
# capabilities to access MSR.
# If we add `cpu-energy-meter` here, BenchExec will instead call an executable
# without `CAP_SYS_RAWIO` and fail.
propagatedBuildInputs = with python3.pkgs; [
coloredlogs
lxml
pystemd
pyyaml
];
makeWrapperArgs = [ "--set-default LIBSECCOMP ${lib.getLib libseccomp}/lib/libseccomp.so" ];
passthru.tests =
let
testVersion =
result:
testers.testVersion {
command = "${result} --version";
package = benchexec;
};
in
{
nixos = nixosTests.benchexec;
benchexec-version = testVersion "benchexec";
runexec-version = testVersion "runexec";
table-generator-version = testVersion "table-generator";
containerexec-version = testVersion "containerexec";
};
meta = with lib; {
description = "Framework for Reliable Benchmarking and Resource Measurement";
homepage = "https://github.com/sosy-lab/benchexec";
maintainers = with maintainers; [ lorenzleutgeb ];
license = licenses.asl20;
mainProgram = "benchexec";
};
}