Skip to content

Commit 9c0af53

Browse files
committed
fix: remove unsupported embedded workspace check from cargo pkgid command
Signed-off-by: Rustin170506 <[email protected]>
1 parent addcc8c commit 9c0af53

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/bin/cargo/commands/pkgid.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@ pub fn cli() -> Command {
1818

1919
pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
2020
let ws = args.workspace(gctx)?;
21-
if ws.root_maybe().is_embedded() {
22-
return Err(anyhow::format_err!(
23-
"{} is unsupported by `cargo pkgid`",
24-
ws.root_manifest().display()
25-
)
26-
.into());
27-
}
2821
if args.is_present_with_zero_values("package") {
2922
print_available_packages(&ws)?
3023
}

tests/testsuite/script.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,12 +1303,19 @@ fn cmd_pkgid_with_embedded() {
13031303
.file("script.rs", ECHO_SCRIPT)
13041304
.build();
13051305

1306+
p.cargo("-Zscript build --manifest-path script.rs")
1307+
.masquerade_as_nightly_cargo(&["script"])
1308+
.run();
1309+
1310+
// FIXME: It should be `path+[ROOTURL]/foo#[email protected]`.
13061311
p.cargo("-Zscript pkgid --manifest-path script.rs")
13071312
.masquerade_as_nightly_cargo(&["script"])
1308-
.with_status(101)
1313+
.with_stdout_data(str![[r#"
1314+
path+[ROOTURL]/foo#[email protected]
1315+
1316+
"#]])
13091317
.with_stderr_data(str![[r#"
13101318
[WARNING] `package.edition` is unspecified, defaulting to `2024`
1311-
[ERROR] [ROOT]/foo/script.rs is unsupported by `cargo pkgid`
13121319
13131320
"#]])
13141321
.run();

0 commit comments

Comments
 (0)