Skip to content

Commit

Permalink
protobuf: add versionCheckHook; enable tests on darwin (#361164)
Browse files Browse the repository at this point in the history
  • Loading branch information
vcunat committed Dec 6, 2024
2 parents 0597be3 + 7d7d58b commit 3a8426d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions pkgs/development/libraries/protobuf/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
zlib,
version,
hash,
versionCheckHook,

# downstream dependencies
python3,
Expand All @@ -31,7 +32,7 @@ stdenv.mkDerivation (finalAttrs: {
src = fetchFromGitHub {
owner = "protocolbuffers";
repo = "protobuf";
rev = "refs/tags/v${version}";
tag = "v${version}";
inherit hash;
};

Expand Down Expand Up @@ -84,15 +85,18 @@ stdenv.mkDerivation (finalAttrs: {
];

doCheck =
# FIXME: investigate. 24.x and 23.x have different errors.
# At least some of it is not reproduced on some other machine; example:
# https://hydra.nixos.org/build/235677717/nixlog/4/tail
!(stdenv.hostPlatform.isDarwin && lib.versionAtLeast version "23")
# Tests fail to build on 32-bit platforms; fixed in 22.x
# https://github.com/protocolbuffers/protobuf/issues/10418
# Also AnyTest.TestPackFromSerializationExceedsSizeLimit fails on 32-bit platforms
# https://github.com/protocolbuffers/protobuf/issues/8460
&& !stdenv.hostPlatform.is32bit;
!stdenv.hostPlatform.is32bit;

nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgram = [ "${placeholder "out"}/bin/protoc" ];
versionCheckProgramArg = [ "--version" ];
doInstallCheck = true;

passthru = {
tests = {
Expand Down

0 comments on commit 3a8426d

Please sign in to comment.