From 6f24454f8ceacee2564c64c8d0c992ad0532b33a Mon Sep 17 00:00:00 2001 From: Oneirical Date: Thu, 11 Jul 2024 14:01:37 -0400 Subject: [PATCH 1/2] Rewrite and rename issue-22131 to rmake --- .../tidy/src/allowed_run_make_makefiles.txt | 1 - tests/run-make/issue-22131/Makefile | 8 -------- .../foo.rs | 0 .../run-make/rustdoc-cfgspec-parsing/rmake.rs | 19 +++++++++++++++++++ 4 files changed, 19 insertions(+), 9 deletions(-) delete mode 100644 tests/run-make/issue-22131/Makefile rename tests/run-make/{issue-22131 => rustdoc-cfgspec-parsing}/foo.rs (100%) create mode 100644 tests/run-make/rustdoc-cfgspec-parsing/rmake.rs diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index 33120cf93f903..af2d6aab98125 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -49,7 +49,6 @@ run-make/issue-107094/Makefile run-make/issue-14698/Makefile run-make/issue-15460/Makefile run-make/issue-18943/Makefile -run-make/issue-22131/Makefile run-make/issue-25581/Makefile run-make/issue-26006/Makefile run-make/issue-28595/Makefile diff --git a/tests/run-make/issue-22131/Makefile b/tests/run-make/issue-22131/Makefile deleted file mode 100644 index 4f33a4659cc1e..0000000000000 --- a/tests/run-make/issue-22131/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# ignore-cross-compile -include ../tools.mk - -all: foo.rs - $(RUSTC) --cfg 'feature="bar"' --crate-type lib foo.rs - $(RUSTDOC) --test --cfg 'feature="bar"' \ - -L $(TMPDIR) foo.rs |\ - $(CGREP) 'foo.rs - foo (line 1) ... ok' diff --git a/tests/run-make/issue-22131/foo.rs b/tests/run-make/rustdoc-cfgspec-parsing/foo.rs similarity index 100% rename from tests/run-make/issue-22131/foo.rs rename to tests/run-make/rustdoc-cfgspec-parsing/foo.rs diff --git a/tests/run-make/rustdoc-cfgspec-parsing/rmake.rs b/tests/run-make/rustdoc-cfgspec-parsing/rmake.rs new file mode 100644 index 0000000000000..7cb66575c5481 --- /dev/null +++ b/tests/run-make/rustdoc-cfgspec-parsing/rmake.rs @@ -0,0 +1,19 @@ +// A rustdoc bug caused the `feature=bar` syntax for the cfg flag to be interpreted +// wrongly, with `feature=bar` instead of just `bar` being understood as the feature name. +// After this was fixed in #22135, this test checks that this bug does not make a resurgence. +// See https://github.com/rust-lang/rust/issues/22131 + +//FIXME(Oneirical): try test-various + +use run_make_support::{rustc, rustdoc}; + +fn main() { + rustc().cfg(r#"feature="bar""#).crate_type("lib").input("foo.rs").run(); + rustdoc() + .arg("--test") + .arg("--cfg") + .arg(r#"feature="bar""#) + .input("foo.rs") + .run() + .assert_stdout_contains("foo.rs - foo (line 1) ... ok"); +} From e97266a1284b5fb511d956ddff74a150794af890 Mon Sep 17 00:00:00 2001 From: Oneirical Date: Thu, 11 Jul 2024 14:48:33 -0400 Subject: [PATCH 2/2] 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