From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/run-make/issue-85019-moved-src-dir/Makefile | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/run-make/issue-85019-moved-src-dir/Makefile (limited to 'tests/run-make/issue-85019-moved-src-dir/Makefile') diff --git a/tests/run-make/issue-85019-moved-src-dir/Makefile b/tests/run-make/issue-85019-moved-src-dir/Makefile new file mode 100644 index 000000000..3606d4fdf --- /dev/null +++ b/tests/run-make/issue-85019-moved-src-dir/Makefile @@ -0,0 +1,28 @@ +include ../../run-make-fulldeps/tools.mk + +INCR=$(TMPDIR)/incr +FIRST_SRC=$(TMPDIR)/first_src +SECOND_SRC=$(TMPDIR)/second_src + +# ignore-none no-std is not supported +# ignore-nvptx64-nvidia-cuda FIXME: can't find crate for 'std' + +# Tests that we don't get an ICE when the working directory +# (but not the build directory!) changes between compilation +# sessions + +all: + mkdir $(INCR) + # Build from 'FIRST_SRC' + mkdir $(FIRST_SRC) + cp my_lib.rs $(FIRST_SRC)/my_lib.rs + cp main.rs $(FIRST_SRC)/main.rs + cd $(FIRST_SRC) && \ + $(RUSTC) -C incremental=$(INCR) --crate-type lib my_lib.rs --target $(TARGET) && \ + $(RUSTC) -C incremental=$(INCR) --extern my_lib=$(TMPDIR)/libmy_lib.rlib main.rs --target $(TARGET) + # Build from 'SECOND_SRC', keeping the output directory and incremental directory + # the same + mv $(FIRST_SRC) $(SECOND_SRC) + cd $(SECOND_SRC) && \ + $(RUSTC) -C incremental=$(INCR) --crate-type lib my_lib.rs --target $(TARGET) && \ + $(RUSTC) -C incremental=$(INCR) --extern my_lib=$(TMPDIR)/libmy_lib.rlib main.rs --target $(TARGET) -- cgit v1.2.3