Skip to content

Commit

Permalink
Enable swift.use_global_module_cache by default (#956)
Browse files Browse the repository at this point in the history
  • Loading branch information
brentleyjones authored Dec 20, 2022
1 parent b7433db commit c7ed06e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions swift/internal/swift_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ load(
"SWIFT_FEATURE_NO_GENERATED_MODULE_MAP",
"SWIFT_FEATURE_OPT_USES_WMO",
"SWIFT_FEATURE_USE_AUTOLINK_EXTRACT",
"SWIFT_FEATURE_USE_GLOBAL_MODULE_CACHE",
"SWIFT_FEATURE_USE_MODULE_WRAP",
"SWIFT_FEATURE_USE_RESPONSE_FILES",
)
Expand Down Expand Up @@ -285,6 +286,7 @@ def _swift_toolchain_impl(ctx):
requested_features.extend([
SWIFT_FEATURE_NO_GENERATED_MODULE_MAP,
SWIFT_FEATURE_OPT_USES_WMO,
SWIFT_FEATURE_USE_GLOBAL_MODULE_CACHE,
])

requested_features.extend(ctx.features)
Expand Down
4 changes: 3 additions & 1 deletion swift/internal/xcode_swift_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ load(
"SWIFT_FEATURE_SUPPORTS_LIBRARY_EVOLUTION",
"SWIFT_FEATURE_SUPPORTS_PRIVATE_DEPS",
"SWIFT_FEATURE_SUPPORTS_SYSTEM_MODULE_FLAG",
"SWIFT_FEATURE_USE_GLOBAL_MODULE_CACHE",
"SWIFT_FEATURE_USE_RESPONSE_FILES",
)
load(":features.bzl", "features_for_build_modes")
Expand Down Expand Up @@ -607,11 +608,12 @@ def _xcode_swift_toolchain_impl(ctx):
requested_features.extend([
SWIFT_FEATURE_BUNDLED_XCTESTS,
SWIFT_FEATURE_ENABLE_BATCH_MODE,
SWIFT_FEATURE_USE_RESPONSE_FILES,
SWIFT_FEATURE_DEBUG_PREFIX_MAP,
SWIFT_FEATURE_OPT_USES_WMO,
SWIFT_FEATURE_SUPPORTS_LIBRARY_EVOLUTION,
SWIFT_FEATURE_SUPPORTS_PRIVATE_DEPS,
SWIFT_FEATURE_USE_GLOBAL_MODULE_CACHE,
SWIFT_FEATURE_USE_RESPONSE_FILES,
])

# Xcode 11.0 implies Swift 5.1.
Expand Down
1 change: 1 addition & 0 deletions test/module_cache_settings_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ incorrect_global_module_cache_uses_tmpdir_action_command_line_test = make_action
config_settings = {
"//command_line_option:features": [
"swift.global_module_cache_uses_tmpdir",
"-swift.use_global_module_cache",
],
},
)
Expand Down

0 comments on commit c7ed06e

Please sign in to comment.