From 653025fdd53b9893386c6fcfbd6a4ac858243e80 Mon Sep 17 00:00:00 2001 From: Joe Neeman Date: Wed, 21 Aug 2024 10:52:40 +0700 Subject: [PATCH 1/2] Add test for package filtering with old edition --- tests/testsuite/package.rs | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/tests/testsuite/package.rs b/tests/testsuite/package.rs index 7b937ca53b9..42a7e7d93cc 100644 --- a/tests/testsuite/package.rs +++ b/tests/testsuite/package.rs @@ -6500,3 +6500,48 @@ Caused by: "#]]) .run(); } + +#[cargo_test] +fn in_package_workspace_with_members_with_features_old() { + let p = project() + .file( + "Cargo.toml", + r#" + [package] + name = "foo" + version = "0.1.0" + edition = "2015" + [workspace] + members = ["li"] + "#, + ) + .file("src/main.rs", "fn main() {}") + .file( + "li/Cargo.toml", + r#" + [package] + name = "li" + version = "0.0.1" + edition = "2015" + rust-version = "1.69" + description = "li" + license = "MIT" + "#, + ) + .file("li/src/main.rs", "fn main() {}") + .build(); + + p.cargo("package -p li --no-verify") + .with_stderr_data(str![[r#" +[WARNING] manifest has no description, license, license-file, documentation, homepage or repository. +See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info. +[PACKAGING] foo v0.1.0 ([ROOT]/foo) +[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed) +[WARNING] manifest has no documentation, homepage or repository. +See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info. +[PACKAGING] li v0.0.1 ([ROOT]/foo/li) +[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed) + +"#]]) + .run(); +} From 4110b844fb1e7a3ff4adb112270b410f15629d4c Mon Sep 17 00:00:00 2001 From: Joe Neeman Date: Wed, 21 Aug 2024 10:55:45 +0700 Subject: [PATCH 2/2] Filter package specs while packaging --- src/cargo/ops/cargo_package.rs | 6 +++++- tests/testsuite/package.rs | 4 ---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cargo/ops/cargo_package.rs b/src/cargo/ops/cargo_package.rs index aa5aca3c9e3..7a13c849704 100644 --- a/src/cargo/ops/cargo_package.rs +++ b/src/cargo/ops/cargo_package.rs @@ -187,7 +187,11 @@ pub fn package(ws: &Workspace<'_>, opts: &PackageOpts<'_>) -> CargoResult