chore: align workspace with Rust best practices (edition 2024, MSRV CI, deps, profiles)#163
Merged
Merged
Conversation
…I, deps, profiles) Conformance pass against Cargo Book / API-guidelines / packaging norms. Edition & MSRV: - Migrate both crates to edition 2024 + resolver "3" (MSRV-aware), bump rust-version to 1.85, run `cargo fix --edition` (match-ergonomics, import ordering, formatting). Add an MSRV CI job pinned to 1.85 so the declared rust-version is actually verified. Edition 2024 made std::env::set_var/remove_var `unsafe`; relax the workspace lint from `unsafe_code = "forbid"` to `deny` (still errors on any unguarded unsafe) and remove all unsafe instead of allowing it: - Production: cli.rs threads the default log directive into the logging initializer (new init_with_redaction_and_directive) instead of mutating RUST_LOG; docker_retry.rs replaces its env round-trip test seam with an atomic counter. - Tests: subprocess tests set env on the child Command; in-process tests use the temp-env crate (scoped, serialized) — no unsafe, no #[allow(unsafe_code)]. Dependencies: - Hoist serde, serde_json, tokio (union features), futures, tar, sha2, regex, zip, tempfile, assert_cmd, testcontainers into [workspace.dependencies]; fixes the regex (1.0 vs 1.10) and zip (2.1 vs 2.4) divergences. Packaging / build: - publish = false on both crates (consumer CLI, not a crates.io library); point `documentation` at the repo. - Add [profile.release] lto="thin"/codegen-units=1/strip=true and drop the fragile shell `strip || true` from the release workflow. Move dev `debug=1` from a global rustflag to [profile.dev] so it no longer bloats release. CI / hygiene: - clippy now runs with --all-features (was missing feature-gated code). - Standardize codeql checkout to actions/checkout@v6. - Clarify the `full = []` compile-gate feature comment. - Silence a pre-existing dead-code warning in the --no-default-features MVP build (resolve_features_ordered is only reachable under `full`). deny.toml multiple-versions left at "warn": the duplicates are transitive (thiserror 1/2, getrandom, windows-sys, …), not hoistable, so flipping to "deny" would break CI. Full workspace gate green: fmt, clippy --all-targets --all-features -D warnings, 2161 tests, release build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Conformance pass against current Rust packaging/organization norms (Cargo Book, API guidelines, docs.rs/release tooling). Driven by a project-wide best-practices audit.
Edition & MSRV
resolver = "3"(MSRV-aware resolver), bumprust-versionto 1.85. Rancargo fix --editionfor the mechanical changes (match-ergonomics, import ordering); edition-2024 rustfmt accounts for most of the line count.1.85(cargo check --workspace --all-targets --all-features --locked) so the declared MSRV is actually verified instead of aspirational.unsafe_code:
forbid→deny, with zero unsafe addedEdition 2024 makes
std::env::set_var/remove_varunsafe. Rather than scatter#[allow(unsafe_code)], the env mutation is eliminated:cli.rsthreads the default log directive into a newinit_with_redaction_and_directiveinstead of mutatingRUST_LOG;docker_retry.rsreplaces its env round-trip test seam with an atomic counter (also fixes a latent race).Command; in-process tests use thetemp-envcrate (scoped + serialized). Result: nounsafeand no#[allow(unsafe_code)]anywhere;denystays meaningful.Dependencies
serde,serde_json,tokio(union of features),futures,tar,sha2,regex,zip,tempfile,assert_cmd,testcontainersinto[workspace.dependencies]. Fixes the confirmedregex(1.0 vs 1.10) andzip(2.1 vs 2.4) divergences.Packaging / build profiles
publish = falseon both crates (this is a consumer CLI shipped as prebuilt binaries, not a crates.io library);documentationnow points at the repo.[profile.release]:lto = "thin",codegen-units = 1,strip = true— and drop the fragile shellstrip … || truefrom the release workflow (rustc strips cross-platform now). Moved devdebug = 1from a global rustflag (which also bloated release) into[profile.dev].CI / hygiene
--all-features(previously feature-gatedfullcode was unlinted in CI).codeql.ymlcheckout toactions/checkout@v6.full = []compile-gate feature comment.--no-default-featuresMVP build (resolve_features_orderedis only reachable underfull).Deliberately NOT changed
deny.tomlmultiple-versionsstayswarn: the duplicates are transitive (thiserror1/2,getrandom,windows-sys, …), not hoistable — flipping todenywould break CI.[package.metadata.docs.rs](moot underpublish = false).Verification
cargo fmt --all -- --check✅cargo clippy --workspace --all-targets --all-features -- -D warnings✅make test-nextest-fast→ 2161 passed ✅--no-default-featuresMVP /--releasebuilds all green ✅🤖 Generated with Claude Code