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
+10-7Lines changed: 10 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,15 +88,17 @@ should support finer grained control over paths in which contexts should be rema
88
88
89
89
### `--remap-path-scope`: configure the scope of path remapping
90
90
91
-
When the `--remap-path-prefix` option is passed to rustc then source path prefixes in all output will be affected.
91
+
When the `--remap-path-prefix` option is passed to rustc, source path prefixes in all output will be affected by default.
92
92
The `--remap-path-scope` argument can be used in conjunction with `--remap-path-prefix` to determine paths in which output context should be affected.
93
93
This flag accepts a comma-separated list of values and may be specified multiple times. The valid scopes are:
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
-
-`debuginfo` - apply remappings to debug information, wherever they may be written to
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
99
96
-`diagnostics` - apply remappings to printed compiler diagnostics
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` - apply remappings to debug information only when they are written to split debug information files, but not in compiled executables or libraries
99
+
-`split-debuginfo-file` - apply remappings to the paths pointing to split debug information files. Does nothing when these files are not generated.
100
+
101
+
Debug information are written to split files when the separate codegen option `-C split-debuginfo=packed` or `unpacked` (whether by default or explicitly set).
100
102
101
103
## Cargo
102
104
@@ -150,7 +152,7 @@ If `trim-path` is `object`, then `--remap-path-scope=macro,unsplit-debuginfo,spl
150
152
151
153
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.
152
154
153
-
If `trim-path` is `all` (`true`), all paths will be affected, equivalent to `--remap-path-scope=macro,debuginfo,diagnostics,split-debuginfo-file`
155
+
If `trim-path` is `all` (`true`), all paths will be affected, equivalent to `--remap-path-scope=macro,split-debuginfo,unsplit-debuginfo,diagnostics,split-debuginfo-file` (or not supplying `--remap-path-scope` at all).
154
156
155
157
156
158
Some interactions with compiler-intrinsic macros need to be considered:
@@ -241,9 +243,10 @@ the other for only debuginfo: https://reproducible-builds.org/docs/build-path/.
241
243
# Future possibilities
242
244
[future-possibilities]: #future-possibilities
243
245
246
+
## Per-mapping scope control
244
247
If it turns out that we want to enable finer grained scoping control on each individual remapping, we could use a `scopes:from=to` syntax.
245
-
E.g. `debuginfo,diagnostics:/path/to/src=src` will remove all references to `/path/to/src` from compiler diagnostics and debug information, but
246
-
they are retained panic messages. This syntax can be used with either a brand new `--remap-path-prefix-scoped` option, or we could extend the
248
+
E.g. `split-debuginfo,unsplit-debuginfo,diagnostics:/path/to/src=src` will remove all references to `/path/to/src` from compiler diagnostics and debug information, but
249
+
they are retained in panic messages. This syntax can be used with either a brand new `--remap-path-prefix-scoped` option, or we could extend the
247
250
existing `--remap-path-prefix` option to take in this new syntax.
248
251
249
252
If we were to extend the existing `--remap-path-prefix`, there may be an ambiguity to whether `:` means a separator between scope list and mapping,
0 commit comments