Skip to content

Commit 129d530

Browse files
author
Tamas Vajk
committed
Fix comment: remap-path-prefix does not affect file!()
Update the comment to accurately list what --remap-path-prefix affects: debug info, dep-info, panic locations, and backtraces.
1 parent 4f584fb commit 129d530

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

rust/private/rustc.bzl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,9 +1115,9 @@ def construct_arguments(
11151115

11161116
# For determinism to help with build distribution and such
11171117
#
1118-
# --remap-path-prefix tells rustc to replace a path prefix in all output
1119-
# (diagnostics, file!(), panic locations, backtraces) so that absolute
1120-
# sandbox paths never leak into binaries or logs.
1118+
# --remap-path-prefix tells rustc to replace a path prefix in all
1119+
# embedded paths (debug info, dep-info, panic locations, backtraces)
1120+
# so that absolute sandbox paths never leak into binaries or logs.
11211121
#
11221122
# When all sources are plain workspace files, remapping ${pwd} (the exec
11231123
# root) to remap_path_prefix (default ".") is enough.
@@ -1127,8 +1127,9 @@ def construct_arguments(
11271127
# bazel-out/<config>/bin/... so they sit next to the generated files. In
11281128
# that case the crate root is no longer a source file and its path starts
11291129
# with ctx.bin_dir.path (e.g. "bazel-out/k8-fastbuild/bin"). We detect
1130-
# this via crate_info.root.is_source and add a more specific remap that
1131-
# also strips the bin-dir component, giving clean workspace-relative paths.
1130+
# this via crate_info.root.is_source and use a more specific remap that
1131+
# also strips the bin-dir component, giving clean workspace-relative paths
1132+
# in panic messages and backtraces.
11321133
if remap_path_prefix != None:
11331134
if crate_info.root.is_source:
11341135
rustc_flags.add("--remap-path-prefix=${{pwd}}={}".format(remap_path_prefix))

0 commit comments

Comments
 (0)