Skip to content

fix(udp-protocol): [#2931] allow uncommon_codepoints for zerocopy derives - #2932

Merged
josecelano merged 2 commits into
torrust:developfrom
josecelano-bot:2931-nightly-uncommon-codepoints-zerocopy
Nov 18, 2026
Merged

josecelano merged 2 commits into
torrust:developfrom
josecelano-bot:2931-nightly-uncommon-codepoints-zerocopy

Conversation

@josecelano-bot

Copy link
Copy Markdown
Contributor

Summary

Nightly Rust (rustc 1.102.0-nightly 59cbdee2e, rustup nightly-2026-11-18) fails to build torrust-tracker-udp-protocol with 17 errors identifier contains an uncommon character: 'ẕ'. zerocopy-derive 0.8.63 generates identifiers with a ẕ prefix using the span of our field names, rust-lang/rust#165289 (Unicode 18) made that character "uncommon", and the repository's global -D warnings turns the lint into an error. It was first seen on #2920 and it affects every pull request and develop on nightly.

This PR adds a crate-level #![allow(uncommon_codepoints)] to torrust-tracker-udp-protocol, with a comment that says why it has to be crate-level (rustc only honours this lint's level there, rust-lang/rust#86824) and when to remove it (once a zerocopy release no longer generates non-ASCII identifiers). Only this crate uses the zerocopy derives. Pinning nightly in the workflows and allowing the lint workspace-wide were rejected, see the issue spec.

Files touched

  • packages/udp-protocol/src/lib.rs: the allow and its comment.
  • docs/issues/open/2931-nightly-uncommon-codepoints-zerocopy/: the bug specification, manual-verification-evidence.md (V1 red, V2 green) and the raw command output in evidence/.
  • project-words.txt: three words for the spell checker.

Validation

  • Red on develop: cargo +nightly-2026-11-18 check -p torrust-tracker-udp-protocol fails with 17 errors; the same command on nightly-2026-11-17 passes.
  • Green with the change: the same command on nightly-2026-11-18, cargo +nightly-2026-11-18 check --workspace --all-targets, and the crate on stable and on the MSRV 1.88 all finish with exit 0.
  • ./contrib/dev-tools/git/hooks/pre-commit.sh passes (11 of 11 steps).
  • The nightly jobs of this PR's CI are the final check. No temporary local patches are part of the diff.

Closes #2931

🤖 Generated with Claude Code

josecelano-bot and others added 2 commits November 18, 2026 07:57
Bug spec with the cause (zerocopy-derive ẕ identifiers vs Unicode 18 in
rust-lang/rust#165289), the red reproduction on nightly-2026-11-18 and the plan.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rrust#2931)

zerocopy-derive 0.8.63 generates identifiers with a non-ASCII prefix. Nightly
rustc with Unicode 18 flags them, and -D warnings turns that into an error.
The allow must be crate-level. Remove it once zerocopy stops generating them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@josecelano

Copy link
Copy Markdown
Member

ACK ef65408

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the crate-scoped lint allowance addressing the nightly compilation failure.

No open issues 🎉

What changed in this PR

Restores nightly compilation of the UDP protocol crate by allowing uncommon_codepoints for identifiers generated by zerocopy derives. The exception is limited to this crate and does not change tracker runtime behavior.

Changes:

  • Adds a justified crate-level lint allowance with a removal condition.
  • Records the failure, toolchain boundary, and successful nightly, stable, and minimum-supported-Rust checks.
  • Adds three spell-check dictionary entries.
File Description
project-words.txt Adds terminology used in the documentation.
packages/​udp-protocol/​src/​lib.rs Adds the scoped lint allowance and explanation.
docs/​issues/​open/​2931-nightly-uncommon-codepoints-zerocopy/​manual-verification-evidence.md Summarizes reproduction and successful rechecks.
docs/​issues/​open/​2931-nightly-uncommon-codepoints-zerocopy/​ISSUE.md Documents the cause, scope, fix, and acceptance criteria.
docs/​issues/​open/​2931-nightly-uncommon-codepoints-zerocopy/​evidence/​red-nightly-2026-11-18.txt Records the 17 compiler errors before the fix.
docs/​issues/​open/​2931-nightly-uncommon-codepoints-zerocopy/​evidence/​red-nightly-2026-11-17.txt Records the successful previous-nightly baseline.
docs/​issues/​open/​2931-nightly-uncommon-codepoints-zerocopy/​evidence/​green-stable-crate.txt Records a successful stable crate check.
docs/​issues/​open/​2931-nightly-uncommon-codepoints-zerocopy/​evidence/​green-nightly-2026-11-18-workspace.txt Records a successful nightly workspace check.
docs/​issues/​open/​2931-nightly-uncommon-codepoints-zerocopy/​evidence/​green-nightly-2026-11-18-crate.txt Records success on the previously failing nightly.
docs/​issues/​open/​2931-nightly-uncommon-codepoints-zerocopy/​evidence/​green-msrv-1.88.0-crate.txt Records compatibility with Rust 1.88.0.

Review effort: Balanced

@josecelano
josecelano merged commit d8e1445 into torrust:develop Nov 18, 2026
21 of 22 checks passed
josecelano pushed a commit that referenced this pull request Nov 18, 2026
… spec

Issue #2931 was closed by PR #2932. Move its spec to docs/issues/closed, set
status done and record the PR, the checkpoints and the final progress entry.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
josecelano added a commit that referenced this pull request Nov 18, 2026
…oints spec

74d2017 docs(pr-reviews): [#2931] audit review round 2 of PR 2933 (josecelano-bot)
1873039 docs(pr-reviews): [#2931] record what the reviewer reported for finding F3 (josecelano-bot)
a26c900 docs(issues): [#2931] restore the recorded drafting path in the spec checkpoint (josecelano-bot)
41fe5f7 docs(pr-reviews): [#2931] audit review round 1 of PR 2933 (josecelano-bot)
bca588a docs(issues): [#2931] correct the archive paths in the spec checkpoints (josecelano-bot)
261a403 chore(issues): [#2931] archive the closed nightly uncommon_codepoints spec (josecelano-bot)

Pull request description:

  ## Summary

  Archives the specification of issue #2931 (nightly Rust failing on `uncommon_codepoints` in the zerocopy derives) from `docs/issues/open/` to `docs/issues/closed/`, following the `cleanup-completed-issues` skill. The issue is already closed on GitHub, and its fix was merged in PR #2932.

  ## Files touched

  - `docs/issues/closed/2931-nightly-uncommon-codepoints-zerocopy/` (moved with `git mv`, so the history follows): `ISSUE.md` now has `status: done`, `spec-path` below `closed/`, `related-pr: 2932`, a current `last-updated-utc`, the workflow checkpoints and acceptance criteria ticked, the implementation completion review filled in, and a final progress-log entry. `manual-verification-evidence.md` has its paths and last-updated date updated and now records the PR's CI result.
  - No other document referenced the old path (`rg` for the folder name found only the spec's own files), so no links needed repair.

  ## Validation

  - `git diff --cached --check` passed and `./contrib/dev-tools/git/hooks/pre-commit.sh` passed (11 of 11 steps).
  - No code, workflow or dictionary change.

  Related to #2931

  🤖 Generated with [Claude Code](https://claude.com/claude-code)

ACKs for top commit:
  da2ce7:
    ACK 74d2017 — the archive move with F1 to F4 fixed, the audit record's six rows against their threads under the validator's logic offline, and the trial merge against develop recomputed at this head
  josecelano:
    ACK 74d2017

Tree-SHA512: 9c7e5440b3b39ecac34fdbbd4d8ff49c38e31077f0e658517741518949a7e43a071b2c5bc0b6f8e268284e9a09fd300df6eac613d846e75eb9285bf7b68ac39b

@da2ce7 da2ce7 left a comment

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.

Posted after the merge: this pull request merged at the reviewed head ef6540813 while this round was still running, so the findings below are for follow-up and no ACK accompanies this review.

Reviewed at ef65408135b33f98169128dccf012983619e106c. Recomputed from the bytes at this head, against the merge base 8d932f312; git merge-tree against develop 8d932f312 exits 0 with no conflict and writes the head's own tree, since develop is the merge base.

Process: a bug fix, governed by the repository skills fix-bug, create-issue, commit-changes and open-pull-request. The folder spec has Bug-Fix Process and Regression Test Strategy, the evidence file classifies the reproduction as Reproduced, the red and green runs are kept in evidence/, and the spec says why the nightly compile in CI is the regression boundary.

The change against its claim: the crate-level #![allow(uncommon_codepoints, reason = ...)] sits beside the existing crate allow, before any item, so it governs a lint that rustc checks once per crate. The 17 recorded errors are exactly the first occurrences of the 17 distinct named fields of the zerocopy-derived structs at 8d932f312, and every quoted line matches its source. Only this crate expands zerocopy derives, its sources hold no non-ASCII character outside comments, Cargo.lock pins zerocopy and zerocopy-derive 0.8.63, and the 1.88 MSRV accepts reason. The rust-lang references and the zerocopy-derive line numbers cannot be checked offline.

Consistency: the local links at this head resolve, the frontmatter fits the issue profile (spec-path and branch match), and the three dictionary words are used in the change and keep the list C-sorted.

Hygiene: two commits, Conventional with a scope, author equal to committer, one attribution footer line each (no rule in the tree on it); the description carries one attribution footer line too. git diff --check is clean, the PR-branch commit-id check prints nothing, and the closing-keyword scan matches only Closes #2931 in the description, which this implementation PR should close.

Findings: F1 and F2 Minor, F3 to F6 Nit, inline. None blocks: the head's tree is right, and each can be fixed later or left.

Checked, no finding: the description's file list and validation claims against the diff and the evidence; no review comment asks for a reply, so no audit record is due yet.

Checks

On the loop's compute node at this head, against the merge base 8d932f312 (receipt server-gates-kranich-1141): the repository's pre-commit gate and lint roster exit 0 (612 s wall). This PR carries no audit record of its own, so the gate ran no validator for it. In a fresh per-PR target directory, cargo test --workspace passes 4207 tests with 0 failed and 5 ignored across 123 binaries (487 s wall), and cargo clippy --workspace --all-targets --all-features -- -D warnings is clean (46 s wall). cargo deny check exits 5 with the same 35 license rejections and four advisories as later runs on develop, so this pull request changes nothing in that result. The head and merge were confirmed with the forge before posting. GitHub checks at this head at posting time: "Publish (Development): completed/skipped; Publish (Release): completed/skipped; Context: completed/success; Package Coverage Regression: completed/success; Package Coverage (torrust-tracker-udp-protocol): completed/failure; Docker E2E: completed/skipped; Unit (nightly): completed/success; Workspace Packaging: completed/success; Unit (stable): completed/success; Layer Boundary Bans: completed/success; Documented Clippy Allows: completed/success; Shipped Features: completed/success; Test (Docker) (release): completed/success; Build on macos-latest (nightly): completed/success; Build on ubuntu-latest (nightly): completed/success; Build on macos-latest (stable): completed/success; Build on windows-latest (stable): completed/success; Build on windows-latest (nightly): completed/success; Build on ubuntu-latest (stable): completed/success; Docs Lint: completed/success; Discover Package Coverage: completed/success; Generate Coverage Report: completed/success". At posting, develop is 4497837e6.

Run one after another from the same checkout, same command as V1 for the first step. Each output file holds
the command, UTC start and end times, and the exit code.

1. `cargo +nightly-2026-11-18 check -p torrust-tracker-udp-protocol` ([output](evidence/green-nightly-2026-11-18-crate.txt))

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.

[Minor][F1] The docs commit already records the green recheck that only the fix commit makes true

b59f46062 adds this file and ISSUE.md exactly as they are at this head. So at that commit this V2 section links four evidence/green-*.txt files that only ef6540813 adds (none of the four local links resolves in that commit's tree), and the spec marks T2 and T3 DONE and AC1 to AC4 checked while packages/udp-protocol/src/lib.rs is unchanged. The commit body describes only the red reproduction and the plan, and the spec's own Commit Points put the green evidence in the T2/T3 commit. Merges keep the branch commits, so this stays in history. It does not block, because the head's tree is right. Moving the V2 section and the status changes into the fix commit would match the Commit Points; whether that is worth a rewrite now that this head has been acknowledged is the author's call.

- `nightly-2026-11-17` = `rustc 1.102.0-nightly (5df8c02af 2026-11-16)`
- `nightly-2026-11-18` = `rustc 1.102.0-nightly (59cbdee2e 2026-11-17)` (the CI failure's toolchain)
- Prerequisites and setup performed: none beyond the toolchains. The repository's
`.cargo/config.toml` rustflags (including `-D warnings`) apply. No `RUSTC_WRAPPER`/sccache.

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.

[Minor][F2] -D warnings does not come from .cargo/config.toml rustflags

At 8d932f312 and at this head .cargo/config.toml holds only [alias] entries. The deny comes from [workspace.lints.rust] warnings = { level = "deny", priority = -1 } (Cargo.toml:223), which the crate inherits through [lints] workspace = true (packages/udp-protocol/Cargo.toml:17). Cargo passes it to rustc as -D warnings, which is what the recorded note -D uncommon-codepoints implied by -D warnings shows. ISSUE.md:52 says the same with "global rustflags". A reader who checks the environment would look in the wrong file. Suggest naming the workspace lint table in both places. The wording follows AGENTS.md:39 and AGENTS.md:60, which have been stale since the lints moved to [workspace.lints]; that is outside this PR.


The nightly jobs of CI (for example `Build on macos-latest (nightly)` in `OS Compatibility`) fail
with 17 errors `identifier contains an uncommon character: 'ẕ'` in
`packages/udp-protocol/src/announce.rs`, `scrape.rs` and the other files that derive zerocopy

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.

[Nit][F3] The errors are only in announce.rs and scrape.rs, not in the other deriving files

The recorded run has 16 errors in announce.rs and 1 in scrape.rs. common.rs and connect.rs also derive the traits and report none. Recomputed at 8d932f312: the zerocopy-derived structs have 17 distinct named fields, and the 17 error positions are exactly each name's first occurrence in module order, so rustc reports each generated identifier once. Suggest "17 errors, one per distinct field name at its first occurrence (in announce.rs and scrape.rs)", which also explains the count.


- Allowing the lint workspace-wide (in `.cargo/config.toml`) or in other crates: only this crate
uses the zerocopy derives.
- Pinning the nightly toolchain in the workflows: it would touch five workflows to get the same

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.

[Nit][F4] Six workflows select nightly, not five

coverage.yaml, deployment-packages.yaml, deployment.yaml, generate_coverage_pr.yaml, os-compatibility.yaml and testing.yaml all select a nightly toolchain, so pinning would touch six. The Regression Test Strategy paragraph also leaves out generate_coverage_pr.yaml, whose package coverage job builds the changed package on nightly for pull requests.

// and rustc only honours this lint's level at crate level (rust-lang/rust#86824).
// Remove this allow when a `zerocopy` release no longer generates non-ASCII identifiers.
// Issue: https://github.com/torrust/torrust-tracker/issues/2931
#![allow(

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.

[Nit][F5] The commit subjects put the issue reference at the end

This is outside the diff. Both subjects end in (#2931), while the history on develop puts the reference after the scope (docs(issues): [#2902] ...), as this PR's title does. No skill sets the form for commit subjects, so this is only about consistency. The subjects land on develop with the merge.

- [x] AC4: the allow is crate-level in `torrust-tracker-udp-protocol` only, with a comment naming
the cause, the upstream link and the removal condition.
- [ ] AC5: the nightly jobs of the PR's CI pass.
- [ ] `linter all` exits with code `0`

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.

[Nit][F6] The spec does not record the pre-commit pass that the description reports

The description says ./contrib/dev-tools/git/hooks/pre-commit.sh passed 11 of 11 steps. The hook has 11 steps, and step 9 is linter all. But this criterion and the Automatic verification completed checkpoint (line 139) stay unchecked, and no progress-log entry records the run. Suggest ticking both with the run's time, or saying that the run is still to come.

This branch was previously deployed

1 inactive deployment
coverage — ef654081 Deployed Nov 18, 2026 by josecelano-bot via Generate Coverage Report #3311
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.

Nightly Rust fails on uncommon_codepoints in zerocopy derives

4 participants