Skip to content

fix(ci): let the nightly Miri job honour strict-provenance ignores - #664

Open
martintmk wants to merge 2 commits into
mainfrom
sentinel/fix/7734570-parking-lot-strict-provenance
Open

fix(ci): let the nightly Miri job honour strict-provenance ignores#664
martintmk wants to merge 2 commits into
mainfrom
sentinel/fix/7734570-parking-lot-strict-provenance

Conversation

@martintmk

@martintmk martintmk commented Aug 13, 2026

Copy link
Copy Markdown
Member

🤖 Clawpilot here! Posted automatically by Clawpilot (an AI agent), not by a human. Please verify before acting.

Summary

Approach changed after review. The [patch.crates-io] git pin of parking_lot_core and the deny.toml allow-git carve-out are gone; the branch is rebased onto current main and now contains only a CI fix plus three test attributes.

Root cause (revised)

The workspace already has the exclusion mechanism this needs. crates/internity/tests/basic.rs gates freeze_races_writer_and_stays_prefix_consistent behind #[cfg_attr(miri_strict_provenance, ignore = "...")], cfg(miri_strict_provenance) is declared in the workspace check-cfg list, and just anvil-miri-strict-provenance defines that cfg via RUSTFLAGS.

The scheduled miri-strict-provenance job in .github/workflows/nightly.yml inlines the cargo invocation instead of calling that recipe, and it sets only MIRIFLAGS — never RUSTFLAGS=--cfg miri_strict_provenance. So the cfg was never defined in CI, the ignore never applied, the test ran anyway, and parking_lot_core's integer-to-pointer cast at word_lock.rs:320 aborted the whole internity test binary. That is why nightly kept failing even after the suppression was added.

Changes

  • .github/workflows/nightly.yml — set RUSTFLAGS: --cfg miri_strict_provenance on the strict-provenance step, mirroring the just recipe it inlines, and document the mechanism next to the job.
  • crates/internity/tests/basic.rs — apply the same cfg_attr ignore to the three remaining tests that contend a parking_lot lock and reach the same cast: concurrent_intern_is_consistent, concurrent_intern_then_concurrent_resolve, threaded_intern_bytes_is_consistent_across_threads.

internity, cachet and cachet_tier are the only workspace crates that depend on parking_lot, and the first two sort before internity, so they already clear the job today.

Why this shape

This is what was asked for on this PR: exclude the affected tests from strict-provenance Miri until a fixed parking_lot_core is released, rather than pull a third-party git revision into the build. unknown-git = "deny" stays intact and deny.toml is untouched. No coverage is lost outside strict provenance — the tests still run on every host target and under the miri-tree-borrows and miri-race-coverage nightly jobs.

crates.io still has no fixed release: parking_lot_core 0.9.12 (2025-10-03) is the newest version, and the upstream AtomicPtr commit is unreleased. The upstream "please cut a release" issue is still to be filed; there is no open issue for it on Amanieu/parking_lot today.

Note: setting RUSTFLAGS in the job env overrides .cargo/config.toml's target-cpu=x86-64-v3, which is irrelevant under Miri and matches what the just recipe already does.

Validation

  • cargo +1.96.1 test -p internity --test basic --all-features — 52 passed, 0 ignored (normal builds are unaffected).
  • Same command with --cfg miri_strict_provenance injected — 48 passed, 4 ignored, no unexpected_cfgs warning. This is the direct proof that the cfg reaches the integration test and that the ignore attributes fire.
  • cargo +1.96.1 clippy -p internity --all-features --all-targets -D warnings — clean.
  • rustfmt +nightly-2026-05-30 --check --config-path unstable-rustfmt.toml on the changed file — clean.
  • nightly.yml parses as valid YAML.

The failing path itself is Linux-only (the threaded tests are cfg(not(all(miri, windows)))), so the scheduled job on main remains the platform-exact confirmation.

Bug: https://o365exchange.visualstudio.com/O365%20Core/_workitems/edit/7734570

Copilot AI lite review requested due to automatic review settings August 13, 2026 10:42
@martintmk martintmk changed the title [Build fix] oxidizer/nightly: preserve parking_lot pointer provenance fix: preserve parking_lot pointer provenance Aug 13, 2026

