You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: text/3127-trim-paths.md
+6-8Lines changed: 6 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,8 @@ This flag accepts a comma-separated list of values and may be specified multiple
94
94
95
95
-`macro` - apply remappings to the expansion of `std::file!()` macro. This is where paths in embedded panic messages come from
96
96
-`debuginfo` - apply remappings to debug information, wherever they may be written to
97
-
-`split-debuginfo-file` - when `split-debuginfo=packed` or `unpacked`, apply remappings to the paths pointing to these split debug information files
97
+
-`unsplit-debuginfo` - apply to remappings to debug information only when they are written to compiled executables or libraries, but not when they are in split files
98
+
-`split-debuginfo-file` - apply remappings to the paths pointing to split debug information files when `split-debuginfo=packed` or `unpacked`. Does nothing when debuginfo is embedded with the compiled executables or libraries
98
99
-`diagnostics` - apply remappings to printed compiler diagnostics
99
100
100
101
## Cargo
@@ -145,12 +146,9 @@ If `trim-paths` is `1` or `2` (`true`), then two `--remap-path-prefix` arguments
145
146
146
147
A further `--remap-path-scope` is also supplied for options `1` and `2`:
147
148
148
-
If `trim-paths` is `1`, then it depends on the setting of `split-debuginfo` (whether the setting is explicitly supplied or from the default)
149
-
- If `split-debuginfo` is `off`, then `--remap-path-scope=macro,debuginfo`.
150
-
- If `split-debuginfo` is `packed` or `unpacked`, then `--remap-path-scope=macro,split-debuginfo-file`
149
+
If `trim-path` is `1`, then `--remap-path-scope=macro,unsplit-debuginfo,split-debuginfo-file`.
151
150
152
-
This is because we always want to remap panic messages as they will always be embedded in executable/library. We need to sanitise debug information
153
-
if they are embedded, but don't need to touch them if they are split. However in case they are split we need to sanitise the paths to these split files
151
+
As a result, panic messages (which are always embedded) are sanitised. If debug information is embedded, then they are sanitised; if they are split then they are kept untouched, but the paths to these split files are sanitised.
154
152
155
153
If `trim-path` is `2` (`true`), all paths will be affected, equivalent to `--remap-path-scope=macro,debuginfo,diagnostics,split-debuginfo-file`
156
154
@@ -167,7 +165,7 @@ supplied *after* Cargo's own remapping.
167
165
168
166
## Changing handling of sysroot path in `rustc`
169
167
170
-
The virtualisation of sysroot files to `/rustc/[commit hash]/library/...` was done at compiler bootstraping, specifically when
168
+
The virtualisation of sysroot files to `/rustc/[commit hash]/library/...` was done at compiler bootstrapping, specifically when
171
169
`remap-debuginfo = true` in `config.toml`. This is done for Rust distribution on all channels.
172
170
173
171
At `rustc` runtime (i.e. compiling some code), we try to correlate this virtual path to a real path pointing to the file on the local file system.
@@ -205,7 +203,7 @@ release builds. It has, over the past 4 years, gained a decent amount of popular
205
203
implement.
206
204
207
205
Path to sysroot crates are specially handled by `rustc`. Due to this, the behaviour we currently have is that all such paths are virtualised.
208
-
Although good for privacy and reproducibility, some people find it a hinderance for debugging: https://github.com/rust-lang/rust/issues/85463.
206
+
Although good for privacy and reproducibility, some people find it a hindrance for debugging: https://github.com/rust-lang/rust/issues/85463.
209
207
Hence the user should be given control on if they want the virtual or local path.
210
208
211
209
An alternative is to extend the syntax accepted by `--remap-path-prefix` or add a new option called `--remap-path-prefix-scoped` which allows
0 commit comments