about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-02-22 10:45:44 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-02-24 21:22:25 -0800
commit8922fa01228f5161aa0ebd714f86f2712a3c7ea8 (patch)
treee9a7966a6bc9c9b11e644931d56433a8c05de7dc /src/test
parent043c9721791731bbf7b9d8be354a65ed25b9a6d9 (diff)
downloadrust-8922fa01228f5161aa0ebd714f86f2712a3c7ea8.tar.gz
rust-8922fa01228f5161aa0ebd714f86f2712a3c7ea8.zip
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
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-make/symlinked-libraries/Makefile7
-rw-r--r--src/test/run-make/symlinked-libraries/bar.rs15
-rw-r--r--src/test/run-make/symlinked-libraries/foo.rs13
3 files changed, 35 insertions, 0 deletions
diff --git a/src/test/run-make/symlinked-libraries/Makefile b/src/test/run-make/symlinked-libraries/Makefile
new file mode 100644
index 00000000000..45ef241c28f
--- /dev/null
+++ b/src/test/run-make/symlinked-libraries/Makefile
@@ -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
diff --git a/src/test/run-make/symlinked-libraries/bar.rs b/src/test/run-make/symlinked-libraries/bar.rs
new file mode 100644
index 00000000000..73596f93f56
--- /dev/null
+++ b/src/test/run-make/symlinked-libraries/bar.rs
@@ -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();
+}
diff --git a/src/test/run-make/symlinked-libraries/foo.rs b/src/test/run-make/symlinked-libraries/foo.rs
new file mode 100644
index 00000000000..9fbe36f0376
--- /dev/null
+++ b/src/test/run-make/symlinked-libraries/foo.rs
@@ -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() {}