Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add swift.disable_availability_checking feature #1401

Merged
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
4 changes: 4 additions & 0 deletions swift/internal/feature_names.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ SWIFT_FEATURE_DISABLE_CLANG_SPI = "swift.disable_clang_spi"
# explicitly exported via `-exported_symbols_list`.
SWIFT_FEATURE_INTERNALIZE_AT_LINK = "swift.internalize_at_link"

# If enabled, requests the `-disable-availability-checking` frontend flag.
# This disables checking for potentially unavailable APIs.
SWIFT_FEATURE_DISABLE_AVAILABILITY_CHECKING = "swift.disable_availability_checking"

# Disables Swift sandbox which prevents issues with nested sandboxing when Swift code contains system-provided macros.
# If enabled '#Preview' macro provided by SwiftUI fails to build and probably other system-provided macros.
# Enabled by default for Swift 5.10+ on macOS.
Expand Down
10 changes: 10 additions & 0 deletions swift/toolchains/config/compile_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ load(
"SWIFT_FEATURE_COVERAGE_PREFIX_MAP",
"SWIFT_FEATURE_DBG",
"SWIFT_FEATURE_DEBUG_PREFIX_MAP",
"SWIFT_FEATURE_DISABLE_AVAILABILITY_CHECKING",
"SWIFT_FEATURE_DISABLE_CLANG_SPI",
"SWIFT_FEATURE_DISABLE_SWIFT_SANDBOX",
"SWIFT_FEATURE_DISABLE_SYSTEM_INDEX",
Expand Down Expand Up @@ -1146,6 +1147,15 @@ def compile_action_configs(
SWIFT_FEATURE_DISABLE_CLANG_SPI,
],
),
ActionConfigInfo(
actions = [
SWIFT_ACTION_COMPILE,
],
configurators = [add_arg("-Xfrontend", "-disable-availability-checking")],
features = [
SWIFT_FEATURE_DISABLE_AVAILABILITY_CHECKING,
],
),
]

# NOTE: The positions of these action configs in the list are important,
Expand Down