From c11db8ebfc8a775aa05a208860fd1ec43ed4eb84 Mon Sep 17 00:00:00 2001 From: y_takino <36617106+tappe9@users.noreply.github.com> Date: Wed, 19 Aug 2026 10:08:13 +0900 Subject: [PATCH 1/2] ci: probe Rust 1.85 MSRV --- .github/workflows/msrv-probe.yml | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/msrv-probe.yml diff --git a/.github/workflows/msrv-probe.yml b/.github/workflows/msrv-probe.yml new file mode 100644 index 0000000..7048dac --- /dev/null +++ b/.github/workflows/msrv-probe.yml @@ -0,0 +1,41 @@ +name: MSRV Probe + +on: + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +jobs: + probe: + name: Rust 1.85.0 probe + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Install Rust 1.85.0 + uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 + with: + toolchain: 1.85.0 + + - name: Show toolchain + run: rustc --version && cargo --version + + - name: Generate lockfile + run: cargo generate-lockfile + + - name: Check workspace + run: cargo check --workspace --all-targets --all-features --locked + + - name: Test workspace + run: cargo test --workspace --all-features --locked + + - name: Print generated lockfile + shell: bash + run: | + echo '---CARGO_LOCK_BEGIN---' + cat Cargo.lock + echo '---CARGO_LOCK_END---' From 0e9dfa484963a197bb33bc29f8751c59bacf42f2 Mon Sep 17 00:00:00 2001 From: y_takino <36617106+tappe9@users.noreply.github.com> Date: Wed, 19 Aug 2026 10:12:12 +0900 Subject: [PATCH 2/2] chore: define MSRV and reproducible builds --- .github/workflows/ci.yml | 32 +++- .github/workflows/msrv-probe.yml | 41 ----- CONTRIBUTING.md | 22 ++- Cargo.lock | 256 +++++++++++++++++++++++++++++++ Cargo.toml | 1 + crates/zstdscope-cli/Cargo.toml | 1 + crates/zstdscope/Cargo.toml | 1 + 7 files changed, 299 insertions(+), 55 deletions(-) delete mode 100644 .github/workflows/msrv-probe.yml create mode 100644 Cargo.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e53bcc..e433e2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,24 +28,42 @@ jobs: run: cargo fmt --check - name: Clippy - run: cargo clippy --workspace --all-targets --all-features -- -D warnings + run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings - name: Test - run: cargo test --workspace --all-features + run: cargo test --workspace --all-features --locked - name: Documentation env: RUSTDOCFLAGS: -D warnings - run: cargo doc -p zstdscope --all-features --no-deps + run: cargo doc -p zstdscope --all-features --no-deps --locked - name: Core default features - run: cargo test -p zstdscope --no-default-features + run: cargo test -p zstdscope --no-default-features --locked - name: Package contents - run: cargo package -p zstdscope --list + run: cargo package -p zstdscope --list --locked - name: Publish dry run - run: cargo publish -p zstdscope --dry-run + run: cargo publish -p zstdscope --dry-run --locked + + msrv: + name: MSRV (Rust 1.85.0) + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v7 + + - name: Install Rust 1.85.0 + uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 + with: + toolchain: 1.85.0 + + - name: Check workspace + run: cargo check --workspace --all-targets --all-features --locked + + - name: Test workspace + run: cargo test --workspace --all-features --locked platform-tests: name: Tests (${{ matrix.os }}) @@ -67,4 +85,4 @@ jobs: toolchain: stable - name: Test workspace - run: cargo test --workspace --all-features + run: cargo test --workspace --all-features --locked diff --git a/.github/workflows/msrv-probe.yml b/.github/workflows/msrv-probe.yml deleted file mode 100644 index 7048dac..0000000 --- a/.github/workflows/msrv-probe.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: MSRV Probe - -on: - pull_request: - branches: [main] - workflow_dispatch: - -permissions: - contents: read - -jobs: - probe: - name: Rust 1.85.0 probe - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v7 - - - name: Install Rust 1.85.0 - uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 - with: - toolchain: 1.85.0 - - - name: Show toolchain - run: rustc --version && cargo --version - - - name: Generate lockfile - run: cargo generate-lockfile - - - name: Check workspace - run: cargo check --workspace --all-targets --all-features --locked - - - name: Test workspace - run: cargo test --workspace --all-features --locked - - - name: Print generated lockfile - shell: bash - run: | - echo '---CARGO_LOCK_BEGIN---' - cat Cargo.lock - echo '---CARGO_LOCK_END---' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7b6a7b9..c447073 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -47,21 +47,29 @@ Keep pull requests focused. A good parser PR should explain: Avoid mixing large unrelated formatting/refactoring changes with parser semantic changes. +## Rust version and dependency policy + +The workspace Minimum Supported Rust Version (MSRV) is **Rust 1.85.0**. This is the compiler floor for Rust 2024 edition and has been verified against the complete workspace with the committed dependency resolution. CI tests both Rust 1.85.0 and the current stable toolchain. + +The root `Cargo.lock` is committed intentionally because this repository contains both the reusable library and the `zstdscope` CLI binary. The lockfile makes workspace development, CI, release validation, and future CLI binary builds reproducible. Downstream users of the `zstdscope` library continue to resolve dependencies in their own applications; the repository lockfile is not imposed on library consumers. + +Dependency updates should update `Cargo.lock` intentionally and must keep both the MSRV and stable CI jobs green. Raising the MSRV is a compatibility change and should be explicit in the PR and release documentation rather than occurring accidentally through a dependency update. + ## Validation Pull requests are expected to pass the repository CI. The current quality gates include: ```bash cargo fmt --check -cargo clippy --workspace --all-targets --all-features -- -D warnings -cargo test --workspace --all-features -RUSTDOCFLAGS="-D warnings" cargo doc -p zstdscope --all-features --no-deps -cargo test -p zstdscope --no-default-features -cargo package -p zstdscope --list -cargo publish -p zstdscope --dry-run +cargo clippy --workspace --all-targets --all-features --locked -- -D warnings +cargo test --workspace --all-features --locked +RUSTDOCFLAGS="-D warnings" cargo doc -p zstdscope --all-features --no-deps --locked +cargo test -p zstdscope --no-default-features --locked +cargo package -p zstdscope --list --locked +cargo publish -p zstdscope --dry-run --locked ``` -Workspace tests also run on Ubuntu, Windows, and macOS. +The workspace is also checked and tested with Rust 1.85.0, and workspace tests run on current stable Rust across Ubuntu, Windows, and macOS. Reference-generated fixtures intended to be fully valid should document their official-zstd generation commands and should be checked with `zstd --test` when regenerated. Hand-built fixtures must state whether they prove full validity, only the structural envelope understood by the current parser, or intentional malformed behavior. diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..9e5dcc4 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,256 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys", +] + +[[package]] +name = "clap" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "473c7e07f409a8d772161724aa8db6a765a2532a70f9667eeb7b49d3d02fbdca" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b48fea5a88e9ae728a2dcbedbfc0e730f7d60da42e1cb049a83c9fb8b789889" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d012d2b9d65aca7f18f4d9878a045bc17899bba951561ba5ec3c2ba1eed9a061" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" + +[[package]] +name = "zstdscope" +version = "0.1.0" +dependencies = [ + "serde", +] + +[[package]] +name = "zstdscope-cli" +version = "0.1.0" +dependencies = [ + "clap", + "serde_json", + "zstdscope", +] diff --git a/Cargo.toml b/Cargo.toml index 8437f50..6a4786f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ resolver = "3" [workspace.package] version = "0.1.0" edition = "2024" +rust-version = "1.85.0" license = "MIT OR Apache-2.0" repository = "https://github.com/tappe9/zstdscope" readme = "README.md" diff --git a/crates/zstdscope-cli/Cargo.toml b/crates/zstdscope-cli/Cargo.toml index ec647fa..f0e5d55 100644 --- a/crates/zstdscope-cli/Cargo.toml +++ b/crates/zstdscope-cli/Cargo.toml @@ -2,6 +2,7 @@ name = "zstdscope-cli" version.workspace = true edition.workspace = true +rust-version.workspace = true license.workspace = true repository.workspace = true publish = false diff --git a/crates/zstdscope/Cargo.toml b/crates/zstdscope/Cargo.toml index 98be6dc..a040c61 100644 --- a/crates/zstdscope/Cargo.toml +++ b/crates/zstdscope/Cargo.toml @@ -2,6 +2,7 @@ name = "zstdscope" version.workspace = true edition.workspace = true +rust-version.workspace = true license.workspace = true repository.workspace = true readme.workspace = true