Skip to content

Commit 933da97

Browse files
authored
Rollup merge of rust-lang#142301 - Gelbpunkt:duplicated-path-in-error-musl, r=workingjubilee,fmease,jieyouxu
tests: Fix duplicated-path-in-error fail with musl musl's dlopen returns a different error than glibc, which contains the name of the file. This would cause the test to fail, since the filename would appear twice in the output (once in the error from rustc, once in the error message from musl). Split the expected test outputs for the different libc implementations. Fixes rust-lang#128474
2 parents 855e0fe + 3ffd47d commit 933da97

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

src/tools/compiletest/src/directive-list.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
206206
"only-mips64",
207207
"only-msp430",
208208
"only-msvc",
209+
"only-musl",
209210
"only-nightly",
210211
"only-nvptx64",
211212
"only-powerpc",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
error: couldn't load codegen backend /non-existing-one.so: Error loading shared library /non-existing-one.so: No such file or directory
2+

tests/ui/codegen/duplicated-path-in-error.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
//@ revisions: musl gnu
12
//@ only-linux
23
//@ compile-flags: -Zcodegen-backend=/non-existing-one.so
4+
//@[gnu] only-gnu
5+
//@[musl] only-musl
36

47
// This test ensures that the error of the "not found dylib" doesn't duplicate
58
// the path of the dylib.
9+
//
10+
// glibc and musl have different dlopen error messages, so the expected error
11+
// message differs between the two.
612

713
fn main() {}
814

0 commit comments

Comments
 (0)