Skip to content

chore: 0.2.0 publish prep — package hygiene and loom as a dev-dependency - #7

Merged
hasanzakeri merged 3 commits into
mainfrom
chore/publish-prep-0.2.0
Aug 22, 2026
Merged

hasanzakeri merged 3 commits into
mainfrom
chore/publish-prep-0.2.0

Conversation

@hasanzakeri

Copy link
Copy Markdown
Owner

Pre-publish cleanup for 0.2.0, found while reviewing cargo publish --dry-run.
Three independent changes, one per commit.

1. docs(changelog) — date 0.2.0 to its actual release date

The section was dated 2026-06-12, when the work was authored. The release ships today, and that date travels inside the published tarball.

2. chore(package) — keep Makefile and .gitignore out of the crate

Contributor-workflow files with no meaning to a consumer. Packaged file count 28 → 26.

3. refactor(loom) — make loom a dev-dependency

The substantive one. As a [target.'cfg(loom)'.dependencies] entry, loom was resolved into the lockfile of every crate depending on rt-ring. Measured with a throwaway crate depending on rt-ring:

packages in downstream Cargo.lock
before 32 — loom, generator, the tracing-subscriber tree, cc, windows-sys, …
after 2 — the consumer and rt-ring

None of those were ever compiled — cfg(loom) is never set downstream — but they were recorded and fetched by cargo fetch, cargo vendor, and offline CI mirrors. Poor showing for a crate whose selling point is having no runtime dependencies; the README's claim is now literally true in a consumer's lockfile.

Dev-dependencies don't propagate to consumers. They also aren't linkable from the plainly-compiled library, and sync.rs needs loom::sync::atomic in the library itself. Unit tests are the exception — there the lib is compiled with --test, where dev-deps resolve — so the loom tests move from tests/ into src/loom_tests/. This is the arrangement tokio uses, for the same reason.

Git tracked both files as renames, so the move reviews as a diff.

Accepted cost: non-test builds under --cfg loom (cargo build, cargo clippy --lib) no longer resolve — off the --test compilation there is no loom to link, failing with E0433 at src/sync.rs:6. Documented in the CHANGELOG, src/loom_tests/mod.rs, and Cargo.toml. tokio has the identical limitation. CI is unaffected: the clippy job doesn't set the cfg, and the loom job now runs cargo test --lib.

Verification

  • RUSTFLAGS="--cfg loom" cargo test --lib — 4 loom tests pass as loom_tests::spsc::* / loom_tests::broadcast::*
  • cargo test --all-targets — 59 pass; cargo test --doc — 15 pass
  • cargo clippy --all-targets -- -D warnings, cargo fmt --check — clean
  • RUSTDOCFLAGS="-D warnings" cargo doc --no-deps — clean
  • cargo publish --dry-run — clean, 27 files, 41.3 KiB compressed

Watch the Loom job. Its invocation changed (--test loom_spsc --test broadcast_loom → --lib) and that's the one change I could only exercise locally.

No public API change; 0.2.0 remains unpublished, so nothing here is breaking relative to a released version.

The 0.2.0 section was dated 2026-06-12, when the work was authored. The
release ships today, and that date travels inside the published tarball.
Both are contributor-workflow files with no meaning to a consumer of the
crate. 28 files -> 26.
…he lib

As a `[target.'cfg(loom)'.dependencies]` entry, loom was resolved into the
lockfile of every crate depending on rt-ring: 30 extra packages (loom,
generator, the tracing-subscriber tree, cc, windows-sys). None were ever
compiled — the cfg is never set downstream — but they were recorded and
fetched by cargo fetch, cargo vendor, and offline mirrors, which is a poor
showing for a crate whose selling point is having no runtime dependencies.
A downstream lockfile goes from 32 packages to 2.

Dev-dependencies don't propagate, but they also aren't linkable from the
plainly-compiled library, and sync.rs needs loom::sync::atomic in the library
itself. Unit tests are the exception: there the lib is compiled with --test,
where dev-deps resolve. So the loom tests move from tests/ into
src/loom_tests/. This is the arrangement tokio uses for the same reason.

Costs, both accepted: non-test builds under --cfg loom (cargo build, cargo
clippy --lib) no longer resolve, and the loom runner is now cargo test --lib.
CI is unaffected — the clippy job doesn't set the cfg.
@hasanzakeri
hasanzakeri merged commit 71c2a9b into main Aug 22, 2026
6 checks passed
@hasanzakeri
hasanzakeri deleted the chore/publish-prep-0.2.0 branch August 22, 2026 21:13
hasanzakeri added a commit that referenced this pull request Oct 8, 2026
chore: 0.2.0 publish prep — package hygiene and loom as a dev-dependency
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