Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In --emit KIND=PATH options, only hash KIND
The PATH has no material effect on the emitted artifact, and setting the patch via `-o` or `--out-dir` does not affect the hash. Closes #86044
- Loading branch information
Showing
4 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
-include ../../run-make-fulldeps/tools.mk | ||
|
||
OUT=$(TMPDIR)/emit | ||
|
||
# --emit KIND=PATH should not affect crate hash vs --emit KIND | ||
all: $(OUT)/a/libfoo.rlib $(OUT)/b/libfoo.rlib $(TMPDIR)/libfoo.rlib | ||
$(RUSTC) -Zls $(TMPDIR)/libfoo.rlib > $(TMPDIR)/base.txt | ||
$(RUSTC) -Zls $(OUT)/a/libfoo.rlib > $(TMPDIR)/a.txt | ||
$(RUSTC) -Zls $(OUT)/b/libfoo.rlib > $(TMPDIR)/b.txt | ||
|
||
diff $(TMPDIR)/base.txt $(TMPDIR)/a.txt | ||
diff $(TMPDIR)/base.txt $(TMPDIR)/b.txt | ||
|
||
# Default output name | ||
$(TMPDIR)/libfoo.rlib: foo.rs | ||
$(RUSTC) --emit link foo.rs | ||
|
||
# Output named with -o | ||
$(OUT)/a/libfoo.rlib: foo.rs | ||
mkdir -p $(OUT)/a | ||
$(RUSTC) --emit link -o $@ foo.rs | ||
|
||
# Output named with KIND=PATH | ||
$(OUT)/b/libfoo.rlib: foo.rs | ||
mkdir -p $(OUT)/b | ||
$(RUSTC) --emit link=$@ foo.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#![crate_type = "rlib"] |