Skip to content

Commit 388cc00

Browse files
committed
Remove bazel -fdebug-prefix-map, since they're potentially confusing holdovers
1 parent 46ffd1f commit 388cc00

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

refresh.template.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,12 @@ def _all_platform_patch(compile_args: typing.List[str]):
775775
# Seems to have disappeared when we switched to aquery from action_listeners, but we'll leave it in until the bug is patched in case we start using C++ modules
776776
compile_args = (arg for arg in compile_args if not arg.startswith('-fmodules-cache-path=bazel-out/'))
777777

778+
# We're transfering the commands as though they were compiled in place in the workspace; no need for prefix maps, so we'll remove them. This eliminates some postentially confusing Bazel variables, though I think clangd just ignores them anyway.
779+
# Some example:
780+
# -fdebug-prefix-map=__BAZEL_EXECUTION_ROOT__=.
781+
# -fdebug-prefix-map=__BAZEL_XCODE_DEVELOPER_DIR__=/PLACEHOLDER_DEVELOPER_DIR
782+
compile_args = (arg for arg in compile_args if not arg.startswith('-fdebug-prefix-map'))
783+
778784
# When Bazel builds with gcc it adds -fno-canonical-system-headers to the command line, which clang tooling chokes on, since it does not understand this flag.
779785
# We'll remove this flag, until such time as clangd & clang-tidy gracefully ignore it. Tracking issues: https://github.com/clangd/clangd/issues/1004 and https://github.com/llvm/llvm-project/issues/61699.
780786
# For more context see: https://github.com/hedronvision/bazel-compile-commands-extractor/issues/21

0 commit comments

Comments
 (0)