Skip to content

protobuf*: Fix tests on big-endian again - #513793

Merged
OPNA2608 merged 2 commits into
NixOS:stagingfrom
OPNA2608:fix/protobuf34-big-endian
Jul 29, 2026
Merged

OPNA2608 merged 2 commits into
NixOS:stagingfrom
OPNA2608:fix/protobuf34-big-endian

Conversation

@OPNA2608

@OPNA2608 OPNA2608 commented Apr 26, 2026 •

Copy link
Copy Markdown
Contributor

First commit fixes protobuf_34 on big-endian. Second commit fixes protobuf_35 on big-endian.

  1. Applies Fix BoolKeys test to use integer-to-bool cast protocolbuffers/protobuf#25862 to fix protobuf_34's BoolToKeys test on big-endian archs. Branch name indicates that this might also affect 33.4+, but at least 33.5 builds fine as-is on my machine… 🤷‍♀️

  2. protobuf_35 init excluded the fix-upb-packed-enum-be.patch from being applied to the new version, but it's still needed there and applies without issues. Pull it into a separate condition - it's part of the 36.0 RC, so version < 36 seems like the correct upper limit.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • powerpc64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.
  • (predates the new AI policy checkbox, but i don't use LLMs and have thus no usage to declare, so it would be checked)

github-actions[bot]

This comment was marked as outdated.

@OPNA2608
OPNA2608 changed the base branch from master to staging April 26, 2026 21:53
@nixpkgs-ci nixpkgs-ci Bot closed this Apr 26, 2026
@nixpkgs-ci nixpkgs-ci Bot reopened this Apr 26, 2026
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 2501-5000 This PR causes many rebuilds on Linux and should target the staging branches. 10.rebuild-darwin: 1001-2500 This PR causes many rebuilds on Darwin and should most likely target the staging branches. labels Apr 26, 2026
@OPNA2608
OPNA2608 marked this pull request as ready for review April 28, 2026 10:50
@nixpkgs-ci
nixpkgs-ci Bot requested a review from GaetanLepage April 28, 2026 11:15

# Fix BoolKeys test on big-endian
# https://github.com/protocolbuffers/protobuf/pull/25862
./fix-BoolKeys-test-on-be.patch

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
./fix-BoolKeys-test-on-be.patch
./fix-BoolKeys-test-on-be.patch
(fetchpatch {
name = "fix-BoolKeys-test-on-be";
url = "https://github.com/linux-on-ibm-z/protobuf/commit/02774a2aea957c552383cc6cae43076f5436d867.patch";
hash = "...";
})

Let's directly fetch the patch from your branch.

@OPNA2608 OPNA2608 May 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's not my branch, and last I checked, fetching patches from branches for PRs/MRs, or the PRs/MRs directly, is not allowed (or at least discouraged) due to them having a non-zero chance of disappearing in the future (branch gets deleted and GitHub eventually cleans up unreferenced refs, PR/MR creator deletes fork, etc). Hence the vendoring.

/pkgs/README.md#vendoring-patches

@OPNA2608
OPNA2608 requested a review from GaetanLepage May 28, 2026 23:45
@nixos-discourse

Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/7086

@OPNA2608 OPNA2608 mentioned this pull request Jul 20, 2026
4 of 14 tasks
@OPNA2608
OPNA2608 marked this pull request as draft July 20, 2026 08:46
@OPNA2608
OPNA2608 force-pushed the fix/protobuf34-big-endian branch from 5175237 to 654698b Compare July 20, 2026 08:50
@OPNA2608 OPNA2608 changed the title protobuf: Apply patch to fix BoolKeys test big-endian protobuf*: Fix tests on big-endian again Jul 20, 2026
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-darwin: 2501-5000 This PR causes many rebuilds on Darwin and should target the staging branches. and removed 10.rebuild-linux: 2501-5000 This PR causes many rebuilds on Linux and should target the staging branches. 10.rebuild-darwin: 1001-2500 This PR causes many rebuilds on Darwin and should most likely target the staging branches. labels Jul 20, 2026
@OPNA2608
OPNA2608 marked this pull request as ready for review July 20, 2026 16:58
@OPNA2608

Copy link
Copy Markdown
Contributor Author

Checking completed. Fixes both protobuf_34 and protobuf_35 on big-endian machines.

@GaetanLepage Do you have the time to give this another look please? It's been 2 months since my reply to your review.

@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jul 28, 2026
@OPNA2608

Copy link
Copy Markdown
Contributor Author

Given the lack of a response from the maintainer, I'll take that…

@OPNA2608
OPNA2608 added this pull request to the merge queue Jul 29, 2026
@GaetanLepage

Copy link
Copy Markdown
Contributor

Sorry! All good!

Merged via the queue into NixOS:staging with commit e1e8ddb Jul 29, 2026
31 checks passed
@OPNA2608
OPNA2608 deleted the fix/protobuf34-big-endian branch July 29, 2026 12:27
@hmenke

hmenke commented Aug 19, 2026

Copy link
Copy Markdown
Member

Not 100% sure, whether it is since this PR, but the ArenaTest.FuzzRefArenaRace subtest of upb-test has started segfaulting occasionally for pkgsStatic.protobuf. I also see different stacks for the failure

$ while nix-build --check --keep-failed -A pkgsStatic.protobuf; do :; done # repeat until fail
$ cd /nix/var/nix/builds/nix-453838-2094392646/build/source/build
$ gdb --args ./upb-test --gtest_filter=ArenaTest.FuzzRefArenaRace
(gdb) break exit
(gdb) commands
># repeat until fail
>run
>end
(gdb) run
Thread 6 "upb-test" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 608036]
0x00000000007972b4 in upb_global_allocfunc (alloc=<optimized out>, 
    ptr=0x7fffef760dc0, oldsize=352, size=0, actual_size=0x0)
    at /build/source/upb/mem/alloc.c:21
⚠️ warning: 21	/build/source/upb/mem/alloc.c: No such file or directory
=> 0x00000000007972b4 <upb_global_allocfunc+20>:	e8 1c 6a 1b 00     	call   0x94dcd5 <free>
(gdb) run
Thread 9 "upb-test" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 608815]
0x0000000000797754 in upb_Arena_Free (a=0x7ffff5477b20) at /build/source/upb/mem/arena.c:137
⚠️ warning: 137	/build/source/upb/mem/arena.c: No such file or directory
   0x0000000000797750 <upb_Arena_Free+0>:	55                 	push   rbp
   0x0000000000797751 <upb_Arena_Free+1>:	48 89 e5           	mov    rbp,rsp
=> 0x0000000000797754 <upb_Arena_Free+4>:	41 57              	push   r15
   0x0000000000797756 <upb_Arena_Free+6>:	41 56              	push   r14
   0x0000000000797758 <upb_Arena_Free+8>:	41 55              	push   r13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 2501-5000 This PR causes many rebuilds on Darwin and should target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants