From c965fbcd646e80680adc120b038ca62d42924ae3 Mon Sep 17 00:00:00 2001 From: eshork <1829176+eshork@users.noreply.github.com> Date: Thu, 14 May 2026 00:42:33 -0400 Subject: [PATCH] fix(peeroxide-cli): move ascii_art.txt inside crate so cargo package can find it The previous location 'docs/ascii_art.txt' was outside the peeroxide-cli crate root and reached via include_str!("../../docs/ascii_art.txt") in src/main.rs. cargo publish strips files outside the crate directory from the tarball, so the release-plz verification compile failed with: error: couldn't read `src/../../docs/ascii_art.txt`: No such file or directory (os error 2) Move the canonical asset to peeroxide-cli/src/ascii_art.txt and update the include path to the in-crate location. Add a publish-check CI job that runs 'cargo package --workspace' on every PR. This runs the same verification compile release-plz runs at publish time, against a tmp-registry built from sibling tarballs in topological order, so it catches both this bug class (include_str! paths that escape the crate root) and cross-crate API mismatches before they reach the release PR. --- .github/workflows/ci.yml | 19 +++++++++++++++++++ {docs => peeroxide-cli/src}/ascii_art.txt | 0 peeroxide-cli/src/main.rs | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) rename {docs => peeroxide-cli/src}/ascii_art.txt (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4415803..d2ae240 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,3 +52,22 @@ jobs: - uses: dtolnay/rust-toolchain@1.85.0 - uses: Swatinem/rust-cache@v2 - run: cargo check --workspace + + publish-check: + name: cargo package workspace + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + # `cargo package --workspace` packs every member into target/package/ in + # topological order and verifies each one against a tmp-registry built + # from the sibling tarballs. This catches: + # * `include_str!`/asset paths that escape the crate root + # * Cargo.toml manifest issues (missing license/description, oversized + # tarball, files outside [package].include, etc.) + # * cross-crate API mismatches (verify-compile sees the new sibling + # version locally instead of falling back to the published one) + # This is the same verification step release-plz runs at publish time; + # running it on every PR catches publish-only failures before merge. + - run: cargo package --workspace diff --git a/docs/ascii_art.txt b/peeroxide-cli/src/ascii_art.txt similarity index 100% rename from docs/ascii_art.txt rename to peeroxide-cli/src/ascii_art.txt diff --git a/peeroxide-cli/src/main.rs b/peeroxide-cli/src/main.rs index af627d5..d343afb 100644 --- a/peeroxide-cli/src/main.rs +++ b/peeroxide-cli/src/main.rs @@ -15,7 +15,7 @@ mod manpage; const LONG_VERSION: &str = concat!( env!("CARGO_PKG_VERSION"), "\n\n", - include_str!("../../docs/ascii_art.txt"), + include_str!("ascii_art.txt"), ); #[derive(Parser)]