| ca06116d | 08-Jun-2026 |
Miguel Ojeda <ojeda@kernel.org> |
rust: zerocopy-derive: add `README.md`
Originally, when the Rust upstream `alloc` standard library crate was vendored in commit 057b8d257107 ("rust: adapt `alloc` crate to the kernel"), a `README.md
rust: zerocopy-derive: add `README.md`
Originally, when the Rust upstream `alloc` standard library crate was vendored in commit 057b8d257107 ("rust: adapt `alloc` crate to the kernel"), a `README.md` file was added to explain the provenance and licensing of the source files.
Thus do the same for the `zerocopy-derive` crate.
Cc: Joshua Liebow-Feeser <joshlf@google.com> Cc: Jack Wrenn <jswrenn@google.com> Link: https://patch.msgid.link/20260608141439.182634-17-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
|
| 29b2a2b9 | 08-Jun-2026 |
Miguel Ojeda <ojeda@kernel.org> |
rust: zerocopy-derive: avoid generating non-ASCII identifiers
Linux is built with `-Dnon_ascii_idents`. However, `zerocopy-derive` uses a non-ASCII character (`ẕ`) internally, which in turn triggers
rust: zerocopy-derive: avoid generating non-ASCII identifiers
Linux is built with `-Dnon_ascii_idents`. However, `zerocopy-derive` uses a non-ASCII character (`ẕ`) internally, which in turn triggers the lint when attempting to use derives like `FromBytes`:
error: identifier contains non-ASCII characters --> rust/kernel/lib.rs:153:9 | 153 | a: u32, | ^ | = note: requested on the command line with `-D non-ascii-idents`
This was already noticed by another project using `#![deny(non_ascii_idents)]` [1]. `zerocopy` added an `#[allow(non_ascii_idents)]` [2], but it does not work since, at the moment, the `non_ascii_idents` lint is a `crate_level_only` one, and thus `allow`s only work at the crate root level.
Due to this, an issue about relaxing this restriction was created in upstream Rust [3] some months ago.
Thus work around it here by using another prefix. The likelihood of a collision is very small for us, since we control the callers, and this will hopefully be fixed soon at either the `zerocopy` or the Rust level.
I filed an issue [4] about it with upstream `zerocopy` as requested and we discussed this with upstream Rust and `zerocopy`: the Rust issue got nominated and a PR [5] to relax the restriction was submitted by Joshua. Upstream `zerocopy` prefers that approach, so if Rust merges it, then it means we will be able to remove the workaround when we bump the MSRV, thus likely late 2027, since we follow Debian Stable.
Cc: Joshua Liebow-Feeser <joshlf@google.com> Cc: Jack Wrenn <jswrenn@google.com> Link: https://github.com/google/zerocopy/issues/2880 [1] Link: https://github.com/google/zerocopy/pull/2882 [2] Link: https://github.com/rust-lang/rust/issues/151025 [3] Link: https://github.com/google/zerocopy/issues/3427 [4] Link: https://github.com/rust-lang/rust/pull/157497 [5] Link: https://patch.msgid.link/20260608141439.182634-16-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
|
| 5f85604c | 08-Jun-2026 |
Miguel Ojeda <ojeda@kernel.org> |
rust: zerocopy-derive: add SPDX License Identifiers
Originally, when the Rust upstream `alloc` standard library crate was vendored, the SPDX License Identifiers were added to every file so that the
rust: zerocopy-derive: add SPDX License Identifiers
Originally, when the Rust upstream `alloc` standard library crate was vendored, the SPDX License Identifiers were added to every file so that the license on those was clear. The same happened with the vendoring of `proc_macro2`, `quote` and `syn`. Please see:
commit 057b8d257107 ("rust: adapt `alloc` crate to the kernel") commit 69942c0a8965 ("rust: syn: add SPDX License Identifiers") commit ddfa1b279d08 ("rust: quote: add SPDX License Identifiers") commit a9acfceb9614 ("rust: proc-macro2: add SPDX License Identifiers")
Thus do the same for the `zerocopy-derive` crate.
This makes `scripts/spdxcheck.py` pass: use parentheses like commit 06e9bfc1e57d ("ionic: make spdxcheck.py happy") did since we have two `OR` operators in the expression (three licenses).
Finally, as requested, I filed an issue [1] with upstream about it.
Cc: Joshua Liebow-Feeser <joshlf@google.com> Cc: Jack Wrenn <jswrenn@google.com> Link: https://github.com/google/zerocopy/issues/3428 [1] Link: https://patch.msgid.link/20260608141439.182634-15-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
|