Copilot AI 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.

Pull request overview

Pins parking_lot_core to a specific upstream git revision to fix a nightly Miri strict-provenance failure caused by integer↔pointer round-tripping in WordLock, while keeping the existing strict-provenance CI coverage unchanged.

Changes:

  • Add a [patch.crates-io] override for parking_lot_core pointing at the upstream provenance-safe fix commit.
  • Update Cargo.lock so parking_lot_core is sourced from the pinned git revision instead of crates.io.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
Cargo.toml Adds a crates.io patch override pinning parking_lot_core to the upstream strict-provenance fix commit.
Cargo.lock Updates the resolved source for parking_lot_core to match the new git patch.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Cargo.toml Outdated
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (8c5a3c9) to head (f9f7a58).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #664   +/-   ##
=======================================
  Coverage   100.0%   100.0%           
=======================================
  Files         582      583    +1     
  Lines       62852    62891   +39     
=======================================
+ Hits        62852    62891   +39     
Flag Coverage Δ
linux 88.7% <ø> (-11.3%) ⬇️
linux-arm 88.7% <ø> (-11.3%) ⬇️
scheduled ?
windows 88.7% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI review requested due to automatic review settings August 13, 2026 11:02
Comment thread .patches/parking_lot_core/src/parking_lot.rs Fixed
Comment thread .patches/parking_lot_core/src/parking_lot.rs Fixed
Comment thread .patches/parking_lot_core/src/word_lock.rs Fixed

Copilot AI 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.

Pull request overview

Copilot reviewed 22 out of 23 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 13, 2026 11:08
Comment thread .patches/parking_lot_core/src/parking_lot.rs Fixed
Comment thread .patches/parking_lot_core/src/parking_lot.rs Fixed
Comment thread .patches/parking_lot_core/src/word_lock.rs Fixed

Copilot AI 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.

Pull request overview

Copilot reviewed 22 out of 23 changed files in this pull request and generated no new comments.

Suppressed comments (1)

.patches/parking_lot_core/Cargo.toml:11

  • The vendored parking_lot_core now uses strict-provenance pointer APIs (e.g., ptr::without_provenance_mut, pointer .map_addr()/.with_addr()), which are not available on Rust 1.71. Keeping rust-version = "1.71.0" misrepresents the minimum supported Rust version and can lead to confusing build failures on older toolchains.
rust-version = "1.71.0"

Copilot AI review requested due to automatic review settings August 13, 2026 11:14

Copilot AI 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.

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (1)

deny.toml:67

  • This comment says the allowlist is "commit-pinned", but allow-git only allows the repository URL (any commit). The commit pinning happens in Cargo.toml via rev, so the comment here is misleading.
# Temporary, commit-pinned upstream fix for parking_lot_core strict provenance.

Comment thread Cargo.toml Outdated
@sandersaares

Copy link
Copy Markdown
Member

Hmmm.

image

Do we even need parking_lot here? It can be a bit cargo-culted by AI sometimes. I suggest also trying with std synchronization primitives. They are better maintained and not necessarily slower.

Comment thread Cargo.toml Outdated
Comment thread deny.toml Outdated

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.

If we need to use random Git patch then I would rather just exclude this from the Miri checking until a proper patched version is available. Plus file an upstream "hey release a fix please" issue.

The scheduled `miri-strict-provenance` job set `MIRIFLAGS` but never
`RUSTFLAGS=--cfg miri_strict_provenance`, so the
`#[cfg_attr(miri_strict_provenance, ignore = "...")]` suppression the
workspace already relies on was never active there. The gated test kept
running under `-Zmiri-strict-provenance` and kept aborting the whole
`internity` test binary on parking_lot_core's integer-to-pointer cast in
`word_lock.rs`, breaking `main` nightly after nightly.

Set the cfg in the job, mirroring the `just anvil-miri-strict-provenance`
recipe it inlines, and gate the remaining `internity` tests that contend a
`parking_lot` lock and hit the same cast.

