Commit 5b84606d authored by Josef Kemetmüller's avatar Josef Kemetmüller
Browse files

protobuf_25.tests.pythonProtobuf: Fix build

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
parent 4540e74d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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";
  };
}