fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.3 KiB35 linesraw
1include ../tools.mk
2
3# Modelled after ui/changing-crates.rs test, but this one puts
4# more than one (mismatching) candidate crate into the search path,
5# which did not appear directly expressible in UI testing infrastructure.
6#
7# Note that we move the built libraries into target direcrtories rather than
8# use the `--out-dir` option because the `../tools.mk` file already bakes a
9# use of `--out-dir` into the definition of $(RUSTC).
10
11A1=$(TMPDIR)/a1
12A2=$(TMPDIR)/a2
13A3=$(TMPDIR)/a3
14
15# A hack to match distinct lines of output from a single run.
16LOG=$(TMPDIR)/log.txt
17
18all:
19	mkdir -p $(A1) $(A2) $(A3)
20	$(RUSTC) --crate-type=rlib crateA1.rs
21	mv $(TMPDIR)/$(call RLIB_GLOB,crateA) $(A1)
22	$(RUSTC) --crate-type=rlib -L $(A1) crateB.rs
23	$(RUSTC) --crate-type=rlib crateA2.rs
24	mv $(TMPDIR)/$(call RLIB_GLOB,crateA) $(A2)
25	$(RUSTC) --crate-type=rlib crateA3.rs
26	mv $(TMPDIR)/$(call RLIB_GLOB,crateA) $(A3)
27	# Ensure crateC fails to compile since A1 is "missing" and A2/A3 hashes do not match
28	$(RUSTC) -L $(A2) -L $(A3) crateC.rs >$(LOG) 2>&1 || true
29	$(CGREP) \
30		'found possibly newer version of crate `crateA` which `crateB` depends on' \
31		'note: perhaps that crate needs to be recompiled?' \
32		'crate `crateA`:' \
33		'crate `crateB`:' \
34		< $(LOG)
35	# the 'crate `crateA`' will match two entries.