Skip to content

musl: fix siginfo_t definition - #5521

Merged
tgross35 merged 1 commit into
rust-lang:mainfrom
dybucc:fix-siginfo_t
Sep 15, 2026
Merged

tgross35 merged 1 commit into
rust-lang:mainfrom
dybucc:fix-siginfo_t

Conversation

@dybucc

@dybucc dybucc commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Description

#5345 messed up one thing about the musl bindings; Fields __first and
__second from __si_common in the untagged union were made records
instead of untagged unions themselves.

Checklist

  • Relevant tests in libc-test/semver have been updated
  • Commit messages permalink to headers for added or changed API
  • Placeholder or unstable values like *LAST or *MAX have the
    standard doc comment
  • Tested locally (cargo test -p libc-test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot label +stable-nominated

@tgross35 tgross35 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Huh, why didn't this show up in tests? I guess they're private and the structs here were still smaller than any other union variant?

In any case thanks for the fix, LGTM.

View changes since this review

Fix definition of `siginfo_t` in musl after the recent patch that moved
it to `new` replaced certain untagged unions with records [^1].

[^1]: rust-lang#5345
@rustbot

rustbot commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@tgross35
tgross35 enabled auto-merge September 15, 2026 16:03
@xtqqczze

xtqqczze commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Huh, why didn't this show up in tests?

It showed up in nix-rust/nix#2821 (comment). Going forward, it might be worth testing libc against a few downstream crates as well, since I only happened to catch this because it surfaced there when compiling against the libc-0.2 branch of libc.

@tgross35

tgross35 commented Sep 15, 2026

Copy link
Copy Markdown
Member

I would love to have that kind of feedback, though I don't think we can commit to maintaining CI for downstream projects here. Maybe interested projects (nix, rustix, etc) could add a repository_dispatch trigger to their workflow that runs on pushes to libc-0.2 (use patch.crates-io to link to the git), then we link it here #5209.

@tgross35
tgross35 added this pull request to the merge queue Sep 15, 2026
@xtqqczze

Copy link
Copy Markdown
Contributor

@tgross35 Regarding nix-rust/nix#2821 and bytecodealliance/rustix#1676, is there anyone you can reach out to who might be able to help get these merged soon? Otherwise, these crates will break with the next libc release, and users will need to pin libc.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 15, 2026
@tgross35
tgross35 added this pull request to the merge queue Sep 15, 2026
@xtqqczze

Copy link
Copy Markdown
Contributor

@tgross35 It would also help if you could backport these changes soon, so I can test against the libc-0.2 branch rather than my own cherry-picked libc-0.2-fix-siginfo_t branch.

Merged via the queue into rust-lang:main with commit 9bc88f0 Sep 15, 2026
114 of 116 checks passed
@tgross35

Copy link
Copy Markdown
Member

Pinged on the PR for one and on Zulip for the other. Thank you for doing the work to get that together! I'm loosely holding off the release waiting on the rustix fix, but that issue has been open for a long time so I'm not sure it's worth waiting much longer.

@dybucc

dybucc commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

Huh, why didn't this show up in tests? I guess they're private and the structs
here were still smaller than any other union variant?

In any case thanks for the fix, LGTM.

View changes since this
review

We don't test against C anonymous unions. The affected fields are anonymous
unions within anonymous unions (not directly the descendants of the unions
in the siginfo_t, though.)

Though this type seems to be popular enough to merit a test under
libc-test/tests.

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

Labels

O-musl stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants