Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions swift/internal/features.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ load(
"SWIFT_FEATURE_CHECKED_EXCLUSIVITY",
"SWIFT_FEATURE_COVERAGE",
"SWIFT_FEATURE_COVERAGE_PREFIX_MAP",
"SWIFT_FEATURE_DEBUG_PREFIX_MAP",
"SWIFT_FEATURE_DISABLE_CLANG_SPI",
"SWIFT_FEATURE_DISABLE_SYSTEM_INDEX",
"SWIFT_FEATURE_EMIT_SWIFTDOC",
Expand Down Expand Up @@ -250,7 +249,6 @@ def default_features_for_toolchain(target_triple):
SWIFT_FEATURE_CACHEABLE_SWIFTMODULES,
SWIFT_FEATURE_CHECKED_EXCLUSIVITY,
SWIFT_FEATURE_COVERAGE_PREFIX_MAP,
SWIFT_FEATURE_DEBUG_PREFIX_MAP,
SWIFT_FEATURE_DISABLE_CLANG_SPI,
SWIFT_FEATURE_DISABLE_SYSTEM_INDEX,
SWIFT_FEATURE_EMIT_SWIFTDOC,
Expand Down
12 changes: 1 addition & 11 deletions swift/toolchains/config/compile_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ def compile_action_configs(
],
configurators = [
add_arg("-Xwrapped-swift=-file-prefix-pwd-is-dot"),
add_arg("-file-prefix-map", "__BAZEL_XCODE_DEVELOPER_DIR__=/PLACEHOLDER_DEVELOPER_DIR"),
],
features = [SWIFT_FEATURE_FILE_PREFIX_MAP],
),
Expand Down Expand Up @@ -1140,17 +1141,6 @@ def compile_action_configs(
],
configurators = [_module_name_configurator],
),
ActionConfigInfo(
actions = [
SWIFT_ACTION_COMPILE,
SWIFT_ACTION_DERIVE_FILES,
SWIFT_ACTION_PRECOMPILE_C_MODULE,
],
configurators = [
add_arg("-file-prefix-map", "__BAZEL_XCODE_DEVELOPER_DIR__=/PLACEHOLDER_DEVELOPER_DIR"),
],
features = [SWIFT_FEATURE_FILE_PREFIX_MAP],
),

# Set the package name.
ActionConfigInfo(
Expand Down
57 changes: 13 additions & 44 deletions test/debug_settings_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,43 +23,27 @@ DBG_CONFIG_SETTINGS = {
"//command_line_option:compilation_mode": "dbg",
"//command_line_option:features": [
"-swift.cacheable_swiftmodules",
"swift.debug_prefix_map",
"-swift.file_prefix_map",
],
}

FILE_PREFIX_MAP_CONFIG_SETTINGS = {
"//command_line_option:compilation_mode": "dbg",
"//command_line_option:features": [
"swift.debug_prefix_map",
"swift.file_prefix_map",
],
}

CACHEABLE_DBG_CONFIG_SETTINGS = {
"//command_line_option:compilation_mode": "dbg",
"//command_line_option:features": [
"swift.cacheable_swiftmodules",
"swift.debug_prefix_map",
"-swift.file_prefix_map",
],
}

FASTBUILD_CONFIG_SETTINGS = {
"//command_line_option:compilation_mode": "fastbuild",
"//command_line_option:features": [
"-swift.cacheable_swiftmodules",
"swift.debug_prefix_map",
"-swift.file_prefix_map",
],
}

FASTBUILD_FULL_DI_CONFIG_SETTINGS = {
"//command_line_option:compilation_mode": "fastbuild",
"//command_line_option:features": [
"-swift.cacheable_swiftmodules",
"swift.debug_prefix_map",
"-swift.file_prefix_map",
"swift.full_debug_info",
],
}
Expand All @@ -68,9 +52,6 @@ OPT_CONFIG_SETTINGS = {
"//command_line_option:compilation_mode": "opt",
"//command_line_option:features": [
"-swift.cacheable_swiftmodules",
# This feature indicates *support*, not unconditional enablement, which
# is why it is present for `opt` mode as well.
"swift.debug_prefix_map",
],
}

Expand All @@ -86,10 +67,6 @@ dbg_action_command_line_test = make_action_command_line_test_rule(
config_settings = DBG_CONFIG_SETTINGS,
)

file_prefix_map_command_line_test = make_action_command_line_test_rule(
config_settings = FILE_PREFIX_MAP_CONFIG_SETTINGS,
)

cacheable_dbg_action_command_line_test = make_action_command_line_test_rule(
config_settings = CACHEABLE_DBG_CONFIG_SETTINGS,
)
Expand Down Expand Up @@ -136,26 +113,13 @@ def debug_settings_test_suite(name, tags = []):
expected_argv = [
"-DDEBUG",
"-Xfrontend -serialize-debugging-options",
"-Xwrapped-swift=-debug-prefix-pwd-is-dot",
"-Xwrapped-swift=-file-prefix-pwd-is-dot",
"-g",
],
not_expected_argv = [
"-DNDEBUG",
"-Xfrontend -no-serialize-debugging-options",
"-gline-tables-only",
],
mnemonic = "SwiftCompile",
tags = all_tags,
target_under_test = "//test/fixtures/debug_settings:simple",
)