The tests keep their coverage under the tree-borrows and race-coverage
Miri jobs and on every host target; only strict provenance skips them.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 4, 2026 07:19
@Vaiz
Evgenii (Vaiz) force-pushed the sentinel/fix/7734570-parking-lot-strict-provenance branch from e5e8bde to 5112ae3 Compare September 4, 2026 07:19
@Vaiz Evgenii (Vaiz) changed the title fix: preserve parking_lot pointer provenance fix(ci): let the nightly Miri job honour strict-provenance ignores Sep 4, 2026
@Vaiz

Copy link
Copy Markdown
Contributor

🤖 Clawpilot here! Posted automatically by Clawpilot (an AI agent), not by a human. Please verify before acting.

Sander Saares (@sandersaares) martintmk — taken as directed. The git patch and the deny.toml carve-out are both dropped; unknown-git = "deny" is untouched and deny.toml no longer appears in the diff at all. The branch is rebased onto current main and the PR is now two files.

While implementing the exclusion I found the actual reason nightly kept failing, which changes the fix from "add a suppression" to "make the existing suppression work":

  • crates/internity/tests/basic.rs already gates freeze_races_writer_and_stays_prefix_consistent behind #[cfg_attr(miri_strict_provenance, ignore = "...")] (added in perf(ci): parallelize scheduled Miri and reduce resource outliers #706), and cfg(miri_strict_provenance) is already declared in the workspace check-cfg list.
  • That cfg is defined by just anvil-miri-strict-provenance through RUSTFLAGS. The scheduled job inlines the cargo command instead of calling the recipe and sets only MIRIFLAGS — so the cfg was never defined in CI and the ignore never fired. The test ran, and parking_lot_core aborted the whole internity binary.

So the fix sets RUSTFLAGS: --cfg miri_strict_provenance on that job and extends the same cfg_attr to the three other tests that contend a parking_lot lock. Coverage is untouched everywhere else — those tests still run on every host target and under the tree-borrows and race-coverage Miri jobs.

Verified locally that the mechanism actually works rather than assuming it: cargo test -p internity --test basic --all-features reports 52 passed / 0 ignored normally, and 48 passed / 4 ignored with --cfg miri_strict_provenance injected, with no unexpected_cfgs warning.

On the upstream ask: crates.io still shows 0.9.12 (2025-10-03) as newest, the AtomicPtr fix is unreleased, and there is no open "please cut a release" issue on Amanieu/parking_lot. I have not filed one — opening an issue on a third-party repo under a maintainer's identity is outside what I'll do unprompted. Say the word and I'll draft it, or file it yourself; either way it is the exit criterion for removing these four cfg_attrs.

Copilot AI 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.

🟢 Approval recommended

The change is narrowly scoped to CI configuration plus test-only ignore attributes, with only a small maintainability follow-up noted.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread .github/workflows/nightly.yml
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

⚠️ Potential breaking changes detected

cargo semver-checks flagged the following on this PR. This is informational -- breaking changes between commits are expected; the major-version bump happens at release time, not on every PR.

internity

     Cloning origin/main
    Building internity v0.2.0 (current)
       Built [   4.158s] (current)
     Parsing internity v0.2.0 (current)
error: unsupported rustdoc format v60 for file: /home/runner/work/oxidizer/oxidizer/target/semver-checks/local-internity-0_2_0-default-8d74fec22ef71f4f/target/doc/internity.json
(supported formats are v55, v56, v57)

@martin-kolinek

Copy link
Copy Markdown
Collaborator

@sasaares, just to double check, your random patch applies to a previous version of this PR, right? I don't see any random patches, just exclusion of a few tests.

…nce job

The step-level `env:` map replaces any inherited value, while the
`just anvil-miri-strict-provenance` recipe this job mirrors prepends to
it. Nothing sets either variable at workflow, job or `$GITHUB_ENV` level
today, so this is latent rather than a live defect - but the sibling
`miri-race-coverage` job already writes `MIRIFLAGS` via `$GITHUB_ENV`,
so the trap is one edit away.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 4, 2026 11:37

Copilot AI 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.

🟢 Approval recommended

The changes consistently apply the existing cfg-based suppression mechanism and correctly wire that cfg into the strict-provenance Miri CI step.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

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.

6 participants