Skip to content

Commit 0b59e5c

Browse files
committed
Replace debuginfo with split-debuginfo option
1 parent 8e33a46 commit 0b59e5c

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

text/3127-trim-paths.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,17 @@ should support finer grained control over paths in which contexts should be rema
8888

8989
### `--remap-path-scope`: configure the scope of path remapping
9090

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.
9292
The `--remap-path-scope` argument can be used in conjunction with `--remap-path-prefix` to determine paths in which output context should be affected.
9393
This flag accepts a comma-separated list of values and may be specified multiple times. The valid scopes are:
9494

9595
- `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
9996
- `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).
100102

101103
## Cargo
102104

@@ -150,7 +152,7 @@ If `trim-path` is `object`, then `--remap-path-scope=macro,unsplit-debuginfo,spl
150152

151153
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.
152154

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).
154156

155157

156158
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/.
241243
# Future possibilities
242244
[future-possibilities]: #future-possibilities
243245

246+
## Per-mapping scope control
244247
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
247250
existing `--remap-path-prefix` option to take in this new syntax.
248251

249252
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

Comments
 (0)