2022-08-22 19:00:00 -05:00
|
|
|
include ../tools.mk
|
2021-05-15 13:35:10 -05:00
|
|
|
|
2021-08-24 07:21:27 -05:00
|
|
|
# ignore-windows
|
|
|
|
|
2023-10-04 06:16:59 -05:00
|
|
|
ifeq ($(UNAME),Darwin)
|
|
|
|
DEBUGINFOOPTS := -Csplit-debuginfo=off
|
|
|
|
else
|
|
|
|
DEBUGINFOOPTS :=
|
|
|
|
endif
|
|
|
|
|
|
|
|
all: remap remap-with-scope
|
|
|
|
|
2021-05-15 13:35:10 -05:00
|
|
|
# Checks if remapping works if the remap-from string contains path to the working directory plus more
|
2023-10-04 06:16:59 -05:00
|
|
|
remap:
|
2021-05-15 13:35:10 -05:00
|
|
|
$(RUSTC) --remap-path-prefix $$PWD/auxiliary=/the/aux --crate-type=lib --emit=metadata auxiliary/lib.rs
|
2021-08-19 13:04:46 -05:00
|
|
|
grep "/the/aux/lib.rs" $(TMPDIR)/liblib.rmeta || exit 1
|
2021-05-15 13:35:10 -05:00
|
|
|
! grep "$$PWD/auxiliary" $(TMPDIR)/liblib.rmeta || exit 1
|
2023-08-25 04:32:30 -05:00
|
|
|
|
2023-10-04 06:16:59 -05:00
|
|
|
remap-with-scope:
|
|
|
|
$(RUSTC) --remap-path-prefix $$PWD/auxiliary=/the/aux -Zremap-path-scope=object $(DEBUGINFOOPTS) --crate-type=lib --emit=metadata auxiliary/lib.rs
|
2023-08-25 04:32:30 -05:00
|
|
|
grep "/the/aux/lib.rs" $(TMPDIR)/liblib.rmeta || exit 1
|
|
|
|
! grep "$$PWD/auxiliary" $(TMPDIR)/liblib.rmeta || exit 1
|
|
|
|
|
2024-03-19 07:51:22 -05:00
|
|
|
$(RUSTC) --remap-path-prefix $$PWD/auxiliary=/the/aux -Zremap-path-scope=macro $(DEBUGINFOOPTS) --crate-type=lib --emit=metadata auxiliary/lib.rs
|
|
|
|
grep "/the/aux/lib.rs" $(TMPDIR)/liblib.rmeta || exit 1
|
|
|
|
! grep "$$PWD/auxiliary" $(TMPDIR)/liblib.rmeta || exit 1
|
2023-08-25 04:32:30 -05:00
|
|
|
|
2023-10-04 06:16:59 -05:00
|
|
|
$(RUSTC) --remap-path-prefix $$PWD/auxiliary=/the/aux -Zremap-path-scope=diagnostics,object $(DEBUGINFOOPTS) --crate-type=lib --emit=metadata auxiliary/lib.rs
|
2023-08-25 04:32:30 -05:00
|
|
|
grep "/the/aux/lib.rs" $(TMPDIR)/liblib.rmeta || exit 1
|
|
|
|
! grep "$$PWD/auxiliary" $(TMPDIR)/liblib.rmeta || exit 1
|