Skip to content

Commit c7a4df6

Browse files
committed
https://github.com/hedronvision/bazel-compile-commands-extractor/pull/89#discussion_r1037781502
refresh.template.py: add some more explain for why need to remove the worker
1 parent f9ceaf3 commit c7a4df6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

refresh.template.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,9 +705,12 @@ def _get_apple_active_swiftc():
705705
def _apple_swift_patch(compile_args: typing.List[str]):
706706
"""De-Bazel(rule_swift) the command into something sourcekit-lsp can parse."""
707707

708-
# Remove build_bazel_rules_swift/tools/worker/worker
708+
# rules_swift add a worker for wrapping if enable --persistent_worker flag (https://bazel.build/remote/persistent)
709+
# https://github.com/bazelbuild/rules_swift/blob/master/swift/internal/actions.bzl#L236
710+
# We need to remove it (build_bazel_rules_swift/tools/worker/worker)
709711
compile_args.pop(0)
710712

713+
# The worker also expand the arguments defined in swift_rule which was start with -Xwrapped-swift
711714
# Expand -debug-prefix-pwd-is-dot
712715
match = next((i for i,v in enumerate(compile_args) if v == "-Xwrapped-swift=-debug-prefix-pwd-is-dot"), None)
713716
if match:

0 commit comments

Comments
 (0)