Skip to content

fix(install): delete the dead proptest test-profile spec, and document why the rest cannot go today - #2575

Open
noahgift wants to merge 1 commit into
mainfrom
fix/2571-dead-profile-package-spec
Open

fix(install): delete the dead proptest test-profile spec, and document why the rest cannot go today#2575
noahgift wants to merge 1 commit into
mainfrom
fix/2571-dead-profile-package-spec

Conversation

@noahgift

Copy link
Copy Markdown
Contributor

Partial fix for #2571, with the remainder documented rather than hidden.

What shipped

[profile.test.package.proptest] is deleted — it was dead. Plus 183 lines of
workspace-invariant tests (12 passing) that had no home before.

What did NOT ship, and why

[profile.dev.package.proptest] stays, so cargo install still emits one warning.
The reviewer caught the first attempt claiming this fixed when it was not, so to be
explicit: #2571 is not closed by this PR.

The root manifest is the published aprender crate ([package] name = "aprender"),
so every [profile.*] section it carries ships to consumers. proptest is a
dev-dependency and is absent from a cargo install graph, so cargo warns.

Each way out was evaluated and costs more than the warning:

approach why not
[target.'cfg(any())'.dependencies] proptest silences it, but injects 39 phantom packages (proptest, rustix, libc, getrandom…) into every downstream Cargo.lock, and so into their cargo-audit / deny / vendor surface, for a crate that is never built
[profile.dev.package."*"] silences it (cargo never validates *), but disables debug-assertions for all third-party crates in dev/test — weakening a real check to remove a cosmetic line
a no-op "*" block beside the named spec still warns

The only cost-free fix is structural: split the aprender facade out of the workspace
root
, so dev-only profiles stop being published at all. That is a real refactor, not a
release-day change, and it stays tracked in #2571.

Disposition

P2, cosmetic, does not block 0.64.0. One warning on install instead of two, and the
reasoning is now in the manifest where the next person will find it instead of
rediscovering it.

Refs #2571, #2566

… RED to remove (#2571)

0.63.0 opens every `cargo install aprender` with two warnings:

  warning: profile package spec `proptest` in profile `dev`  did not match any packages
  warning: profile package spec `proptest` in profile `test` did not match any packages

The root manifest is BOTH the workspace root AND the published package, so its
dev-only profile blocks ship to crates.io and are re-validated by an install
resolve that excludes dev-dependencies. Neither spec can match there.

Deleting both lines was the obvious fix and is WRONG. #1989 added them to kill a
reproducible flake, and it still reproduces. Measured with
`PROPTEST_CASES=1000000 cargo test -p aprender-train --lib config::validate::proptests`
(the module #1989 named), PROPTEST_CASES engagement proven by 10x time scaling
(5.45s at 100k -> 55.05s at 1M):

  both blocks removed -> rc=101, "assertion failed: self.low - result < self.intervals.step"
                         at proptest-1.11.0/src/num/float_samplers.rs:466,
                         in prop_negative_lr_fails
  dev block kept      -> rc=0, 21 passed in 57.33s

`cargo +nightly ... -Z unstable-options --unit-graph` confirms the mechanism rather
than the intent: the proptest unit carries debug_assertions=true without the block
and false with it.

So exactly one of the two is dead. proptest is only ever built as a *dependency*,
and dependencies build under `dev` even when the test target builds under `test`.
Across the full workspace test graph there is exactly ONE proptest unit among 1110,
and the `dev` block alone already sets debug_assertions=false on it. The `test`
block never applied to anything. It is deleted here.

Verified end-to-end on a real install-shaped resolve, not by inspection:
`cargo install --path . --root <tmp>` printed 2 spec warnings before, 1 after.

Four ways to remove the last warning were measured and rejected:
  - proptest in the root [dev-dependencies]: still warns (install skips dev-deps).
  - `[target.'cfg(any())'.dependencies] proptest`: silences it, but injects 39
    phantom packages into EVERY consumer's Cargo.lock and audit/vendor surface.
  - `[profile.dev.package."*"]`: silences it, but disables debug-assertions for all
    third-party crates in our dev/test builds — weakening a real check for cosmetics.
  - a no-op `"*"` block beside the named spec: still warns.
Downgrading proptest is not an escape either: float_samplers.rs is byte-identical
1.8.0..=1.11.0 apart from the f16 feature, and 1.11.0 is still the newest published.
The cost-free fix is structural (split the facade out of the workspace root) and is
left to #2571.

FALSIFY-INSTALL-001 (crates/aprender-core/tests/monorepo_invariants.rs, already wired
into ci.yml:346) walks the non-dev dependency closure of the published package and
fails on any profile spec absent from it. Mutation-verified in three directions:
re-adding the `test` block -> RED naming that block; deleting the `dev` block ->
RED on the stale allowlist entry rather than passing silently; making the walk follow
dev edges -> RED on the proptest vacuity canary (without which the gate would bless
everything, which is how #2571 shipped).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VX2s9nQPbWDB3Vze4JM3Wg
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.

1 participant