Skip to content

Commit bde7aff

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 871842a commit bde7aff

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
@@ -718,9 +718,12 @@ def _get_apple_active_swiftc():
718718
def _apple_swift_patch(compile_args: typing.List[str]):
719719
"""De-Bazel(rule_swift) the command into something sourcekit-lsp can parse."""
720720

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

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

0 commit comments

Comments
 (0)