rustc: Don't error on the rlib symlinks
This commit implements a layman's version of realpath() for metadata::loader to use in order to not error on symlinks pointing to the same file. Closes #12459
This commit is contained in:
parent
043c972179
commit
8922fa0122
4 changed files with 49 additions and 2 deletions
7
src/test/run-make/symlinked-libraries/Makefile
Normal file
7
src/test/run-make/symlinked-libraries/Makefile
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTC) foo.rs
|
||||
mkdir -p $(TMPDIR)/other
|
||||
ln -nsf $(TMPDIR)/$(call DYLIB_GLOB,foo) $(TMPDIR)/other
|
||||
$(RUSTC) bar.rs -L $(TMPDIR)/other
|
||||
15
src/test/run-make/symlinked-libraries/bar.rs
Normal file
15
src/test/run-make/symlinked-libraries/bar.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern crate foo;
|
||||
|
||||
fn main() {
|
||||
foo::bar();
|
||||
}
|
||||
13
src/test/run-make/symlinked-libraries/foo.rs
Normal file
13
src/test/run-make/symlinked-libraries/foo.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[crate_type = "dylib"];
|
||||
|
||||
pub fn bar() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue