Skip to content

Commit e4a1794

Browse files
committed
fix: emit errors instead of warnings when glob patterns not found
1 parent e5007de commit e4a1794

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

src/cargo/ops/cargo_compile.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ impl Packages {
158158
.map(PackageIdSpec::from_package_id);
159159
specs.extend(matched_pkgs);
160160
}
161-
emit_pattern_not_found(ws, patterns, false)
162-
.or_else(|e| ws.config().shell().warn(e))?;
161+
emit_pattern_not_found(ws, patterns, false)?;
163162
specs
164163
}
165164
Packages::Default => ws

tests/testsuite/build.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3770,13 +3770,8 @@ fn build_virtual_manifest_glob_not_found() {
37703770
.build();
37713771

37723772
p.cargo("build -p bar -p '*z'")
3773-
.with_stderr(
3774-
"\
3775-
[WARNING] package pattern(s) `*z` not found in workspace [..]
3776-
[COMPILING] bar v0.1.0 ([..])
3777-
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
3778-
",
3779-
)
3773+
.with_status(101)
3774+
.with_stderr("[ERROR] package pattern(s) `*z` not found in workspace [..]")
37803775
.run();
37813776
}
37823777

tests/testsuite/test.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3033,9 +3033,8 @@ fn test_virtual_manifest_glob_not_found() {
30333033
.build();
30343034

30353035
p.cargo("test -p bar -p '*z'")
3036-
.with_stderr_contains("[WARNING] package pattern(s) `*z` not found in workspace [..]")
3037-
.with_stdout_contains("running 1 test\ntest bar ... ok")
3038-
.with_stdout_does_not_contain("running 1 test\ntest baz ... ok")
3036+
.with_status(101)
3037+
.with_stderr("[ERROR] package pattern(s) `*z` not found in workspace [..]")
30393038
.run();
30403039
}
30413040

0 commit comments

Comments
 (0)