From 025b08b580446ed27e4f5fe8e9fa914bddf02d49 Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Mon, 6 Feb 2023 12:06:39 -0500 Subject: [PATCH] protobuf3_21: don't build tests on 32-bit platforms The tests fail to build on 32-bit platforms, due to an upstream bug which will be fixed in 3.22. Previously, this was holding back the default protobuf version on 32-bit platforms to 3.20, which in turn broke packages such as mypy-protobuf which require 3.21 This commit disables building the tests on 32-bit platforms, allowing 3.21 to build. Note that we don't ever run the tests on any platform, but they are normally still built. Now that 3.21 builds on 32-bit, this commit also unpins 3.20 as the default version. --- pkgs/development/libraries/protobuf/generic-v3-cmake.nix | 7 ++++++- pkgs/top-level/all-packages.nix | 8 +------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/protobuf/generic-v3-cmake.nix b/pkgs/development/libraries/protobuf/generic-v3-cmake.nix index 207017b5edd..dfe2a6d7a96 100644 --- a/pkgs/development/libraries/protobuf/generic-v3-cmake.nix +++ b/pkgs/development/libraries/protobuf/generic-v3-cmake.nix @@ -79,7 +79,12 @@ let "-Dprotobuf_ABSL_PROVIDER=package" ] ++ lib.optionals (!stdenv.targetPlatform.isStatic) [ "-Dprotobuf_BUILD_SHARED_LIBS=ON" - ]; + ] + # Tests fail to build on 32-bit platforms; fixed in 3.22 + # https://github.com/protocolbuffers/protobuf/issues/10418 + ++ lib.optional + (stdenv.targetPlatform.is32bit && lib.versionOlder version "3.22") + "-Dprotobuf_BUILD_TESTS=OFF"; # unfortunately the shared libraries have yet to been patched by nix, thus tests will fail doCheck = false; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a7e527e45c5..7b494c671ad 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22664,13 +22664,7 @@ with pkgs; prospector = callPackage ../development/tools/prospector { }; - # https://github.com/protocolbuffers/protobuf/issues/10418 - # protobuf versions have to match between build-time and run-time - # Using "targetPlatform" in the check makes sure that the version of - # pkgsCross.armv7l-hf-multiplatform.buildPackages.protobuf matches the - # version of pkgsCross.armv7l-hf-multiplatform.protobuf - protobuf = if stdenv.targetPlatform.is32bit then protobuf3_20 else - protobuf3_21; + protobuf = protobuf3_21; protobuf3_21 = callPackage ../development/libraries/protobuf/3.21.nix { }; protobuf3_20 = callPackage ../development/libraries/protobuf/3.20.nix { };