-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #114750 - Enselic:metadata-dep-info, r=compiler-errors
Make `.rmeta` file in `dep-info` have correct name (`lib` prefix) Since `filename_for_metadata()` and `OutputFilenames::path(OutputType::Metadata)` had different logic for the name of the metadata file, the `.d` file contained a file name different from the actual name used. Share the logic to fix the out-of-sync name. Without this fix, the `.d` file contained dash-separated_something-extra.rmeta: dash-separated.rs instead of libdash_separated_something-extra.rmeta: dash-separated.rs which is the name of the file that is actually written by the compiler. Worth noting: It took me several iterations to get all tests to pass, so I am relatively confident that this PR does not break anything. Closes #68839
- Loading branch information
Showing
7 changed files
with
49 additions
and
28 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
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,13 @@ | ||
include ../tools.mk | ||
|
||
ifdef RUSTC_BLESS_TEST | ||
RUSTC_TEST_OP = cp | ||
else | ||
RUSTC_TEST_OP = $(DIFF) | ||
endif | ||
|
||
all: | ||
$(RUSTC) --emit=metadata,dep-info --crate-type lib dash-separated.rs -C extra-filename=_something-extra | ||
# Strip TMPDIR since it is a machine specific absolute path | ||
sed "s%.*[/\\]%%" "$(TMPDIR)"/dash-separated_something-extra.d > "$(TMPDIR)"/dash-separated_something-extra.normalized.d | ||
$(RUSTC_TEST_OP) "$(TMPDIR)"/dash-separated_something-extra.normalized.d dash-separated_something-extra.normalized.d |
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,4 @@ | ||
//! It is important that this file has at least one `-` in the file name since | ||
//! we want to test that it becomes a `_` when appropriate. | ||
|
||
pub struct Foo; |
5 changes: 5 additions & 0 deletions
5
tests/run-make/metadata-dep-info/dash-separated_something-extra.normalized.d
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,5 @@ | ||
libdash_separated_something-extra.rmeta: dash-separated.rs | ||
|
||
dash-separated_something-extra.d: dash-separated.rs | ||
|
||
dash-separated.rs: |