From 5b84606d50d1d4f6fd58f111fc4796e55a11d6a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Kemetm=C3=BCller?= Date: Sun, 19 May 2024 15:40:27 +0200 Subject: [PATCH] protobuf_25.tests.pythonProtobuf: Fix build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to enable bumping the default protobuf version from protobuf_24 to protobuf_25, we address the build failure of pythonPackages.protobuf against that version. Protobuf's python package is moving away from cpp backend in favor of a µpb backend. (See: https://github.com/protocolbuffers/protobuf/tree/main/upb) The work on that seems to have lead to the introduction of a broken test in "minimal_test.py": https://github.com/protocolbuffers/protobuf/commit/501ececd39fed69f0c50c2c87f04ce75932dde72 I suspect that this is not an issue on the nixpkgs packaging end but rather that this file is uncovered code upstream. I don't know enough about Bazel to be sure, but it looks like that file is not part of their protobuf/python/BUILD.bazel file. (I wanted to prove that in https://github.com/protocolbuffers/protobuf/pull/16888 but couldn't trigger upstream's CI) So for now let's just skip that file. Note that protobuf_26.tests.pythonProtobuf is still broken. This is due to the fact that upstream removed support for building the library directly from the GitHub repo. (See: https://github.com/protocolbuffers/protobuf/pull/15708) Conda packaging is also currently struggling with this: https://github.com/conda-forge/protobuf-feedstock/pull/215 Related: #264902 --- pkgs/development/python-modules/protobuf/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/protobuf/default.nix b/pkgs/development/python-modules/protobuf/default.nix index 73e013d00af8c..f47c64d19a375 100644 --- a/pkgs/development/python-modules/protobuf/default.nix +++ b/pkgs/development/python-modules/protobuf/default.nix @@ -104,6 +104,8 @@ buildPythonPackage { # https://github.com/protocolbuffers/protobuf/commit/5abab0f47e81ac085f0b2d17ec3b3a3b252a11f1 # "google/protobuf/internal/generator_test.py" + ] ++ lib.optionals (lib.versionAtLeast protobuf.version "25") [ + "minimal_test.py" # ModuleNotFoundError: No module named 'google3' ]; pythonImportsCheck = [ @@ -122,6 +124,6 @@ buildPythonPackage { maintainers = with maintainers; [ knedlsepp ]; # Tests are currently failing because backend is unavailable and causes tests to fail # Progress tracked in https://github.com/NixOS/nixpkgs/pull/264902 - broken = lib.versionAtLeast protobuf.version "25"; + broken = lib.versionAtLeast protobuf.version "26"; }; }