From 7cdaa0b80c9da64b2acb6cc8e8f73d2f4489aaeb Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sun, 1 Sep 2024 22:06:00 +0200 Subject: [PATCH 1/6] protobuf: protobuf_25 -> protobuf_28 Bump default protobuf from 25.4 to 28.0, as well as the corresponding python package. Changelog: https://github.com/protocolbuffers/protobuf/releases/tag/v28.0 Diff: https://github.com/protocolbuffers/protobuf/compare/v25.4...v28.0 --- pkgs/development/libraries/protobuf/generic.nix | 6 ++---- pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/python-packages.nix | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/protobuf/generic.nix b/pkgs/development/libraries/protobuf/generic.nix index 71f8e90b774a2..7fcabb9f1836d 100644 --- a/pkgs/development/libraries/protobuf/generic.nix +++ b/pkgs/development/libraries/protobuf/generic.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation (finalAttrs: { src = fetchFromGitHub { owner = "protocolbuffers"; repo = "protobuf"; - rev = "v${version}"; + rev = "refs/tags/v${version}"; inherit hash; }; @@ -89,9 +89,7 @@ stdenv.mkDerivation (finalAttrs: { passthru = { tests = { - pythonProtobuf = python3.pkgs.protobuf.override (_: { - protobuf = finalAttrs.finalPackage; - }); + pythonProtobuf = python3.pkgs.protobuf; inherit grpc; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ce1cdfdeff141..9f43ea8d398c6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23147,7 +23147,7 @@ with pkgs; prospector = callPackage ../development/tools/prospector { }; - protobuf = protobuf_25; + protobuf = protobuf_28; inherit ({ diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 079d58d61c12d..b5e3f377a07b8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10894,7 +10894,7 @@ self: super: with self; { protobuf5 = callPackage ../development/python-modules/protobuf/default.nix { }; # If a protobuf upgrade causes many Python packages to fail, please pin it here to the previous version. - protobuf = protobuf4; + protobuf = protobuf5; protobuf3-to-dict = callPackage ../development/python-modules/protobuf3-to-dict { }; From 187b315b0f640649efefdf52084b6c15cd0a45f2 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sun, 1 Sep 2024 22:56:03 +0200 Subject: [PATCH 2/6] protobuf: add GaetanLepage as maintainer --- pkgs/development/libraries/protobuf/generic.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/protobuf/generic.nix b/pkgs/development/libraries/protobuf/generic.nix index 7fcabb9f1836d..075f0ac68173c 100644 --- a/pkgs/development/libraries/protobuf/generic.nix +++ b/pkgs/development/libraries/protobuf/generic.nix @@ -106,7 +106,7 @@ stdenv.mkDerivation (finalAttrs: { license = lib.licenses.bsd3; platforms = lib.platforms.all; homepage = "https://protobuf.dev/"; - maintainers = [ ]; + maintainers = with lib.maintainers; [ GaetanLepage ]; mainProgram = "protoc"; }; }) From b26982f96ab46d8c9111dfa92f93868b3ae9ff20 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 2 Sep 2024 15:07:18 +0200 Subject: [PATCH 3/6] protobuf: add testVersion check --- pkgs/development/libraries/protobuf/generic.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/libraries/protobuf/generic.nix b/pkgs/development/libraries/protobuf/generic.nix index 075f0ac68173c..75137ea599473 100644 --- a/pkgs/development/libraries/protobuf/generic.nix +++ b/pkgs/development/libraries/protobuf/generic.nix @@ -18,6 +18,8 @@ , grpc , enableShared ? !stdenv.hostPlatform.isStatic +, testers +, protobuf , ... }: @@ -91,6 +93,7 @@ stdenv.mkDerivation (finalAttrs: { tests = { pythonProtobuf = python3.pkgs.protobuf; inherit grpc; + version = testers.testVersion { package = protobuf; }; }; inherit abseil-cpp; From 391c332090fd49bee0d702c5ba3b25615b96d27a Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 2 Sep 2024 10:06:04 +0200 Subject: [PATCH 4/6] python311Packages.tensorflow: pin protobuf python to python311Packages.protobuf4 --- pkgs/top-level/python-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b5e3f377a07b8..508faf10c908d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15540,7 +15540,7 @@ self: super: with self; { ).override { protobuf = protobufTF; }; - protobuf-pythonTF = self.protobuf.override { + protobuf-pythonTF = self.protobuf4.override { protobuf = protobufTF; }; grpcioTF = self.grpcio.override { From 4c41bfc129701046b6929079860c4f3cc308d7aa Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 2 Sep 2024 11:03:56 +0200 Subject: [PATCH 5/6] or-tools: pin protobuf python to python312Packages.protobuf4 --- pkgs/development/libraries/science/math/or-tools/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/science/math/or-tools/default.nix b/pkgs/development/libraries/science/math/or-tools/default.nix index cb4670204d112..8e7f2e26f7a3d 100644 --- a/pkgs/development/libraries/science/math/or-tools/default.nix +++ b/pkgs/development/libraries/science/math/or-tools/default.nix @@ -102,7 +102,7 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ abseil-cpp protobuf - (python.pkgs.protobuf.override { protobuf = protobuf; }) + (python.pkgs.protobuf4.override { protobuf = protobuf; }) python.pkgs.numpy ]; nativeCheckInputs = [ From 8f4eb776fbbf9b5ae48ef5c696d4cd5aee7a7e6f Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 2 Sep 2024 12:45:51 +0200 Subject: [PATCH 6/6] ola: pin protobuf python to python312Packages.protobuf4 --- pkgs/applications/misc/ola/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/misc/ola/default.nix b/pkgs/applications/misc/ola/default.nix index 8d4d4df4ef755..f58b418d52f06 100644 --- a/pkgs/applications/misc/ola/default.nix +++ b/pkgs/applications/misc/ola/default.nix @@ -39,7 +39,7 @@ stdenv.mkDerivation rec { python3 ]; propagatedBuildInputs = [ - (python3.pkgs.protobuf.override { protobuf = protobuf; }) + (python3.pkgs.protobuf4.override { protobuf = protobuf; }) python3.pkgs.numpy ];