From cd0d424c56b08f1dff2e7fa721bdbe4d744bb626 Mon Sep 17 00:00:00 2001 From: Haquant <76264891+Steeve-Crypto@users.noreply.github.com> Date: Sun, 11 Oct 2026 18:17:08 -0400 Subject: [PATCH 1/2] fix: ship LICENSE in crates --- crates/rmcp-macros/LICENSE | 1 + crates/rmcp/LICENSE | 1 + crates/rmcp/tests/test_package_license.rs | 28 +++++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 120000 crates/rmcp-macros/LICENSE create mode 120000 crates/rmcp/LICENSE create mode 100644 crates/rmcp/tests/test_package_license.rs diff --git a/crates/rmcp-macros/LICENSE b/crates/rmcp-macros/LICENSE new file mode 120000 index 000000000..30cff7403 --- /dev/null +++ b/crates/rmcp-macros/LICENSE @@ -0,0 +1 @@ +../../LICENSE \ No newline at end of file diff --git a/crates/rmcp/LICENSE b/crates/rmcp/LICENSE new file mode 120000 index 000000000..30cff7403 --- /dev/null +++ b/crates/rmcp/LICENSE @@ -0,0 +1 @@ +../../LICENSE \ No newline at end of file diff --git a/crates/rmcp/tests/test_package_license.rs b/crates/rmcp/tests/test_package_license.rs new file mode 100644 index 000000000..cbb6b8459 --- /dev/null +++ b/crates/rmcp/tests/test_package_license.rs @@ -0,0 +1,28 @@ +//! The published crates must ship the repository LICENSE (see #1335). +//! `cargo package` only picks up files inside the crate directory, so each +//! crate keeps a LICENSE symlink to the workspace root file. + +use std::path::Path; + +fn assert_crate_license(crate_dir: &Path) { + let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("../.."); + let expected = std::fs::read_to_string(root.join("LICENSE")).expect("root LICENSE"); + let actual = std::fs::read_to_string(crate_dir.join("LICENSE")) + .unwrap_or_else(|e| panic!("{} has no LICENSE: {e}", crate_dir.display())); + assert_eq!( + actual, + expected, + "{}/LICENSE differs from root", + crate_dir.display() + ); +} + +#[test] +fn rmcp_crate_ships_license() { + assert_crate_license(Path::new(env!("CARGO_MANIFEST_DIR"))); +} + +#[test] +fn rmcp_macros_crate_ships_license() { + assert_crate_license(&Path::new(env!("CARGO_MANIFEST_DIR")).join("../rmcp-macros")); +} From e0ec4aa9f07a665523f7e073441efd9ee3bb23ea Mon Sep 17 00:00:00 2001 From: Haquant <76264891+Steeve-Crypto@users.noreply.github.com> Date: Tue, 13 Oct 2026 11:17:17 -0400 Subject: [PATCH 2/2] test: keep license test out of the published package and check LICENSE in CI --- .github/workflows/ci.yml | 6 ++++++ crates/rmcp/Cargo.toml | 1 + 2 files changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3631d4226..12cc36da8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -280,6 +280,12 @@ jobs: - name: Run lib tests without default features run: cargo test -p rmcp --lib --no-default-features + - name: Check published crates ship LICENSE + run: | + for crate in rmcp rmcp-macros; do + cargo package --list -p "$crate" | grep -qx LICENSE + done + test-no-local: name: Run Tests (no local feature) runs-on: ubuntu-latest diff --git a/crates/rmcp/Cargo.toml b/crates/rmcp/Cargo.toml index 772844d86..064a64fcd 100644 --- a/crates/rmcp/Cargo.toml +++ b/crates/rmcp/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "rmcp" +exclude = ["tests/test_package_license.rs"] license = { workspace = true } version = { workspace = true } edition = { workspace = true }