1
- // Crates that are resolved normally have their path canonicalized and all
2
- // symlinks resolved. This did not happen for paths specified
3
- // using the --extern option to rustc, which could lead to rustc thinking
4
- // that it encountered two different versions of a crate, when it's
5
- // actually the same version found through different paths.
6
- // See https://github.com/rust-lang/rust/pull/16505
7
-
8
- // This test checks that --extern and symlinks together
9
- // can result in successful compilation.
1
+ // Crates that are resolved normally have their path canonicalized and all symlinks resolved. This
2
+ // did not happen for paths specified using the `--extern` option to rustc, which could lead to
3
+ // rustc thinking that it encountered two different versions of a crate, when it's actually the same
4
+ // version found through different paths.
5
+ //
6
+ // This test checks that `--extern` and symlinks together can result in successful compilation.
7
+ //
8
+ // See <https://github.com/rust-lang/rust/pull/16505>.
10
9
11
10
//@ ignore-cross-compile
12
11
//@ needs-symlink
@@ -16,7 +15,8 @@ use run_make_support::{cwd, rfs, rustc};
16
15
fn main ( ) {
17
16
rustc ( ) . input ( "foo.rs" ) . run ( ) ;
18
17
rfs:: create_dir_all ( "other" ) ;
19
- rfs:: create_symlink ( "libfoo.rlib" , "other" ) ;
18
+ rfs:: symlink_file ( cwd ( ) . join ( "libfoo.rlib" ) , cwd ( ) . join ( "other" ) . join ( "libfoo.rlib" ) ) ;
19
+
20
20
rustc ( ) . input ( "bar.rs" ) . library_search_path ( cwd ( ) ) . run ( ) ;
21
- rustc ( ) . input ( "baz.rs" ) . extern_ ( "foo" , "other" ) . library_search_path ( cwd ( ) ) . run ( ) ;
21
+ rustc ( ) . input ( "baz.rs" ) . extern_ ( "foo" , "other/libfoo.rlib " ) . library_search_path ( cwd ( ) ) . run ( ) ;
22
22
}
0 commit comments