From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../many-crates-but-no-match/Makefile | 35 ++++++++++++++++++++++ .../many-crates-but-no-match/crateA1.rs | 4 +++ .../many-crates-but-no-match/crateA2.rs | 4 +++ .../many-crates-but-no-match/crateA3.rs | 4 +++ .../many-crates-but-no-match/crateB.rs | 1 + .../many-crates-but-no-match/crateC.rs | 3 ++ 6 files changed, 51 insertions(+) create mode 100644 src/test/run-make-fulldeps/many-crates-but-no-match/Makefile create mode 100644 src/test/run-make-fulldeps/many-crates-but-no-match/crateA1.rs create mode 100644 src/test/run-make-fulldeps/many-crates-but-no-match/crateA2.rs create mode 100644 src/test/run-make-fulldeps/many-crates-but-no-match/crateA3.rs create mode 100644 src/test/run-make-fulldeps/many-crates-but-no-match/crateB.rs create mode 100644 src/test/run-make-fulldeps/many-crates-but-no-match/crateC.rs (limited to 'src/test/run-make-fulldeps/many-crates-but-no-match') diff --git a/src/test/run-make-fulldeps/many-crates-but-no-match/Makefile b/src/test/run-make-fulldeps/many-crates-but-no-match/Makefile new file mode 100644 index 000000000..e7268311b --- /dev/null +++ b/src/test/run-make-fulldeps/many-crates-but-no-match/Makefile @@ -0,0 +1,35 @@ +-include ../tools.mk + +# Modelled after ui/changing-crates.rs test, but this one puts +# more than one (mismatching) candidate crate into the search path, +# which did not appear directly expressible in UI testing infrastructure. +# +# Note that we move the built libraries into target direcrtories rather than +# use the `--out-dir` option because the `../tools.mk` file already bakes a +# use of `--out-dir` into the definition of $(RUSTC). + +A1=$(TMPDIR)/a1 +A2=$(TMPDIR)/a2 +A3=$(TMPDIR)/a3 + +# A hack to match distinct lines of output from a single run. +LOG=$(TMPDIR)/log.txt + +all: + mkdir -p $(A1) $(A2) $(A3) + $(RUSTC) --crate-type=rlib crateA1.rs + mv $(TMPDIR)/$(call RLIB_GLOB,crateA) $(A1) + $(RUSTC) --crate-type=rlib -L $(A1) crateB.rs + $(RUSTC) --crate-type=rlib crateA2.rs + mv $(TMPDIR)/$(call RLIB_GLOB,crateA) $(A2) + $(RUSTC) --crate-type=rlib crateA3.rs + mv $(TMPDIR)/$(call RLIB_GLOB,crateA) $(A3) + # Ensure crateC fails to compile since A1 is "missing" and A2/A3 hashes do not match + $(RUSTC) -L $(A2) -L $(A3) crateC.rs >$(LOG) 2>&1 || true + $(CGREP) \ + 'found possibly newer version of crate `crateA` which `crateB` depends on' \ + 'note: perhaps that crate needs to be recompiled?' \ + 'crate `crateA`:' \ + 'crate `crateB`:' \ + < $(LOG) + # the 'crate `crateA`' will match two entries. diff --git a/src/test/run-make-fulldeps/many-crates-but-no-match/crateA1.rs b/src/test/run-make-fulldeps/many-crates-but-no-match/crateA1.rs new file mode 100644 index 000000000..3fed5a38e --- /dev/null +++ b/src/test/run-make-fulldeps/many-crates-but-no-match/crateA1.rs @@ -0,0 +1,4 @@ +#![crate_name="crateA"] + +// Base crate +pub fn func() {} diff --git a/src/test/run-make-fulldeps/many-crates-but-no-match/crateA2.rs b/src/test/run-make-fulldeps/many-crates-but-no-match/crateA2.rs new file mode 100644 index 000000000..8db07a015 --- /dev/null +++ b/src/test/run-make-fulldeps/many-crates-but-no-match/crateA2.rs @@ -0,0 +1,4 @@ +#![crate_name="crateA"] + +// Base crate +pub fn func() { println!("hello"); } diff --git a/src/test/run-make-fulldeps/many-crates-but-no-match/crateA3.rs b/src/test/run-make-fulldeps/many-crates-but-no-match/crateA3.rs new file mode 100644 index 000000000..a1e8e40a3 --- /dev/null +++ b/src/test/run-make-fulldeps/many-crates-but-no-match/crateA3.rs @@ -0,0 +1,4 @@ +#![crate_name="crateA"] + +// Base crate +pub fn foo() { println!("world!"); } diff --git a/src/test/run-make-fulldeps/many-crates-but-no-match/crateB.rs b/src/test/run-make-fulldeps/many-crates-but-no-match/crateB.rs new file mode 100644 index 000000000..4ccd65d65 --- /dev/null +++ b/src/test/run-make-fulldeps/many-crates-but-no-match/crateB.rs @@ -0,0 +1 @@ +extern crate crateA; diff --git a/src/test/run-make-fulldeps/many-crates-but-no-match/crateC.rs b/src/test/run-make-fulldeps/many-crates-but-no-match/crateC.rs new file mode 100644 index 000000000..a8b817ec6 --- /dev/null +++ b/src/test/run-make-fulldeps/many-crates-but-no-match/crateC.rs @@ -0,0 +1,3 @@ +extern crate crateB; + +fn main() {} -- cgit v1.2.3