File: Makefile

package info (click to toggle)
rustc-web 1.78.0%2Bdfsg1-2~deb11u3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,245,360 kB
  • sloc: xml: 147,985; javascript: 18,022; sh: 11,083; python: 10,265; ansic: 6,172; cpp: 5,023; asm: 4,390; makefile: 4,269
file content (49 lines) | stat: -rw-r--r-- 1,648 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
include ../tools.mk

# This test makes sure that changes to files referenced via #[debugger_visualizer]
# are picked up when compiling incrementally.

# We have to copy the source to $(TMPDIR) because Github CI mounts the source
# directory as readonly. We need to apply modifications to some of the source
# file.
SRC_DIR := $(TMPDIR)/src
INCR_CACHE_DIR := $(TMPDIR)/incremental

all:
	rm -rf $(TMPDIR)/*
	mkdir $(SRC_DIR)
	cp ./foo.rs $(SRC_DIR)
	echo "GDB script v1" > $(SRC_DIR)/foo.py
	echo "Natvis v1" > $(SRC_DIR)/foo.natvis
	$(RUSTC) $(SRC_DIR)/foo.rs \
	  --crate-type=rlib \
	  --emit metadata \
	  -C incremental=$(INCR_CACHE_DIR) \
	  -Z incremental-verify-ich
	$(CGREP) "GDB script v1" < $(TMPDIR)/libfoo.rmeta
	$(CGREP) "Natvis v1" < $(TMPDIR)/libfoo.rmeta

	# Change only the GDB script and check that the change has been picked up
	echo "GDB script v2" > $(SRC_DIR)/foo.py
	$(RUSTC) $(SRC_DIR)/foo.rs \
	  --crate-type=rlib \
	  --emit metadata \
	  -C incremental=$(INCR_CACHE_DIR) \
	  -Z incremental-verify-ich

	$(CGREP) "GDB script v2" < $(TMPDIR)/libfoo.rmeta
	$(CGREP) -v "GDB script v1" < $(TMPDIR)/libfoo.rmeta
	$(CGREP) "Natvis v1" < $(TMPDIR)/libfoo.rmeta

	# Now change the Natvis version and check that the change has been picked up
	echo "Natvis v2" > $(SRC_DIR)/foo.natvis
	$(RUSTC) $(SRC_DIR)/foo.rs \
	  --crate-type=rlib \
	  --emit metadata \
	  -C incremental=$(INCR_CACHE_DIR) \
	  -Z incremental-verify-ich

	$(CGREP) "GDB script v2" < $(TMPDIR)/libfoo.rmeta
	$(CGREP) -v "GDB script v1" < $(TMPDIR)/libfoo.rmeta
	$(CGREP) "Natvis v2" < $(TMPDIR)/libfoo.rmeta
	$(CGREP) -v "Natvis v1" < $(TMPDIR)/libfoo.rmeta