From c88043e5b9eaaf690741cbe7bc629dc8d1d23627 Mon Sep 17 00:00:00 2001 From: Adin Cebic Date: Sat, 12 Sep 2026 15:12:03 +0200 Subject: [PATCH 1/4] Precise module tracking --- README.md | 3 + doc/explicit_modules.md | 37 ++ swift/internal/compiling.bzl | 6 +- swift/internal/debugging.bzl | 69 +++ swift/internal/feature_names.bzl | 9 + swift/internal/linking.bzl | 58 +-- swift/swift_binary.bzl | 6 + swift/swift_test.bzl | 6 + swift/toolchains/config/compile_config.bzl | 18 + swift/toolchains/xcode_swift_toolchain.bzl | 4 + test/debug_settings_tests.bzl | 525 +++++++++++++++++++++ test/fixtures/debug_settings/BUILD | 24 + 12 files changed, 736 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 4dcab4456..879f2d83b 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,9 @@ encountered first on your `PATH`. To make cacheable builds work correctly with debugging see [this doc](doc/debuggable_remote_swift.md). +For Xcode builds using explicit modules, see +[debugging with explicit modules](doc/explicit_modules.md#debugging). + ## Swift Package Manager Support To download, build, and reference external Swift packages as Bazel diff --git a/doc/explicit_modules.md b/doc/explicit_modules.md index 70a370e5b..746bcd555 100644 --- a/doc/explicit_modules.md +++ b/doc/explicit_modules.md @@ -40,6 +40,43 @@ would still be embedded in the swiftmodule files. This means debugging in `lldb` with explicit modules would not work with cached swiftmodules and is therefore disabled. +### Module tracking in debug info + +With Xcode 27 and newer, `swift.debug_module_path` is enabled by default. +It requires Swift 6.4 or newer compiler and debugger support, and takes +effect in `dbg` and `fastbuild` compilation modes when both +`swift.use_c_modules` and `swift.use_explicit_swift_module_map` are enabled. +Enable explicit modules as described in [Usage](#usage), including +`swift.emit_c_module`. + +The compiler writes the `.swiftmodule` path into each object file's +debug information using `-debug-module-path`. Each explicit module also +records its dependencies. LLDB uses these paths to find the module files +it needs for expression evaluation, replacing the previous `-add_ast_path` +or module-wrapping mechanism. See +[Module Tracking in Swift Debug Info](https://www.swift.org/blog/module-tracking-in-debug-info/) +for more details. + +To disable this behavior and retain the previous debug module handling, +add this to your `.bazelrc`: + +``` +build --features=-swift.debug_module_path --host_features=-swift.debug_module_path +``` + +The previous behavior is also retained when either of the explicit +module features required above is disabled. In `opt` mode, this feature +does not add debug module paths, linker inputs, or default outputs, even +if debug info is enabled manually with `-g`. + +Expression evaluation still requires the `.swiftmodule` and `.pcm` +files at their original or remapped locations. `swift_binary` and +`swift_test` include these files in their default outputs, including +private and implicit dependencies, so they are downloaded with +`--remote_download_outputs=toplevel`. If you link through other binary +rules, your build or debugger integration must make these files +available locally. + ## Using explicit dependencies By default we implicitly add all possible precompiled modules to the diff --git a/swift/internal/compiling.bzl b/swift/internal/compiling.bzl index 3c6c3bf74..040b78edd 100644 --- a/swift/internal/compiling.bzl +++ b/swift/internal/compiling.bzl @@ -34,6 +34,7 @@ load( "SWIFT_ACTION_PRECOMPILE_C_MODULE", ) load(":actions.bzl", "is_action_enabled", "run_toolchain_action") +load(":debugging.bzl", "collect_debug_module_files") load(":explicit_module_map_file.bzl", "write_explicit_swift_module_map_file") load( ":feature_names.bzl", @@ -184,8 +185,10 @@ def create_compilation_context(defines, srcs, transitive_modules): the target. Returns: - A `struct` containing four fields: + A `struct` containing the following fields: + * `debug_modules`: A depset of module files needed to import this + target's dependencies in the debugger, including private deps. * `defines`: A sequence of defines used when compiling the target. Includes the defines for the target and its transitive dependencies. * `direct_sources`: A sequence of Swift source files used to compile @@ -215,6 +218,7 @@ def create_compilation_context(defines, srcs, transitive_modules): # Tuples are used instead of lists since they need to be frozen return struct( + debug_modules = collect_debug_module_files(transitive_modules), defines = tuple(sets.to_list(defines_set)), direct_sources = tuple(srcs), module_maps = tuple(module_maps), diff --git a/swift/internal/debugging.bzl b/swift/internal/debugging.bzl index 0a59391c2..7e0a6405f 100644 --- a/swift/internal/debugging.bzl +++ b/swift/internal/debugging.bzl @@ -25,8 +25,11 @@ load( load( ":feature_names.bzl", "SWIFT_FEATURE_DBG", + "SWIFT_FEATURE_DEBUG_MODULE_PATH", "SWIFT_FEATURE_FASTBUILD", "SWIFT_FEATURE_NO_EMBED_DEBUG_MODULE", + "SWIFT_FEATURE_USE_C_MODULES", + "SWIFT_FEATURE_USE_EXPLICIT_SWIFT_MODULE_MAP", ) load(":features.bzl", "is_feature_enabled") @@ -123,8 +126,74 @@ def should_embed_swiftmodule_for_debugging( not is_feature_enabled( feature_configuration = feature_configuration, feature_name = SWIFT_FEATURE_NO_EMBED_DEBUG_MODULE, + ) and + not uses_precise_debug_module_tracking(feature_configuration) + ) + +def uses_precise_debug_module_tracking(feature_configuration): + """Returns whether precise module tracking is enabled for this build. + + Args: + feature_configuration: The Swift feature configuration. + + Returns: + True for dbg or fastbuild builds with all required module features enabled. + """ + + return _is_debugging(feature_configuration) and all([ + is_feature_enabled( + feature_configuration = feature_configuration, + feature_name = feature_name, ) + for feature_name in [ + SWIFT_FEATURE_DEBUG_MODULE_PATH, + SWIFT_FEATURE_USE_C_MODULES, + SWIFT_FEATURE_USE_EXPLICIT_SWIFT_MODULE_MAP, + ] + ]) + +def collect_debug_module_files(module_contexts): + """Collects Swift and Clang module files for debugging. + + Args: + module_contexts: Module contexts whose artifacts and debug dependencies + should be collected. + + Returns: + A depset of Swift and Clang module files needed by the debugger, + including private and implicit dependencies. + """ + files = [] + transitive = [] + for module in module_contexts: + if module.swift and type(module.swift.swiftmodule) == "File": + files.append(module.swift.swiftmodule) + if module.clang and module.clang.precompiled_module: + files.append(module.clang.precompiled_module) + if module.compilation_context: + transitive.append(module.compilation_context.debug_modules) + return depset(files, transitive = transitive) + +def debug_module_outputs(feature_configuration, module_contexts, swift_infos): + """Returns module files needed to debug a binary using precise module tracking. + + Args: + feature_configuration: The binary's Swift feature configuration. + module_contexts: Modules compiled by the binary, including test runners. + swift_infos: Swift providers from dependencies, also used when the + binary has no sources of its own. + + Returns: + A depset of Swift and Clang module files needed by the debugger, + including transitive dependencies. + """ + if not uses_precise_debug_module_tracking(feature_configuration): + return depset() + modules = depset( + module_contexts, + transitive = [info.transitive_modules for info in swift_infos], ) + return collect_debug_module_files(modules.to_list()) def _is_debugging(feature_configuration): """Returns `True` if the current compilation mode produces debug info. diff --git a/swift/internal/feature_names.bzl b/swift/internal/feature_names.bzl index bf1aa1bee..c783a3a4d 100644 --- a/swift/internal/feature_names.bzl +++ b/swift/internal/feature_names.bzl @@ -224,6 +224,15 @@ SWIFT_FEATURE_ADD_DEFAULT_PRECOMPILED_MODULES = "swift.add_default_precompiled_m # using a JSON file instead of `-I` search paths. SWIFT_FEATURE_USE_EXPLICIT_SWIFT_MODULE_MAP = "swift.use_explicit_swift_module_map" +# If enabled together with `swift.use_c_modules` and +# `swift.use_explicit_swift_module_map` in dbg or fastbuild mode, object +# compilations record their own `.swiftmodule` path in debug info instead of +# embedding modules at link time. +# https://www.swift.org/blog/module-tracking-in-debug-info/ +# Requires Swift 6.4 or newer for the compiler and debugger support. +# Enabled by default for Xcode 27 and newer. +SWIFT_FEATURE_DEBUG_MODULE_PATH = "swift.debug_module_path" + # If enabled, Swift compilation actions will use the same global Clang module # cache used by Objective-C compilation actions. This can be disabled because # under some circumstances Clang module cache corruption can cause the Swift diff --git a/swift/internal/linking.bzl b/swift/internal/linking.bzl index ac237d883..273df5232 100644 --- a/swift/internal/linking.bzl +++ b/swift/internal/linking.bzl @@ -24,6 +24,7 @@ load( ":debugging.bzl", "ensure_swiftmodule_is_embedded", "should_embed_swiftmodule_for_debugging", + "uses_precise_debug_module_tracking", ) load(":developer_dirs.bzl", "developer_dirs_linkopts") load( @@ -136,7 +137,7 @@ def _create_autolink_linking_context( return None -def _create_embedded_debugging_linking_context( +def _create_debugging_linking_context( *, actions, feature_configuration, @@ -144,7 +145,7 @@ def _create_embedded_debugging_linking_context( module_context, toolchains, toolchain_type): - """Creates a linking context that embeds a .swiftmodule for debugging. + """Creates a linking context that makes a .swiftmodule available for debugging. Args: actions: The context's `actions` object. @@ -154,8 +155,6 @@ def _create_embedded_debugging_linking_context( of the linker inputs created for post-compile actions (if any). module_context: The module context returned by `compile` containing information about the Swift module that was compiled. - Typically, this is the first tuple element in the value returned by - `compile`. toolchains: The struct containing the Swift and C++ toolchain providers, as returned by `swift_common.find_all_toolchains()`. toolchain_type: The toolchain type of the `swift_toolchain` which is @@ -165,29 +164,32 @@ def _create_embedded_debugging_linking_context( Returns: A valid `CcLinkingContext`, or `None` if no linking context was created. """ - if ( - module_context and - module_context.swift and - should_embed_swiftmodule_for_debugging( - feature_configuration = feature_configuration, - module_context = module_context, + if not (module_context and module_context.swift and module_context.swift.swiftmodule): + return None + + if uses_precise_debug_module_tracking(feature_configuration): + linker_input = cc_common.create_linker_input( + owner = label, + additional_inputs = depset([module_context.swift.swiftmodule]), ) + elif should_embed_swiftmodule_for_debugging( + feature_configuration = feature_configuration, + module_context = module_context, ): - post_compile_linker_inputs = [ - ensure_swiftmodule_is_embedded( - actions = actions, - feature_configuration = feature_configuration, - label = label, - swiftmodule = module_context.swift.swiftmodule, - toolchains = toolchains, - toolchain_type = toolchain_type, - ), - ] - return cc_common.create_linking_context( - linker_inputs = depset(post_compile_linker_inputs), + linker_input = ensure_swiftmodule_is_embedded( + actions = actions, + feature_configuration = feature_configuration, + label = label, + swiftmodule = module_context.swift.swiftmodule, + toolchains = toolchains, + toolchain_type = toolchain_type, ) + else: + return None - return None + return cc_common.create_linking_context( + linker_inputs = depset([linker_input]), + ) def create_linking_context_from_compilation_outputs( *, @@ -279,7 +281,7 @@ def create_linking_context_from_compilation_outputs( for cc_info in implicit_cc_infos ] - debugging_linking_context = _create_embedded_debugging_linking_context( + debugging_linking_context = _create_debugging_linking_context( actions = actions, feature_configuration = feature_configuration, label = label, @@ -441,9 +443,9 @@ def register_link_binary_action( label: The label of the target being linked, whose name is used to derive the output artifact if the `name` argument is not provided. module_contexts: A list of module contexts resulting from the - compilation of the sources in the binary target, which are embedded - in the binary for debugging if this is a debug build. This list may - be empty if the target had no sources of its own. + compilation of the sources in the binary target, used to configure + module handling for debugging. This list may be empty if the target + had no sources of its own. name: If provided, the name of the output file to generate. If not provided, the name of `label` will be used. output_type: A string indicating the output type; "executable" or @@ -478,7 +480,7 @@ def register_link_binary_action( ] + additional_linking_contexts for module_context in module_contexts: - debugging_linking_context = _create_embedded_debugging_linking_context( + debugging_linking_context = _create_debugging_linking_context( actions = actions, feature_configuration = feature_configuration, label = label, diff --git a/swift/swift_binary.bzl b/swift/swift_binary.bzl index 2e3bc60b3..4fef09e06 100644 --- a/swift/swift_binary.bzl +++ b/swift/swift_binary.bzl @@ -20,6 +20,7 @@ load("@rules_cc//cc/common:cc_common.bzl", "cc_common") load("@rules_cc//cc/common:cc_info.bzl", "CcInfo") load("//swift/internal:binary_attrs.bzl", "binary_rule_attrs") load("//swift/internal:compiling.bzl", "compile") +load("//swift/internal:debugging.bzl", "debug_module_outputs") load( "//swift/internal:feature_names.bzl", "SWIFT_FEATURE_ADD_TARGET_NAME_TO_OUTPUT", @@ -251,6 +252,11 @@ def _swift_binary_impl(ctx): executable = output_file, files = depset( [output_file] + additional_debug_outputs, + transitive = [debug_module_outputs( + feature_configuration = feature_configuration, + module_contexts = module_contexts, + swift_infos = get_providers(ctx.attr.deps, SwiftInfo), + )], ), runfiles = ctx.runfiles( collect_data = True, diff --git a/swift/swift_test.bzl b/swift/swift_test.bzl index 1db7032f3..dfe21be7e 100644 --- a/swift/swift_test.bzl +++ b/swift/swift_test.bzl @@ -20,6 +20,7 @@ load("@rules_cc//cc/common:cc_common.bzl", "cc_common") load("@rules_cc//cc/common:cc_info.bzl", "CcInfo") load("//swift/internal:binary_attrs.bzl", "binary_rule_attrs") load("//swift/internal:compiling.bzl", "compile") +load("//swift/internal:debugging.bzl", "debug_module_outputs") load("//swift/internal:env_expansion.bzl", "expanded_env") load( "//swift/internal:feature_names.bzl", @@ -512,6 +513,11 @@ def _swift_test_impl(ctx): executable = linking_outputs.executable, files = depset( [linking_outputs.executable] + additional_debug_outputs, + transitive = [debug_module_outputs( + feature_configuration = feature_configuration, + module_contexts = module_contexts, + swift_infos = deps_swift_infos + get_providers(additional_link_deps, SwiftInfo), + )], ), runfiles = ctx.runfiles( collect_data = True, diff --git a/swift/toolchains/config/compile_config.bzl b/swift/toolchains/config/compile_config.bzl index 374f393aa..dc332fad8 100644 --- a/swift/toolchains/config/compile_config.bzl +++ b/swift/toolchains/config/compile_config.bzl @@ -41,6 +41,7 @@ load( "SWIFT_FEATURE_COVERAGE", "SWIFT_FEATURE_COVERAGE_PREFIX_MAP", "SWIFT_FEATURE_DBG", + "SWIFT_FEATURE_DEBUG_MODULE_PATH", "SWIFT_FEATURE_DEBUG_PREFIX_MAP", "SWIFT_FEATURE_DECLARE_SWIFTSOURCEINFO", "SWIFT_FEATURE_DISABLE_AVAILABILITY_CHECKING", @@ -274,6 +275,18 @@ def compile_action_configs( configurators = [_constant_value_extraction_configurator], ), + # Record this object's own module path in debugging configurations. + ActionConfigInfo( + actions = [SWIFT_ACTION_COMPILE], + configurators = [_debug_module_path_configurator], + features = [[ + SWIFT_FEATURE_DEBUG_MODULE_PATH, + SWIFT_FEATURE_USE_C_MODULES, + SWIFT_FEATURE_USE_EXPLICIT_SWIFT_MODULE_MAP, + compilation_mode, + ] for compilation_mode in [SWIFT_FEATURE_DBG, SWIFT_FEATURE_FASTBUILD]], + ), + # Link Time Optimization (LTO). ActionConfigInfo( actions = all_compile_action_names(), @@ -1596,6 +1609,11 @@ def _emit_module_path_configurator(prerequisites, args): """Adds the `.swiftmodule` output path to the command line.""" args.add("-emit-module-path", prerequisites.swiftmodule_file) +def _debug_module_path_configurator(prerequisites, args): + """Adds the current target's `.swiftmodule` path to debug info.""" + + args.add("-debug-module-path", prerequisites.swiftmodule_file) + def _emit_module_interface_path_configurator(prerequisites, args): """Adds the `.swiftinterface` output path to the command line.""" args.add("-emit-module-interface-path", prerequisites.swiftinterface_file) diff --git a/swift/toolchains/xcode_swift_toolchain.bzl b/swift/toolchains/xcode_swift_toolchain.bzl index dadaa09b5..e0039b3e9 100644 --- a/swift/toolchains/xcode_swift_toolchain.bzl +++ b/swift/toolchains/xcode_swift_toolchain.bzl @@ -51,6 +51,7 @@ load( "SWIFT_FEATURE_ADD_DEFAULT_PRECOMPILED_MODULES", "SWIFT_FEATURE_COVERAGE", "SWIFT_FEATURE_COVERAGE_PREFIX_MAP", + "SWIFT_FEATURE_DEBUG_MODULE_PATH", "SWIFT_FEATURE_DEBUG_PREFIX_MAP", "SWIFT_FEATURE_DISABLE_SWIFT_SANDBOX", "SWIFT_FEATURE_FILE_PREFIX_MAP", @@ -864,6 +865,9 @@ def _xcode_swift_toolchain_impl(ctx): if _is_xcode_at_least_version(xcode_config, "26.4"): requested_features.append(SWIFT_FEATURE__SUPPORTS_HERMETIC_SWIFTMODULE) + if _is_xcode_at_least_version(xcode_config, "27.0"): + requested_features.append(SWIFT_FEATURE_DEBUG_MODULE_PATH) + # Xcode toolchains always support DEVELOPER_DIR requested_features.append(SWIFT_FEATURE__SUPPORTS_DEVELOPER_DIR) diff --git a/test/debug_settings_tests.bzl b/test/debug_settings_tests.bzl index c9ccefbef..91c95dfc5 100644 --- a/test/debug_settings_tests.bzl +++ b/test/debug_settings_tests.bzl @@ -14,10 +14,15 @@ """Tests for debugging-related command line flags under various configs.""" +load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts") +load("@rules_cc//cc/common:cc_info.bzl", "CcInfo") +load("//swift:providers.bzl", "SwiftInfo") load( "//test/rules:action_command_line_test.bzl", "make_action_command_line_test_rule", ) +load("//test/rules:action_inputs_test.bzl", "make_action_inputs_test_rule") +load("//test/rules:provider_test.bzl", "make_provider_test_rule") DBG_CONFIG_SETTINGS = { "//command_line_option:compilation_mode": "dbg", @@ -108,6 +113,273 @@ unsupported_developer_dir_xcode_remap_command_line_test = make_action_command_li }, ) +def _debug_module_linking_test_impl(ctx): + env = analysistest.begin(ctx) + target = analysistest.target_under_test(env) + actions = analysistest.target_actions(env) + if ctx.attr.is_binary: + # swift_binary intentionally hides its module from SwiftInfo so that + # dependents cannot import it. Find the declared compilation output. + swiftmodules = [ + output + for action in actions + if action.mnemonic in ["SwiftCompile", "SwiftDeriveFiles"] + for output in action.outputs.to_list() + if output.extension == "swiftmodule" + ] + else: + swiftmodules = [ + module.swift.swiftmodule + for module in target[SwiftInfo].direct_modules + if module.swift and module.swift.swiftmodule + ] + asserts.equals(env, 1, len(swiftmodules), "Expected exactly one Swift module") + if len(swiftmodules) != 1: + return analysistest.end(env) + swiftmodule = swiftmodules[0] + + # Check the actual linker inputs propagated by the library. Darwin uses + # -add_ast_path; other platforms propagate a SwiftModuleWrap output. + if ctx.attr.is_binary: + link_actions = [a for a in actions if a.mnemonic == "CppLink"] + asserts.equals(env, 1, len(link_actions), "Expected exactly one CppLink action") + if len(link_actions) != 1: + return analysistest.end(env) + link_flags = link_actions[0].argv + additional_inputs = link_actions[0].inputs.to_list() + else: + linker_inputs = target[CcInfo].linking_context.linker_inputs.to_list() + link_flags = [flag for inputs in linker_inputs for flag in inputs.user_link_flags] + additional_inputs = [file for inputs in linker_inputs for file in inputs.additional_inputs] + modulewrap_actions = [a for a in actions if a.mnemonic == "SwiftModuleWrap"] + ast_flag = "-Wl,-add_ast_path,{}".format(swiftmodule.path) + if ctx.attr.expect_embedding: + if modulewrap_actions: + asserts.equals(env, 1, len(modulewrap_actions)) + wrapped_modules = modulewrap_actions[0].outputs.to_list() + asserts.equals(env, 1, len(wrapped_modules), "Expected exactly one wrapped module") + if len(wrapped_modules) != 1: + return analysistest.end(env) + wrapped_module = wrapped_modules[0] + asserts.true(env, wrapped_module.path in link_flags) + asserts.true(env, wrapped_module in additional_inputs) + else: + asserts.true(env, ast_flag in link_flags) + asserts.true(env, swiftmodule in additional_inputs) + else: + asserts.equals(env, [], modulewrap_actions) + asserts.false(env, ast_flag in link_flags) + asserts.equals(env, ctx.attr.expect_module_input, swiftmodule in additional_inputs) + + return analysistest.end(env) + +_EXPLICIT_DEBUG_MODULE_PATH_FEATURES = [ + "swift.debug_module_path", + "swift.emit_c_module", + "swift.use_c_modules", + "swift.use_explicit_swift_module_map", + "-swift.no_embed_debug_module", +] + +debug_module_outputs_test = make_provider_test_rule( + config_settings = { + "//command_line_option:compilation_mode": "dbg", + "//command_line_option:features": _EXPLICIT_DEBUG_MODULE_PATH_FEATURES + [ + "swift.split_derived_files_generation", + ], + }, +) + +legacy_debug_module_outputs_test = make_provider_test_rule( + config_settings = { + "//command_line_option:compilation_mode": "dbg", + "//command_line_option:features": [ + "-swift.debug_module_path", + "swift.emit_c_module", + "swift.use_c_modules", + "swift.use_explicit_swift_module_map", + ], + }, +) + +opt_debug_module_outputs_test = make_provider_test_rule( + config_settings = { + "//command_line_option:compilation_mode": "opt", + "//command_line_option:features": _EXPLICIT_DEBUG_MODULE_PATH_FEATURES, + }, +) + +fastbuild_debug_module_outputs_test = make_provider_test_rule( + config_settings = { + "//command_line_option:compilation_mode": "fastbuild", + "//command_line_option:features": _EXPLICIT_DEBUG_MODULE_PATH_FEATURES, + }, +) + +DEBUG_MODULE_PATH_CONFIG_SETTINGS = { + "//command_line_option:compilation_mode": "dbg", + "//command_line_option:features": _EXPLICIT_DEBUG_MODULE_PATH_FEATURES, +} + +debug_module_path_test = make_action_command_line_test_rule( + config_settings = DEBUG_MODULE_PATH_CONFIG_SETTINGS, +) + +debug_module_path_linking_test = analysistest.make( + _debug_module_linking_test_impl, + attrs = { + "expect_module_input": attr.bool(default = False), + "expect_embedding": attr.bool(default = True), + "is_binary": attr.bool(default = False), + }, + config_settings = DEBUG_MODULE_PATH_CONFIG_SETTINGS, +) + +DEBUG_MODULE_PATH_DISABLED_CONFIG_SETTINGS = { + "//command_line_option:compilation_mode": "dbg", + "//command_line_option:features": [ + "-swift.debug_module_path", + "swift.emit_c_module", + "swift.use_c_modules", + "swift.use_explicit_swift_module_map", + "-swift.no_embed_debug_module", + ], +} + +debug_module_path_disabled_test = make_action_command_line_test_rule( + config_settings = DEBUG_MODULE_PATH_DISABLED_CONFIG_SETTINGS, +) + +debug_module_path_disabled_linking_test = analysistest.make( + _debug_module_linking_test_impl, + attrs = { + "expect_module_input": attr.bool(default = False), + "expect_embedding": attr.bool(default = True), + "is_binary": attr.bool(default = False), + }, + config_settings = DEBUG_MODULE_PATH_DISABLED_CONFIG_SETTINGS, +) + +DEBUG_MODULE_PATH_SWIFT_MAP_ONLY_CONFIG_SETTINGS = { + "//command_line_option:compilation_mode": "dbg", + "//command_line_option:features": [ + "swift.debug_module_path", + "-swift.use_c_modules", + "swift.use_explicit_swift_module_map", + "-swift.no_embed_debug_module", + ], +} + +debug_module_path_swift_map_only_test = make_action_command_line_test_rule( + config_settings = DEBUG_MODULE_PATH_SWIFT_MAP_ONLY_CONFIG_SETTINGS, +) + +debug_module_path_swift_map_only_linking_test = analysistest.make( + _debug_module_linking_test_impl, + attrs = { + "expect_module_input": attr.bool(default = False), + "expect_embedding": attr.bool(default = True), + "is_binary": attr.bool(default = False), + }, + config_settings = DEBUG_MODULE_PATH_SWIFT_MAP_ONLY_CONFIG_SETTINGS, +) + +DEBUG_MODULE_PATH_C_MODULES_ONLY_CONFIG_SETTINGS = { + "//command_line_option:compilation_mode": "dbg", + "//command_line_option:features": [ + "swift.debug_module_path", + "swift.emit_c_module", + "swift.use_c_modules", + "-swift.use_explicit_swift_module_map", + "-swift.no_embed_debug_module", + ], +} + +debug_module_path_c_modules_only_test = make_action_command_line_test_rule( + config_settings = DEBUG_MODULE_PATH_C_MODULES_ONLY_CONFIG_SETTINGS, +) + +debug_module_path_c_modules_only_linking_test = analysistest.make( + _debug_module_linking_test_impl, + attrs = { + "expect_module_input": attr.bool(default = False), + "expect_embedding": attr.bool(default = True), + "is_binary": attr.bool(default = False), + }, + config_settings = DEBUG_MODULE_PATH_C_MODULES_ONLY_CONFIG_SETTINGS, +) + +DEBUG_MODULE_PATH_SPLIT_CONFIG_SETTINGS = { + "//command_line_option:compilation_mode": "dbg", + "//command_line_option:features": _EXPLICIT_DEBUG_MODULE_PATH_FEATURES + ["swift.split_derived_files_generation"], +} + +debug_module_path_split_test = make_action_command_line_test_rule( + config_settings = DEBUG_MODULE_PATH_SPLIT_CONFIG_SETTINGS, +) + +debug_module_path_split_inputs_test = make_action_inputs_test_rule( + config_settings = DEBUG_MODULE_PATH_SPLIT_CONFIG_SETTINGS, +) + +debug_module_path_split_linking_test = analysistest.make( + _debug_module_linking_test_impl, + attrs = { + "expect_module_input": attr.bool(default = False), + "expect_embedding": attr.bool(default = True), + "is_binary": attr.bool(default = False), + }, + config_settings = DEBUG_MODULE_PATH_SPLIT_CONFIG_SETTINGS, +) + +DEBUG_MODULE_PATH_FASTBUILD_CONFIG_SETTINGS = { + "//command_line_option:compilation_mode": "fastbuild", + "//command_line_option:features": _EXPLICIT_DEBUG_MODULE_PATH_FEATURES, +} + +debug_module_path_fastbuild_test = make_action_command_line_test_rule( + config_settings = DEBUG_MODULE_PATH_FASTBUILD_CONFIG_SETTINGS, +) + +DEBUG_MODULE_PATH_OPT_CONFIG_SETTINGS = { + "//command_line_option:compilation_mode": "opt", + "//command_line_option:features": _EXPLICIT_DEBUG_MODULE_PATH_FEATURES, +} + +debug_module_path_opt_test = make_action_command_line_test_rule( + config_settings = DEBUG_MODULE_PATH_OPT_CONFIG_SETTINGS, +) + +debug_module_path_opt_linking_test = analysistest.make( + _debug_module_linking_test_impl, + attrs = { + "expect_module_input": attr.bool(default = False), + "expect_embedding": attr.bool(default = True), + "is_binary": attr.bool(default = False), + }, + config_settings = DEBUG_MODULE_PATH_OPT_CONFIG_SETTINGS, +) + +NO_EMBED_DEBUG_MODULE_CONFIG_SETTINGS = { + "//command_line_option:compilation_mode": "dbg", + "//command_line_option:features": [ + "-swift.debug_module_path", + "-swift.use_c_modules", + "-swift.use_explicit_swift_module_map", + "swift.no_embed_debug_module", + ], +} + +no_embed_debug_module_linking_test = analysistest.make( + _debug_module_linking_test_impl, + attrs = { + "expect_module_input": attr.bool(default = False), + "expect_embedding": attr.bool(default = True), + "is_binary": attr.bool(default = False), + }, + config_settings = NO_EMBED_DEBUG_MODULE_CONFIG_SETTINGS, +) + def debug_settings_test_suite(name, tags = []): """Test suite for serializing debugging options. @@ -117,6 +389,259 @@ def debug_settings_test_suite(name, tags = []): """ all_tags = [name] + tags + # Verify that default outputs include the modules needed for debugging. + debug_module_outputs_test( + name = "{}_debug_module_outputs_dependency_dbg".format(name), + expected_files = [ + "test_fixtures_debug_settings_module_path_binary.swiftmodule", + "test_fixtures_debug_settings_simple.swiftmodule", + "*", + ], + field = "files", + provider = "DefaultInfo", + tags = all_tags, + target_compatible_with = ["@platforms//os:macos"], + target_under_test = "//test/fixtures/debug_settings:module_path_binary", + ) + + fastbuild_debug_module_outputs_test( + name = "{}_debug_module_outputs_dependency_fastbuild".format(name), + expected_files = [ + "test_fixtures_debug_settings_module_path_binary.swiftmodule", + "test_fixtures_debug_settings_simple.swiftmodule", + "*", + ], + field = "files", + provider = "DefaultInfo", + tags = all_tags, + target_compatible_with = ["@platforms//os:macos"], + target_under_test = "//test/fixtures/debug_settings:module_path_binary", + ) + + debug_module_outputs_test( + name = "{}_debug_module_outputs_private_dependencies_dbg".format(name), + expected_files = [ + "test_fixtures_private_deps_client_swift_deps.swiftmodule", + "test_fixtures_private_deps_private_swift.swiftmodule", + "test_fixtures_private_deps_public_swift.swiftmodule", + "private_cc.swift.pcm", + "public_cc.swift.pcm", + "*", + ], + field = "files", + provider = "DefaultInfo", + tags = all_tags, + target_compatible_with = ["@platforms//os:macos"], + target_under_test = "//test/fixtures/debug_settings:private_deps_binary", + ) + + opt_debug_module_outputs_test( + name = "{}_debug_module_outputs_private_dependencies_opt".format(name), + expected_files = [ + "-test_fixtures_private_deps_client_swift_deps.swiftmodule", + "-test_fixtures_private_deps_private_swift.swiftmodule", + "-test_fixtures_private_deps_public_swift.swiftmodule", + "-private_cc.swift.pcm", + "-public_cc.swift.pcm", + "*", + ], + field = "files", + provider = "DefaultInfo", + tags = all_tags, + target_compatible_with = ["@platforms//os:macos"], + target_under_test = "//test/fixtures/debug_settings:private_deps_binary", + ) + + debug_module_outputs_test( + name = "{}_debug_module_outputs_swift_test_dbg".format(name), + expected_files = [ + "test_fixtures_precompiled_modules_simple_xctest.swiftmodule", + "*", + ], + field = "files", + provider = "DefaultInfo", + tags = all_tags, + target_compatible_with = ["@platforms//os:macos"], + target_under_test = "//test/fixtures/precompiled_modules:simple_xctest", + ) + + opt_debug_module_outputs_test( + name = "{}_debug_module_outputs_swift_test_opt".format(name), + expected_files = [ + "-test_fixtures_precompiled_modules_simple_xctest.swiftmodule", + "*", + ], + field = "files", + provider = "DefaultInfo", + tags = all_tags, + target_compatible_with = ["@platforms//os:macos"], + target_under_test = "//test/fixtures/precompiled_modules:simple_xctest", + ) + + legacy_debug_module_outputs_test( + name = "{}_legacy_debug_module_outputs".format(name), + expected_files = [ + "-test_fixtures_debug_settings_module_path_binary.swiftmodule", + "-test_fixtures_debug_settings_simple.swiftmodule", + "*", + ], + field = "files", + provider = "DefaultInfo", + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:module_path_binary", + ) + + # Record the module path and make the module available without embedding it. + debug_module_path_test( + name = "{}_debug_module_path_explicit_modules".format(name), + expected_argv = [ + "-debug-module-path $(BIN_DIR)/test/fixtures/debug_settings/test_fixtures_debug_settings_simple.swiftmodule", + ], + mnemonic = "SwiftCompile", + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:simple", + ) + + debug_module_path_linking_test( + name = "{}_debug_module_path_explicit_modules_linking".format(name), + expect_module_input = True, + expect_embedding = False, + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:simple", + ) + + debug_module_path_fastbuild_test( + name = "{}_debug_module_path_fastbuild".format(name), + expected_argv = [ + "-debug-module-path $(BIN_DIR)/test/fixtures/debug_settings/test_fixtures_debug_settings_simple.swiftmodule", + ], + mnemonic = "SwiftCompile", + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:simple", + ) + + # Optimized builds do not request debug module tracking or linker inputs. + debug_module_path_opt_test( + name = "{}_debug_module_path_opt".format(name), + not_expected_argv = [ + "-debug-module-path", + ], + mnemonic = "SwiftCompile", + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:simple", + ) + + debug_module_path_opt_linking_test( + name = "{}_debug_module_path_opt_binary_linking".format(name), + expect_module_input = False, + expect_embedding = False, + is_binary = True, + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:binary", + ) + + # Disabling the feature or either explicit-module requirement retains + # legacy embedding. + debug_module_path_disabled_test( + name = "{}_debug_module_path_disabled".format(name), + not_expected_argv = [ + "-debug-module-path", + ], + mnemonic = "SwiftCompile", + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:simple", + ) + + debug_module_path_disabled_linking_test( + name = "{}_debug_module_path_disabled_linking".format(name), + expect_embedding = True, + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:simple", + ) + + debug_module_path_swift_map_only_test( + name = "{}_debug_module_path_swift_map_only".format(name), + not_expected_argv = [ + "-debug-module-path", + ], + mnemonic = "SwiftCompile", + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:simple", + ) + + debug_module_path_swift_map_only_linking_test( + name = "{}_debug_module_path_swift_map_only_linking".format(name), + expect_embedding = True, + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:simple", + ) + + debug_module_path_c_modules_only_test( + name = "{}_debug_module_path_c_modules_only".format(name), + not_expected_argv = [ + "-debug-module-path", + ], + mnemonic = "SwiftCompile", + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:simple", + ) + + debug_module_path_c_modules_only_linking_test( + name = "{}_debug_module_path_c_modules_only_linking".format(name), + expect_embedding = True, + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:simple", + ) + + no_embed_debug_module_linking_test( + name = "{}_no_embed_debug_module_linking".format(name), + expect_module_input = False, + expect_embedding = False, + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:simple", + ) + + # Split compilation records the path only in the object action, without + # making the module an input to its own compilation. + debug_module_path_split_test( + name = "{}_debug_module_path_dependency".format(name), + expected_argv = [ + "-debug-module-path $(BIN_DIR)/test/fixtures/debug_settings/test_fixtures_debug_settings_module_path_binary.swiftmodule", + ], + mnemonic = "SwiftCompile", + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:module_path_binary", + ) + + debug_module_path_split_inputs_test( + name = "{}_debug_module_path_dependency_inputs".format(name), + not_expected_inputs = [ + "test/fixtures/debug_settings/test_fixtures_debug_settings_module_path_binary.swiftmodule", + ], + mnemonic = "SwiftCompile", + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:module_path_binary", + ) + + debug_module_path_split_test( + name = "{}_debug_module_path_dependency_derive_files".format(name), + not_expected_argv = [ + "-debug-module-path", + ], + mnemonic = "SwiftDeriveFiles", + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:module_path_binary", + ) + + debug_module_path_split_linking_test( + name = "{}_debug_module_path_dependency_linking".format(name), + expect_module_input = True, + expect_embedding = False, + is_binary = True, + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:module_path_binary", + ) + # Verify that `-c dbg` builds serialize debugging options, remap paths, and # have other appropriate debug flags. dbg_action_command_line_test( diff --git a/test/fixtures/debug_settings/BUILD b/test/fixtures/debug_settings/BUILD index d42aee8e8..b6874c847 100644 --- a/test/fixtures/debug_settings/BUILD +++ b/test/fixtures/debug_settings/BUILD @@ -1,3 +1,4 @@ +load("//swift:swift_binary.bzl", "swift_binary") load( "//swift:swift_library.bzl", "swift_library", @@ -18,3 +19,26 @@ swift_library( srcs = ["Empty.swift"], tags = FIXTURE_TAGS, ) + +swift_binary( + name = "binary", + srcs = ["Empty.swift"], + tags = FIXTURE_TAGS, +) + +swift_binary( + name = "module_path_binary", + srcs = ["Empty.swift"], + tags = FIXTURE_TAGS, + deps = [":simple"], +) + +# No sources of its own: debug modules must be collected from dependencies. +swift_binary( + name = "private_deps_binary", + tags = FIXTURE_TAGS, + deps = [ + "//test/fixtures/private_deps:client_cc_deps", + "//test/fixtures/private_deps:client_swift_deps", + ], +) From 74a6b4a5a8443a088895cefc580b984797538bfc Mon Sep 17 00:00:00 2001 From: Adin Cebic Date: Sat, 12 Sep 2026 15:23:50 +0200 Subject: [PATCH 2/4] Update docs --- doc/api.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/api.md b/doc/api.md index 6aec44efa..ceb01898b 100755 --- a/doc/api.md +++ b/doc/api.md @@ -388,8 +388,10 @@ Cretes a compilation context for a Swift target. **RETURNS** -A `struct` containing four fields: +A `struct` containing the following fields: + * `debug_modules`: A depset of module files needed to import this + target's dependencies in the debugger, including private deps. * `defines`: A sequence of defines used when compiling the target. Includes the defines for the target and its transitive dependencies. * `direct_sources`: A sequence of Swift source files used to compile From 41055e9493b023e954e810b66fdea206aaf543cf Mon Sep 17 00:00:00 2001 From: Adin Cebic Date: Tue, 15 Sep 2026 05:46:11 +0200 Subject: [PATCH 3/4] feedback --- README.md | 2 +- doc/explicit_modules.md | 23 ++------- swift/internal/debugging.bzl | 9 +++- swift/internal/feature_names.bzl | 3 +- swift/internal/linking.bzl | 12 ++--- swift/toolchains/config/compile_config.bzl | 12 ++--- test/debug_settings_tests.bzl | 54 ++++++++++++++++++++-- 7 files changed, 70 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 879f2d83b..e18f2329b 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ encountered first on your `PATH`. To make cacheable builds work correctly with debugging see [this doc](doc/debuggable_remote_swift.md). -For Xcode builds using explicit modules, see +For explicit module builds, see [debugging with explicit modules](doc/explicit_modules.md#debugging). ## Swift Package Manager Support diff --git a/doc/explicit_modules.md b/doc/explicit_modules.md index 746bcd555..582ea635d 100644 --- a/doc/explicit_modules.md +++ b/doc/explicit_modules.md @@ -42,14 +42,9 @@ and is therefore disabled. ### Module tracking in debug info -With Xcode 27 and newer, `swift.debug_module_path` is enabled by default. -It requires Swift 6.4 or newer compiler and debugger support, and takes -effect in `dbg` and `fastbuild` compilation modes when both -`swift.use_c_modules` and `swift.use_explicit_swift_module_map` are enabled. -Enable explicit modules as described in [Usage](#usage), including -`swift.emit_c_module`. - -The compiler writes the `.swiftmodule` path into each object file's +With Swift 6.4 / Xcode 27 and newer, `swift.debug_module_path` is enabled by default +for Xcode toolchains. +In this mode the compiler writes the `.swiftmodule` path into each object file's debug information using `-debug-module-path`. Each explicit module also records its dependencies. LLDB uses these paths to find the module files it needs for expression evaluation, replacing the previous `-add_ast_path` @@ -57,18 +52,6 @@ or module-wrapping mechanism. See [Module Tracking in Swift Debug Info](https://www.swift.org/blog/module-tracking-in-debug-info/) for more details. -To disable this behavior and retain the previous debug module handling, -add this to your `.bazelrc`: - -``` -build --features=-swift.debug_module_path --host_features=-swift.debug_module_path -``` - -The previous behavior is also retained when either of the explicit -module features required above is disabled. In `opt` mode, this feature -does not add debug module paths, linker inputs, or default outputs, even -if debug info is enabled manually with `-g`. - Expression evaluation still requires the `.swiftmodule` and `.pcm` files at their original or remapped locations. `swift_binary` and `swift_test` include these files in their default outputs, including diff --git a/swift/internal/debugging.bzl b/swift/internal/debugging.bzl index 7e0a6405f..a6ecbb97a 100644 --- a/swift/internal/debugging.bzl +++ b/swift/internal/debugging.bzl @@ -27,6 +27,7 @@ load( "SWIFT_FEATURE_DBG", "SWIFT_FEATURE_DEBUG_MODULE_PATH", "SWIFT_FEATURE_FASTBUILD", + "SWIFT_FEATURE_FULL_DEBUG_INFO", "SWIFT_FEATURE_NO_EMBED_DEBUG_MODULE", "SWIFT_FEATURE_USE_C_MODULES", "SWIFT_FEATURE_USE_EXPLICIT_SWIFT_MODULE_MAP", @@ -137,10 +138,14 @@ def uses_precise_debug_module_tracking(feature_configuration): feature_configuration: The Swift feature configuration. Returns: - True for dbg or fastbuild builds with all required module features enabled. + True for builds with debug info and all required module features enabled. """ - return _is_debugging(feature_configuration) and all([ + has_debug_info = _is_debugging(feature_configuration) or is_feature_enabled( + feature_configuration = feature_configuration, + feature_name = SWIFT_FEATURE_FULL_DEBUG_INFO, + ) + return has_debug_info and all([ is_feature_enabled( feature_configuration = feature_configuration, feature_name = feature_name, diff --git a/swift/internal/feature_names.bzl b/swift/internal/feature_names.bzl index c783a3a4d..550624037 100644 --- a/swift/internal/feature_names.bzl +++ b/swift/internal/feature_names.bzl @@ -224,8 +224,7 @@ SWIFT_FEATURE_ADD_DEFAULT_PRECOMPILED_MODULES = "swift.add_default_precompiled_m # using a JSON file instead of `-I` search paths. SWIFT_FEATURE_USE_EXPLICIT_SWIFT_MODULE_MAP = "swift.use_explicit_swift_module_map" -# If enabled together with `swift.use_c_modules` and -# `swift.use_explicit_swift_module_map` in dbg or fastbuild mode, object +# If enabled together with explicit modules and debug info, object # compilations record their own `.swiftmodule` path in debug info instead of # embedding modules at link time. # https://www.swift.org/blog/module-tracking-in-debug-info/ diff --git a/swift/internal/linking.bzl b/swift/internal/linking.bzl index 273df5232..8be4ba370 100644 --- a/swift/internal/linking.bzl +++ b/swift/internal/linking.bzl @@ -24,7 +24,6 @@ load( ":debugging.bzl", "ensure_swiftmodule_is_embedded", "should_embed_swiftmodule_for_debugging", - "uses_precise_debug_module_tracking", ) load(":developer_dirs.bzl", "developer_dirs_linkopts") load( @@ -145,7 +144,7 @@ def _create_debugging_linking_context( module_context, toolchains, toolchain_type): - """Creates a linking context that makes a .swiftmodule available for debugging. + """Creates a linking context that embeds a .swiftmodule for debugging. Args: actions: The context's `actions` object. @@ -164,15 +163,10 @@ def _create_debugging_linking_context( Returns: A valid `CcLinkingContext`, or `None` if no linking context was created. """ - if not (module_context and module_context.swift and module_context.swift.swiftmodule): + if not (module_context and module_context.swift): return None - if uses_precise_debug_module_tracking(feature_configuration): - linker_input = cc_common.create_linker_input( - owner = label, - additional_inputs = depset([module_context.swift.swiftmodule]), - ) - elif should_embed_swiftmodule_for_debugging( + if should_embed_swiftmodule_for_debugging( feature_configuration = feature_configuration, module_context = module_context, ): diff --git a/swift/toolchains/config/compile_config.bzl b/swift/toolchains/config/compile_config.bzl index dc332fad8..a203540b7 100644 --- a/swift/toolchains/config/compile_config.bzl +++ b/swift/toolchains/config/compile_config.bzl @@ -278,13 +278,16 @@ def compile_action_configs( # Record this object's own module path in debugging configurations. ActionConfigInfo( actions = [SWIFT_ACTION_COMPILE], - configurators = [_debug_module_path_configurator], + configurators = [lambda prerequisites, args: args.add( + "-debug-module-path", + prerequisites.swiftmodule_file, + )], features = [[ SWIFT_FEATURE_DEBUG_MODULE_PATH, SWIFT_FEATURE_USE_C_MODULES, SWIFT_FEATURE_USE_EXPLICIT_SWIFT_MODULE_MAP, compilation_mode, - ] for compilation_mode in [SWIFT_FEATURE_DBG, SWIFT_FEATURE_FASTBUILD]], + ] for compilation_mode in [SWIFT_FEATURE_DBG, SWIFT_FEATURE_FASTBUILD, SWIFT_FEATURE_FULL_DEBUG_INFO]], ), # Link Time Optimization (LTO). @@ -1609,11 +1612,6 @@ def _emit_module_path_configurator(prerequisites, args): """Adds the `.swiftmodule` output path to the command line.""" args.add("-emit-module-path", prerequisites.swiftmodule_file) -def _debug_module_path_configurator(prerequisites, args): - """Adds the current target's `.swiftmodule` path to debug info.""" - - args.add("-debug-module-path", prerequisites.swiftmodule_file) - def _emit_module_interface_path_configurator(prerequisites, args): """Adds the `.swiftinterface` output path to the command line.""" args.add("-emit-module-interface-path", prerequisites.swiftinterface_file) diff --git a/test/debug_settings_tests.bzl b/test/debug_settings_tests.bzl index 91c95dfc5..ba481734a 100644 --- a/test/debug_settings_tests.bzl +++ b/test/debug_settings_tests.bzl @@ -170,6 +170,12 @@ def _debug_module_linking_test_impl(ctx): asserts.equals(env, [], modulewrap_actions) asserts.false(env, ast_flag in link_flags) asserts.equals(env, ctx.attr.expect_module_input, swiftmodule in additional_inputs) + if not ctx.attr.expect_module_input: + asserts.equals(env, [], [ + file.short_path + for file in additional_inputs + if file.extension in ["swiftmodule", "pcm"] or file.basename.endswith(".modulewrap.o") + ], "Debug modules must not be linker inputs") return analysistest.end(env) @@ -360,6 +366,25 @@ debug_module_path_opt_linking_test = analysistest.make( config_settings = DEBUG_MODULE_PATH_OPT_CONFIG_SETTINGS, ) +DEBUG_MODULE_PATH_OPT_FULL_DI_CONFIG_SETTINGS = { + "//command_line_option:compilation_mode": "opt", + "//command_line_option:features": _EXPLICIT_DEBUG_MODULE_PATH_FEATURES + ["swift.full_debug_info"], +} + +debug_module_path_opt_full_di_test = make_action_command_line_test_rule( + config_settings = DEBUG_MODULE_PATH_OPT_FULL_DI_CONFIG_SETTINGS, +) + +debug_module_path_opt_full_di_linking_test = analysistest.make( + _debug_module_linking_test_impl, + attrs = { + "expect_module_input": attr.bool(default = False), + "expect_embedding": attr.bool(default = True), + "is_binary": attr.bool(default = False), + }, + config_settings = DEBUG_MODULE_PATH_OPT_FULL_DI_CONFIG_SETTINGS, +) + NO_EMBED_DEBUG_MODULE_CONFIG_SETTINGS = { "//command_line_option:compilation_mode": "dbg", "//command_line_option:features": [ @@ -491,7 +516,7 @@ def debug_settings_test_suite(name, tags = []): target_under_test = "//test/fixtures/debug_settings:module_path_binary", ) - # Record the module path and make the module available without embedding it. + # Record the module path without passing the module to the linker. debug_module_path_test( name = "{}_debug_module_path_explicit_modules".format(name), expected_argv = [ @@ -504,7 +529,7 @@ def debug_settings_test_suite(name, tags = []): debug_module_path_linking_test( name = "{}_debug_module_path_explicit_modules_linking".format(name), - expect_module_input = True, + expect_module_input = False, expect_embedding = False, tags = all_tags, target_under_test = "//test/fixtures/debug_settings:simple", @@ -520,7 +545,7 @@ def debug_settings_test_suite(name, tags = []): target_under_test = "//test/fixtures/debug_settings:simple", ) - # Optimized builds do not request debug module tracking or linker inputs. + # Optimized builds without debug info do not request module tracking. debug_module_path_opt_test( name = "{}_debug_module_path_opt".format(name), not_expected_argv = [ @@ -540,6 +565,27 @@ def debug_settings_test_suite(name, tags = []): target_under_test = "//test/fixtures/debug_settings:binary", ) + # Explicit full debug info enables module tracking even in optimized builds. + debug_module_path_opt_full_di_test( + name = "{}_debug_module_path_opt_full_di".format(name), + expected_argv = [ + "-g", + "-debug-module-path $(BIN_DIR)/test/fixtures/debug_settings/test_fixtures_debug_settings_simple.swiftmodule", + ], + mnemonic = "SwiftCompile", + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:simple", + ) + + debug_module_path_opt_full_di_linking_test( + name = "{}_debug_module_path_opt_full_di_binary_linking".format(name), + expect_module_input = False, + expect_embedding = False, + is_binary = True, + tags = all_tags, + target_under_test = "//test/fixtures/debug_settings:module_path_binary", + ) + # Disabling the feature or either explicit-module requirement retains # legacy embedding. debug_module_path_disabled_test( @@ -635,7 +681,7 @@ def debug_settings_test_suite(name, tags = []): debug_module_path_split_linking_test( name = "{}_debug_module_path_dependency_linking".format(name), - expect_module_input = True, + expect_module_input = False, expect_embedding = False, is_binary = True, tags = all_tags, From bc9dca8e8fb56dcceb5f068a0dbb4a6067895760 Mon Sep 17 00:00:00 2001 From: Adin Cebic Date: Wed, 16 Sep 2026 07:05:48 +0200 Subject: [PATCH 4/4] remove --- doc/api.md | 4 +- doc/explicit_modules.md | 8 +- swift/internal/compiling.bzl | 6 +- swift/internal/debugging.bzl | 43 -------- swift/internal/linking.bzl | 52 ++++----- swift/swift_binary.bzl | 6 -- swift/swift_test.bzl | 6 -- test/debug_settings_tests.bzl | 164 ++--------------------------- test/fixtures/debug_settings/BUILD | 10 -- 9 files changed, 38 insertions(+), 261 deletions(-) diff --git a/doc/api.md b/doc/api.md index ceb01898b..6aec44efa 100755 --- a/doc/api.md +++ b/doc/api.md @@ -388,10 +388,8 @@ Cretes a compilation context for a Swift target. **RETURNS** -A `struct` containing the following fields: +A `struct` containing four fields: - * `debug_modules`: A depset of module files needed to import this - target's dependencies in the debugger, including private deps. * `defines`: A sequence of defines used when compiling the target. Includes the defines for the target and its transitive dependencies. * `direct_sources`: A sequence of Swift source files used to compile diff --git a/doc/explicit_modules.md b/doc/explicit_modules.md index 582ea635d..ddd63e309 100644 --- a/doc/explicit_modules.md +++ b/doc/explicit_modules.md @@ -53,12 +53,8 @@ or module-wrapping mechanism. See for more details. Expression evaluation still requires the `.swiftmodule` and `.pcm` -files at their original or remapped locations. `swift_binary` and -`swift_test` include these files in their default outputs, including -private and implicit dependencies, so they are downloaded with -`--remote_download_outputs=toplevel`. If you link through other binary -rules, your build or debugger integration must make these files -available locally. +files at their original or remapped locations. Your build or debugger +integration must make these files available locally. ## Using explicit dependencies diff --git a/swift/internal/compiling.bzl b/swift/internal/compiling.bzl index 040b78edd..3c6c3bf74 100644 --- a/swift/internal/compiling.bzl +++ b/swift/internal/compiling.bzl @@ -34,7 +34,6 @@ load( "SWIFT_ACTION_PRECOMPILE_C_MODULE", ) load(":actions.bzl", "is_action_enabled", "run_toolchain_action") -load(":debugging.bzl", "collect_debug_module_files") load(":explicit_module_map_file.bzl", "write_explicit_swift_module_map_file") load( ":feature_names.bzl", @@ -185,10 +184,8 @@ def create_compilation_context(defines, srcs, transitive_modules): the target. Returns: - A `struct` containing the following fields: + A `struct` containing four fields: - * `debug_modules`: A depset of module files needed to import this - target's dependencies in the debugger, including private deps. * `defines`: A sequence of defines used when compiling the target. Includes the defines for the target and its transitive dependencies. * `direct_sources`: A sequence of Swift source files used to compile @@ -218,7 +215,6 @@ def create_compilation_context(defines, srcs, transitive_modules): # Tuples are used instead of lists since they need to be frozen return struct( - debug_modules = collect_debug_module_files(transitive_modules), defines = tuple(sets.to_list(defines_set)), direct_sources = tuple(srcs), module_maps = tuple(module_maps), diff --git a/swift/internal/debugging.bzl b/swift/internal/debugging.bzl index a6ecbb97a..63d7bc159 100644 --- a/swift/internal/debugging.bzl +++ b/swift/internal/debugging.bzl @@ -157,49 +157,6 @@ def uses_precise_debug_module_tracking(feature_configuration): ] ]) -def collect_debug_module_files(module_contexts): - """Collects Swift and Clang module files for debugging. - - Args: - module_contexts: Module contexts whose artifacts and debug dependencies - should be collected. - - Returns: - A depset of Swift and Clang module files needed by the debugger, - including private and implicit dependencies. - """ - files = [] - transitive = [] - for module in module_contexts: - if module.swift and type(module.swift.swiftmodule) == "File": - files.append(module.swift.swiftmodule) - if module.clang and module.clang.precompiled_module: - files.append(module.clang.precompiled_module) - if module.compilation_context: - transitive.append(module.compilation_context.debug_modules) - return depset(files, transitive = transitive) - -def debug_module_outputs(feature_configuration, module_contexts, swift_infos): - """Returns module files needed to debug a binary using precise module tracking. - - Args: - feature_configuration: The binary's Swift feature configuration. - module_contexts: Modules compiled by the binary, including test runners. - swift_infos: Swift providers from dependencies, also used when the - binary has no sources of its own. - - Returns: - A depset of Swift and Clang module files needed by the debugger, - including transitive dependencies. - """ - if not uses_precise_debug_module_tracking(feature_configuration): - return depset() - modules = depset( - module_contexts, - transitive = [info.transitive_modules for info in swift_infos], - ) - return collect_debug_module_files(modules.to_list()) - def _is_debugging(feature_configuration): """Returns `True` if the current compilation mode produces debug info. diff --git a/swift/internal/linking.bzl b/swift/internal/linking.bzl index 8be4ba370..ac237d883 100644 --- a/swift/internal/linking.bzl +++ b/swift/internal/linking.bzl @@ -136,7 +136,7 @@ def _create_autolink_linking_context( return None -def _create_debugging_linking_context( +def _create_embedded_debugging_linking_context( *, actions, feature_configuration, @@ -154,6 +154,8 @@ def _create_debugging_linking_context( of the linker inputs created for post-compile actions (if any). module_context: The module context returned by `compile` containing information about the Swift module that was compiled. + Typically, this is the first tuple element in the value returned by + `compile`. toolchains: The struct containing the Swift and C++ toolchain providers, as returned by `swift_common.find_all_toolchains()`. toolchain_type: The toolchain type of the `swift_toolchain` which is @@ -163,27 +165,29 @@ def _create_debugging_linking_context( Returns: A valid `CcLinkingContext`, or `None` if no linking context was created. """ - if not (module_context and module_context.swift): - return None - - if should_embed_swiftmodule_for_debugging( - feature_configuration = feature_configuration, - module_context = module_context, - ): - linker_input = ensure_swiftmodule_is_embedded( - actions = actions, + if ( + module_context and + module_context.swift and + should_embed_swiftmodule_for_debugging( feature_configuration = feature_configuration, - label = label, - swiftmodule = module_context.swift.swiftmodule, - toolchains = toolchains, - toolchain_type = toolchain_type, + module_context = module_context, + ) + ): + post_compile_linker_inputs = [ + ensure_swiftmodule_is_embedded( + actions = actions, + feature_configuration = feature_configuration, + label = label, + swiftmodule = module_context.swift.swiftmodule, + toolchains = toolchains, + toolchain_type = toolchain_type, + ), + ] + return cc_common.create_linking_context( + linker_inputs = depset(post_compile_linker_inputs), ) - else: - return None - return cc_common.create_linking_context( - linker_inputs = depset([linker_input]), - ) + return None def create_linking_context_from_compilation_outputs( *, @@ -275,7 +279,7 @@ def create_linking_context_from_compilation_outputs( for cc_info in implicit_cc_infos ] - debugging_linking_context = _create_debugging_linking_context( + debugging_linking_context = _create_embedded_debugging_linking_context( actions = actions, feature_configuration = feature_configuration, label = label, @@ -437,9 +441,9 @@ def register_link_binary_action( label: The label of the target being linked, whose name is used to derive the output artifact if the `name` argument is not provided. module_contexts: A list of module contexts resulting from the - compilation of the sources in the binary target, used to configure - module handling for debugging. This list may be empty if the target - had no sources of its own. + compilation of the sources in the binary target, which are embedded + in the binary for debugging if this is a debug build. This list may + be empty if the target had no sources of its own. name: If provided, the name of the output file to generate. If not provided, the name of `label` will be used. output_type: A string indicating the output type; "executable" or @@ -474,7 +478,7 @@ def register_link_binary_action( ] + additional_linking_contexts for module_context in module_contexts: - debugging_linking_context = _create_debugging_linking_context( + debugging_linking_context = _create_embedded_debugging_linking_context( actions = actions, feature_configuration = feature_configuration, label = label, diff --git a/swift/swift_binary.bzl b/swift/swift_binary.bzl index 4fef09e06..2e3bc60b3 100644 --- a/swift/swift_binary.bzl +++ b/swift/swift_binary.bzl @@ -20,7 +20,6 @@ load("@rules_cc//cc/common:cc_common.bzl", "cc_common") load("@rules_cc//cc/common:cc_info.bzl", "CcInfo") load("//swift/internal:binary_attrs.bzl", "binary_rule_attrs") load("//swift/internal:compiling.bzl", "compile") -load("//swift/internal:debugging.bzl", "debug_module_outputs") load( "//swift/internal:feature_names.bzl", "SWIFT_FEATURE_ADD_TARGET_NAME_TO_OUTPUT", @@ -252,11 +251,6 @@ def _swift_binary_impl(ctx): executable = output_file, files = depset( [output_file] + additional_debug_outputs, - transitive = [debug_module_outputs( - feature_configuration = feature_configuration, - module_contexts = module_contexts, - swift_infos = get_providers(ctx.attr.deps, SwiftInfo), - )], ), runfiles = ctx.runfiles( collect_data = True, diff --git a/swift/swift_test.bzl b/swift/swift_test.bzl index dfe21be7e..1db7032f3 100644 --- a/swift/swift_test.bzl +++ b/swift/swift_test.bzl @@ -20,7 +20,6 @@ load("@rules_cc//cc/common:cc_common.bzl", "cc_common") load("@rules_cc//cc/common:cc_info.bzl", "CcInfo") load("//swift/internal:binary_attrs.bzl", "binary_rule_attrs") load("//swift/internal:compiling.bzl", "compile") -load("//swift/internal:debugging.bzl", "debug_module_outputs") load("//swift/internal:env_expansion.bzl", "expanded_env") load( "//swift/internal:feature_names.bzl", @@ -513,11 +512,6 @@ def _swift_test_impl(ctx): executable = linking_outputs.executable, files = depset( [linking_outputs.executable] + additional_debug_outputs, - transitive = [debug_module_outputs( - feature_configuration = feature_configuration, - module_contexts = module_contexts, - swift_infos = deps_swift_infos + get_providers(additional_link_deps, SwiftInfo), - )], ), runfiles = ctx.runfiles( collect_data = True, diff --git a/test/debug_settings_tests.bzl b/test/debug_settings_tests.bzl index ba481734a..f806cb3bb 100644 --- a/test/debug_settings_tests.bzl +++ b/test/debug_settings_tests.bzl @@ -22,7 +22,6 @@ load( "make_action_command_line_test_rule", ) load("//test/rules:action_inputs_test.bzl", "make_action_inputs_test_rule") -load("//test/rules:provider_test.bzl", "make_provider_test_rule") DBG_CONFIG_SETTINGS = { "//command_line_option:compilation_mode": "dbg", @@ -169,13 +168,12 @@ def _debug_module_linking_test_impl(ctx): else: asserts.equals(env, [], modulewrap_actions) asserts.false(env, ast_flag in link_flags) - asserts.equals(env, ctx.attr.expect_module_input, swiftmodule in additional_inputs) - if not ctx.attr.expect_module_input: - asserts.equals(env, [], [ - file.short_path - for file in additional_inputs - if file.extension in ["swiftmodule", "pcm"] or file.basename.endswith(".modulewrap.o") - ], "Debug modules must not be linker inputs") + asserts.false(env, swiftmodule in additional_inputs) + asserts.equals(env, [], [ + file.short_path + for file in additional_inputs + if file.extension in ["swiftmodule", "pcm"] or file.basename.endswith(".modulewrap.o") + ], "Debug modules must not be linker inputs") return analysistest.end(env) @@ -187,41 +185,6 @@ _EXPLICIT_DEBUG_MODULE_PATH_FEATURES = [ "-swift.no_embed_debug_module", ] -debug_module_outputs_test = make_provider_test_rule( - config_settings = { - "//command_line_option:compilation_mode": "dbg", - "//command_line_option:features": _EXPLICIT_DEBUG_MODULE_PATH_FEATURES + [ - "swift.split_derived_files_generation", - ], - }, -) - -legacy_debug_module_outputs_test = make_provider_test_rule( - config_settings = { - "//command_line_option:compilation_mode": "dbg", - "//command_line_option:features": [ - "-swift.debug_module_path", - "swift.emit_c_module", - "swift.use_c_modules", - "swift.use_explicit_swift_module_map", - ], - }, -) - -opt_debug_module_outputs_test = make_provider_test_rule( - config_settings = { - "//command_line_option:compilation_mode": "opt", - "//command_line_option:features": _EXPLICIT_DEBUG_MODULE_PATH_FEATURES, - }, -) - -fastbuild_debug_module_outputs_test = make_provider_test_rule( - config_settings = { - "//command_line_option:compilation_mode": "fastbuild", - "//command_line_option:features": _EXPLICIT_DEBUG_MODULE_PATH_FEATURES, - }, -) - DEBUG_MODULE_PATH_CONFIG_SETTINGS = { "//command_line_option:compilation_mode": "dbg", "//command_line_option:features": _EXPLICIT_DEBUG_MODULE_PATH_FEATURES, @@ -234,7 +197,6 @@ debug_module_path_test = make_action_command_line_test_rule( debug_module_path_linking_test = analysistest.make( _debug_module_linking_test_impl, attrs = { - "expect_module_input": attr.bool(default = False), "expect_embedding": attr.bool(default = True), "is_binary": attr.bool(default = False), }, @@ -259,7 +221,6 @@ debug_module_path_disabled_test = make_action_command_line_test_rule( debug_module_path_disabled_linking_test = analysistest.make( _debug_module_linking_test_impl, attrs = { - "expect_module_input": attr.bool(default = False), "expect_embedding": attr.bool(default = True), "is_binary": attr.bool(default = False), }, @@ -283,7 +244,6 @@ debug_module_path_swift_map_only_test = make_action_command_line_test_rule( debug_module_path_swift_map_only_linking_test = analysistest.make( _debug_module_linking_test_impl, attrs = { - "expect_module_input": attr.bool(default = False), "expect_embedding": attr.bool(default = True), "is_binary": attr.bool(default = False), }, @@ -308,7 +268,6 @@ debug_module_path_c_modules_only_test = make_action_command_line_test_rule( debug_module_path_c_modules_only_linking_test = analysistest.make( _debug_module_linking_test_impl, attrs = { - "expect_module_input": attr.bool(default = False), "expect_embedding": attr.bool(default = True), "is_binary": attr.bool(default = False), }, @@ -331,7 +290,6 @@ debug_module_path_split_inputs_test = make_action_inputs_test_rule( debug_module_path_split_linking_test = analysistest.make( _debug_module_linking_test_impl, attrs = { - "expect_module_input": attr.bool(default = False), "expect_embedding": attr.bool(default = True), "is_binary": attr.bool(default = False), }, @@ -359,7 +317,6 @@ debug_module_path_opt_test = make_action_command_line_test_rule( debug_module_path_opt_linking_test = analysistest.make( _debug_module_linking_test_impl, attrs = { - "expect_module_input": attr.bool(default = False), "expect_embedding": attr.bool(default = True), "is_binary": attr.bool(default = False), }, @@ -378,7 +335,6 @@ debug_module_path_opt_full_di_test = make_action_command_line_test_rule( debug_module_path_opt_full_di_linking_test = analysistest.make( _debug_module_linking_test_impl, attrs = { - "expect_module_input": attr.bool(default = False), "expect_embedding": attr.bool(default = True), "is_binary": attr.bool(default = False), }, @@ -398,7 +354,6 @@ NO_EMBED_DEBUG_MODULE_CONFIG_SETTINGS = { no_embed_debug_module_linking_test = analysistest.make( _debug_module_linking_test_impl, attrs = { - "expect_module_input": attr.bool(default = False), "expect_embedding": attr.bool(default = True), "is_binary": attr.bool(default = False), }, @@ -414,108 +369,6 @@ def debug_settings_test_suite(name, tags = []): """ all_tags = [name] + tags - # Verify that default outputs include the modules needed for debugging. - debug_module_outputs_test( - name = "{}_debug_module_outputs_dependency_dbg".format(name), - expected_files = [ - "test_fixtures_debug_settings_module_path_binary.swiftmodule", - "test_fixtures_debug_settings_simple.swiftmodule", - "*", - ], - field = "files", - provider = "DefaultInfo", - tags = all_tags, - target_compatible_with = ["@platforms//os:macos"], - target_under_test = "//test/fixtures/debug_settings:module_path_binary", - ) - - fastbuild_debug_module_outputs_test( - name = "{}_debug_module_outputs_dependency_fastbuild".format(name), - expected_files = [ - "test_fixtures_debug_settings_module_path_binary.swiftmodule", - "test_fixtures_debug_settings_simple.swiftmodule", - "*", - ], - field = "files", - provider = "DefaultInfo", - tags = all_tags, - target_compatible_with = ["@platforms//os:macos"], - target_under_test = "//test/fixtures/debug_settings:module_path_binary", - ) - - debug_module_outputs_test( - name = "{}_debug_module_outputs_private_dependencies_dbg".format(name), - expected_files = [ - "test_fixtures_private_deps_client_swift_deps.swiftmodule", - "test_fixtures_private_deps_private_swift.swiftmodule", - "test_fixtures_private_deps_public_swift.swiftmodule", - "private_cc.swift.pcm", - "public_cc.swift.pcm", - "*", - ], - field = "files", - provider = "DefaultInfo", - tags = all_tags, - target_compatible_with = ["@platforms//os:macos"], - target_under_test = "//test/fixtures/debug_settings:private_deps_binary", - ) - - opt_debug_module_outputs_test( - name = "{}_debug_module_outputs_private_dependencies_opt".format(name), - expected_files = [ - "-test_fixtures_private_deps_client_swift_deps.swiftmodule", - "-test_fixtures_private_deps_private_swift.swiftmodule", - "-test_fixtures_private_deps_public_swift.swiftmodule", - "-private_cc.swift.pcm", - "-public_cc.swift.pcm", - "*", - ], - field = "files", - provider = "DefaultInfo", - tags = all_tags, - target_compatible_with = ["@platforms//os:macos"], - target_under_test = "//test/fixtures/debug_settings:private_deps_binary", - ) - - debug_module_outputs_test( - name = "{}_debug_module_outputs_swift_test_dbg".format(name), - expected_files = [ - "test_fixtures_precompiled_modules_simple_xctest.swiftmodule", - "*", - ], - field = "files", - provider = "DefaultInfo", - tags = all_tags, - target_compatible_with = ["@platforms//os:macos"], - target_under_test = "//test/fixtures/precompiled_modules:simple_xctest", - ) - - opt_debug_module_outputs_test( - name = "{}_debug_module_outputs_swift_test_opt".format(name), - expected_files = [ - "-test_fixtures_precompiled_modules_simple_xctest.swiftmodule", - "*", - ], - field = "files", - provider = "DefaultInfo", - tags = all_tags, - target_compatible_with = ["@platforms//os:macos"], - target_under_test = "//test/fixtures/precompiled_modules:simple_xctest", - ) - - legacy_debug_module_outputs_test( - name = "{}_legacy_debug_module_outputs".format(name), - expected_files = [ - "-test_fixtures_debug_settings_module_path_binary.swiftmodule", - "-test_fixtures_debug_settings_simple.swiftmodule", - "*", - ], - field = "files", - provider = "DefaultInfo", - tags = all_tags, - target_under_test = "//test/fixtures/debug_settings:module_path_binary", - ) - # Record the module path without passing the module to the linker. debug_module_path_test( name = "{}_debug_module_path_explicit_modules".format(name), @@ -529,7 +382,6 @@ def debug_settings_test_suite(name, tags = []): debug_module_path_linking_test( name = "{}_debug_module_path_explicit_modules_linking".format(name), - expect_module_input = False, expect_embedding = False, tags = all_tags, target_under_test = "//test/fixtures/debug_settings:simple", @@ -558,7 +410,6 @@ def debug_settings_test_suite(name, tags = []): debug_module_path_opt_linking_test( name = "{}_debug_module_path_opt_binary_linking".format(name), - expect_module_input = False, expect_embedding = False, is_binary = True, tags = all_tags, @@ -579,7 +430,6 @@ def debug_settings_test_suite(name, tags = []): debug_module_path_opt_full_di_linking_test( name = "{}_debug_module_path_opt_full_di_binary_linking".format(name), - expect_module_input = False, expect_embedding = False, is_binary = True, tags = all_tags, @@ -641,7 +491,6 @@ def debug_settings_test_suite(name, tags = []): no_embed_debug_module_linking_test( name = "{}_no_embed_debug_module_linking".format(name), - expect_module_input = False, expect_embedding = False, tags = all_tags, target_under_test = "//test/fixtures/debug_settings:simple", @@ -681,7 +530,6 @@ def debug_settings_test_suite(name, tags = []): debug_module_path_split_linking_test( name = "{}_debug_module_path_dependency_linking".format(name), - expect_module_input = False, expect_embedding = False, is_binary = True, tags = all_tags, diff --git a/test/fixtures/debug_settings/BUILD b/test/fixtures/debug_settings/BUILD index b6874c847..ef23ebb22 100644 --- a/test/fixtures/debug_settings/BUILD +++ b/test/fixtures/debug_settings/BUILD @@ -32,13 +32,3 @@ swift_binary( tags = FIXTURE_TAGS, deps = [":simple"], ) - -# No sources of its own: debug modules must be collected from dependencies. -swift_binary( - name = "private_deps_binary", - tags = FIXTURE_TAGS, - deps = [ - "//test/fixtures/private_deps:client_cc_deps", - "//test/fixtures/private_deps:client_swift_deps", - ], -)