From e97266a1284b5fb511d956ddff74a150794af890 Mon Sep 17 00:00:00 2001 From: Oneirical Date: Thu, 11 Jul 2024 14:48:33 -0400 Subject: [PATCH] Rewrite and rename issue-26006 to rmake --- .../tidy/src/allowed_run_make_makefiles.txt | 1 - .../in/libc/lib.rs | 0 .../in/time/lib.rs | 0 .../invalid-symlink-search-path/rmake.rs | 24 +++++++++++++++++++ tests/run-make/issue-26006/Makefile | 17 ------------- 5 files changed, 24 insertions(+), 18 deletions(-) rename tests/run-make/{issue-26006 => invalid-symlink-search-path}/in/libc/lib.rs (100%) rename tests/run-make/{issue-26006 => invalid-symlink-search-path}/in/time/lib.rs (100%) create mode 100644 tests/run-make/invalid-symlink-search-path/rmake.rs delete mode 100644 tests/run-make/issue-26006/Makefile diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index af2d6aab98125..92e7a7f8f26ae 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -50,7 +50,6 @@ run-make/issue-14698/Makefile run-make/issue-15460/Makefile run-make/issue-18943/Makefile run-make/issue-25581/Makefile -run-make/issue-26006/Makefile run-make/issue-28595/Makefile run-make/issue-33329/Makefile run-make/issue-35164/Makefile diff --git a/tests/run-make/issue-26006/in/libc/lib.rs b/tests/run-make/invalid-symlink-search-path/in/libc/lib.rs similarity index 100% rename from tests/run-make/issue-26006/in/libc/lib.rs rename to tests/run-make/invalid-symlink-search-path/in/libc/lib.rs diff --git a/tests/run-make/issue-26006/in/time/lib.rs b/tests/run-make/invalid-symlink-search-path/in/time/lib.rs similarity index 100% rename from tests/run-make/issue-26006/in/time/lib.rs rename to tests/run-make/invalid-symlink-search-path/in/time/lib.rs diff --git a/tests/run-make/invalid-symlink-search-path/rmake.rs b/tests/run-make/invalid-symlink-search-path/rmake.rs new file mode 100644 index 0000000000000..c387fef07cf92 --- /dev/null +++ b/tests/run-make/invalid-symlink-search-path/rmake.rs @@ -0,0 +1,24 @@ +// In this test, the symlink created is invalid (valid relative to the root, but not +// relatively to where it is located), and used to cause an internal +// compiler error (ICE) when passed as a library search path. This was fixed in #26044, +// and this test checks that the invalid symlink is instead simply ignored. +// See https://github.com/rust-lang/rust/issues/26006 + +//FIXME(Oneirical): try it on test-various and windows + +use run_make_support::{create_symlink, fs_wrapper, rustc}; + +fn main() { + fs_wrapper::create_dir("out"); + fs_wrapper::create_dir("out/libc"); + rustc() + .input("in/libc/lib.rs") + .crate_name("libc") + .metadata("foo") + .output("out/libc/liblibc.rlib") + .run(); + fs_wrapper::create_dir("out/time"); + fs_wrapper::create_dir("out/time/deps"); + create_symlink("out/libc/liblibc.rlib", "out/time/deps"); + rustc().input("in/time/lib.rs").library_search_path("dependency=out/time/deps").run(); +} diff --git a/tests/run-make/issue-26006/Makefile b/tests/run-make/issue-26006/Makefile deleted file mode 100644 index b679c121530ad..0000000000000 --- a/tests/run-make/issue-26006/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# ignore-cross-compile -include ../tools.mk - -# ignore-windows - -OUT := $(TMPDIR)/out - -all: time - -time: libc - mkdir -p $(OUT)/time $(OUT)/time/deps - ln -sf $(OUT)/libc/liblibc.rlib $(OUT)/time/deps/ - $(RUSTC) in/time/lib.rs -Ldependency=$(OUT)/time/deps/ - -libc: - mkdir -p $(OUT)/libc - $(RUSTC) in/libc/lib.rs --crate-name=libc -Cmetadata=foo -o $(OUT)/libc/liblibc.rlib