Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protobuf_25.tests.pythonProtobuf: disable faulty test #312957

Merged
merged 1 commit into from
May 20, 2024

Conversation

knedlsepp
Copy link
Member

Description of changes

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":
protocolbuffers/protobuf@501ecec 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
protocolbuffers/protobuf#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:
protocolbuffers/protobuf#15708) Conda packaging is also currently struggling with this: conda-forge/protobuf-feedstock#215

Related: #264902

cc @GaetanLepage, we may be able to rebase #264902 on this.

Next steps

I also looked into how to get the same working for the newer protobuf 26 and the upcoming 27 releases. I gave up on the option to generate the source package via bazel. Instead we will probably want to use the PyPI tarballs generated from the GitHub repo via bazel. One downside is however that these tarballs don't ship any tests, which makes verifying the correctness of the build harder.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

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":
protocolbuffers/protobuf@501ecec
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
protocolbuffers/protobuf#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:
protocolbuffers/protobuf#15708)
Conda packaging is also currently struggling with this:
conda-forge/protobuf-feedstock#215

Related: NixOS#264902
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels May 19, 2024
Copy link
Contributor

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @knedlsepp for this temporary fix.
I had this on my todo list for a while but got discouraged by the new (from 26) situation.
I agree that dealing with bazel doesn't look appealing at all.

Let's have this merged and then work on v26.

@GaetanLepage GaetanLepage requested review from tjni and SomeoneSerge May 19, 2024 18:59
@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label May 19, 2024
@SomeoneSerge
Copy link
Contributor

Instead we will probably want to use the PyPI tarballs generated from the GitHub repo via bazel

I think what we rather want is to reproduce the python source in a simple derivation without Bazel. I think @GaetanLepage and I had looked into that at some point, only we went with trying to decipher the bazel scripts. These proved less than comprehensible. The PR you referenced includes a table (rendered), maybe we can use that as a starting point.

I believe we should aim for a better transparency standard than pypi tarballs or bazel...

@@ -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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it the interpretation that google3 is a package that comes with upb?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. Grepping through the repo just makes it look like an oversight during moving code around.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's update the comment to reflect that, "Refers to a non-existent module 'google3'. Presumably an oversight". An issue upstream?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mentioned it in the commit message. My rationale was that I wanted to keep the comment short as people can always check if they get the same error message.

@SomeoneSerge SomeoneSerge changed the title protobuf_25.tests.pythonProtobuf: Fix build protobuf_25.tests.pythonProtobuf: disable faulty test May 20, 2024
@SomeoneSerge SomeoneSerge merged commit 0852bd6 into NixOS:master May 20, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: python 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants