forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#87320 - danakj:debug-compilation-dir, r=mic…
…haelwoerister Introduce -Z remap-cwd-prefix switch This switch remaps any absolute paths rooted under the current working directory to a new value. This includes remapping the debug info in `DW_AT_comp_dir` and `DW_AT_decl_file`. Importantly, this flag does not require passing the current working directory to the compiler, such that the command line can be run on any machine (with the same input files) and produce the same results. This is critical property for debugging compiler issues that crop up on remote machines. This is based on adetaylor's rust-lang@dbc4ae7 Major Change Proposal: rust-lang/compiler-team#450 Discussed on rust-lang#38322. Would resolve issue rust-lang#87325.
- Loading branch information
Showing
5 changed files
with
81 additions
and
3 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
24 changes: 24 additions & 0 deletions
24
src/doc/unstable-book/src/compiler-flags/remap-cwd-prefix.md
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,24 @@ | ||
# `remap-cwd-prefix` | ||
|
||
The tracking issue for this feature is: [#87325](https://github.com/rust-lang/rust/issues/87325). | ||
|
||
------------------------ | ||
|
||
This flag will rewrite absolute paths under the current working directory, | ||
replacing the current working directory prefix with a specified value. | ||
|
||
The given value may be absolute or relative, or empty. This switch takes | ||
precidence over `--remap-path-prefix` in case they would both match a given | ||
path. | ||
|
||
This flag helps to produce deterministic output, by removing the current working | ||
directory from build output, while allowing the command line to be universally | ||
reproducible, such that the same execution will work on all machines, regardless | ||
of build environment. | ||
|
||
## Example | ||
```sh | ||
# This would produce an absolute path to main.rs in build outputs of | ||
# "./main.rs". | ||
rustc -Z remap-cwd-prefix=. main.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