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

Fix union layout when it contains 0 sized array. #3173

Merged
merged 1 commit into from
Apr 4, 2025

Conversation

qsr
Copy link

@qsr qsr commented Mar 20, 2025

Fix #3068

@qsr
Copy link
Author

qsr commented Mar 20, 2025

r? @emilio

@rustbot
Copy link
Collaborator

rustbot commented Mar 20, 2025

Error: The feature assign is not enabled in this repository.
To enable it add its section in the triagebot.toml in the root of the repository.

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

bherrera pushed a commit to misttech/fuchsia that referenced this pull request Apr 1, 2025
This CL 1) updates the outputs of generate.py so that they match what the script does at ToT (outputs such as arm.rs at ToT haven't been updated/synced), and 2) makes sure fx build works after the update.

Steps:
1. Run `./src/starnix/lib/linux_uapi/generate.py` (no edits)
This results in some changes, notably, io_uring_sqe__bindgen_ty_6 updating to a struct and having 5 params.

2. Run `fx build`. This fails due to:
```
error[E0080]: evaluation of `std::mem::size_of::<io_uring_sqe>` failed
 --> /b/s/w/ir/x/w/fuchsia-third_party-rust/library/core/src/mem/mod.rs:1229:26
  |
  = note: values of the type `[u8; 18446744073709551608]` are too big for the target architecture
```
This is rust-lang/rust-bindgen#3068.

3. Patch in the generate.py edit. Run `./src/starnix/lib/linux_uapi/generate.py` (with edit). Note that generated files now do not have the `pub __bindgen_padding_0` line.

4. `fx build` completes.

Once's qsr's fix at rust-lang/rust-bindgen#3173 is merged and rolled in, we shouldn't need to do the regex replace.

Bug: 398914504
Change-Id: Ic6be5a14f4f00477795588a5ed52e5770c64955e
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1235157
Reviewed-by: Benjamin Lerman <[email protected]>
Commit-Queue: Mary Xia <[email protected]>
bherrera pushed a commit to misttech/integration that referenced this pull request Apr 3, 2025
…_padding_0

This CL 1) updates the outputs of generate.py so that they match what the script does at ToT (outputs such as arm.rs at ToT haven't been updated/synced), and 2) makes sure fx build works after the update.

Steps:
1. Run `./src/starnix/lib/linux_uapi/generate.py` (no edits)
This results in some changes, notably, io_uring_sqe__bindgen_ty_6 updating to a struct and having 5 params.

2. Run `fx build`. This fails due to:
```
error[E0080]: evaluation of `std::mem::size_of::<io_uring_sqe>` failed
 --> /b/s/w/ir/x/w/fuchsia-third_party-rust/library/core/src/mem/mod.rs:1229:26
  |
  = note: values of the type `[u8; 18446744073709551608]` are too big for the target architecture
```
This is rust-lang/rust-bindgen#3068.

3. Patch in the generate.py edit. Run `./src/starnix/lib/linux_uapi/generate.py` (with edit). Note that generated files now do not have the `pub __bindgen_padding_0` line.

4. `fx build` completes.

Once's qsr's fix at rust-lang/rust-bindgen#3173 is merged and rolled in, we shouldn't need to do the regex replace.

Original-Bug: 398914504
Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1235157
Original-Revision: 3b130710ba6aac0d9130bc718184bfaf34abbfa8
GitOrigin-RevId: c1e0371e35ebae79d27ecaaac3fc16ae30461a38
Change-Id: I4169f94aa0c01a8be2ddcddb6b094e46b6c7108d
@emilio emilio added this pull request to the merge queue Apr 4, 2025
@emilio
Copy link
Contributor

emilio commented Apr 4, 2025

@ojeda the rust for linux CI seems failing:

error: Error loading target specification: target feature soft-float is incompatible with the ABI but gets enabled in target spec. Run rustc --print target-list for a list of built-in targets

@emilio
Copy link
Contributor

emilio commented Apr 4, 2025

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 4, 2025
@emilio emilio added this pull request to the merge queue Apr 4, 2025
Merged via the queue into rust-lang:main with commit a50a2cf Apr 4, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bindgen with explicit padding generates an array of size 18446744073709551608
3 participants