# Verify that the build is remapping paths with a file prefix map.
file_prefix_map_command_line_test(
name = "{}_file_prefix_map_build".format(name),
expected_argv = [
"-Xwrapped-swift=-file-prefix-pwd-is-dot",
],
not_expected_argv = [
"-Xwrapped-swift=-debug-prefix-pwd-is-dot",
],
mnemonic = "SwiftCompile",
Expand All @@ -171,13 +135,14 @@ def debug_settings_test_suite(name, tags = []):
expected_argv = [
"-DDEBUG",
"-Xfrontend -no-serialize-debugging-options",
"-Xwrapped-swift=-debug-prefix-pwd-is-dot",
"-Xwrapped-swift=-file-prefix-pwd-is-dot",
"-g",
],
not_expected_argv = [
"-DNDEBUG",
"-Xfrontend -serialize-debugging-options",
"-gline-tables-only",
"-Xwrapped-swift=-debug-prefix-pwd-is-dot",
],
mnemonic = "SwiftCompile",
tags = all_tags,
Expand All @@ -191,13 +156,14 @@ def debug_settings_test_suite(name, tags = []):
expected_argv = [
"-DDEBUG",
"-Xfrontend -serialize-debugging-options",
"-Xwrapped-swift=-debug-prefix-pwd-is-dot",
"-Xwrapped-swift=-file-prefix-pwd-is-dot",
"-gline-tables-only",
],
not_expected_argv = [
"-DNDEBUG",
"-Xfrontend -no-serialize-debugging-options",
"-g",
"-Xwrapped-swift=-debug-prefix-pwd-is-dot",
],
mnemonic = "SwiftCompile",
tags = all_tags,
Expand All @@ -211,25 +177,27 @@ def debug_settings_test_suite(name, tags = []):
expected_argv = [
"-DDEBUG",
"-Xfrontend -serialize-debugging-options",
"-Xwrapped-swift=-debug-prefix-pwd-is-dot",
"-Xwrapped-swift=-file-prefix-pwd-is-dot",
"-g",
],
not_expected_argv = [
"-DNDEBUG",
"-Xfrontend -no-serialize-debugging-options",
"-gline-tables-only",
"-Xwrapped-swift=-debug-prefix-pwd-is-dot",
],
mnemonic = "SwiftCompile",
tags = all_tags,
target_under_test = "//test/fixtures/debug_settings:simple",
)

# Verify that `-c opt` builds do not serialize debugging options or remap
# paths, and have appropriate flags otherwise.
# Verify that `-c opt` builds do not serialize debugging options, but have
# appropriate flags otherwise.
opt_action_command_line_test(
name = "{}_opt_build".format(name),
expected_argv = [
"-DNDEBUG",
"-Xwrapped-swift=-file-prefix-pwd-is-dot",
],
not_expected_argv = [
"-DDEBUG",
Expand All @@ -243,13 +211,14 @@ def debug_settings_test_suite(name, tags = []):
target_under_test = "//test/fixtures/debug_settings:simple",
)

# Verify that `-c opt` builds do not serialize debugging options or remap
# paths, and have appropriate flags otherwise.
# Verify that `-c opt` builds do not serialize debugging options, but have
# appropriate flags otherwise.
cacheable_opt_action_command_line_test(
name = "{}_cacheable_opt_build".format(name),
expected_argv = [
"-DNDEBUG",
"-Xfrontend -no-serialize-debugging-options",
"-Xwrapped-swift=-file-prefix-pwd-is-dot",
],
not_expected_argv = [
"-Xfrontend -serialize-debugging-options",
Expand Down