2.0.0-rc1
Pre-release
Pre-release
What's Changed
Breaking Changes
- The
swift_module=tag oncc_librarytargets no longer does anything, and theswift_c_modulerule was removed: #1191 and #1224- Use the new
swift_interop_hintaspect hint instead - There were also some changes to how the
apple_common.Objcprovider is handled (e.g. d68b214)
- Use the new
- The deprecated swift proto library rules were removed: #1193
- The Bzlmod
module.compatibility_levelwas increased: #1214- If you ruleset can support both pre-2.0 and post-2.0 rules_swift, please set
bazel_dep.max_compatibility_level = 2instead of bumping your minimum supported version of rules_swift
- If you ruleset can support both pre-2.0 and post-2.0 rules_swift, please set
- The
swift.disable_system_indexfeature is now enabled by default: #1252 - Removed
swift.emit_symbol_graphfeature: #1229- Use the new
swift_symbol_graph_extractrule
- Use the new
- Removed the
swift.use_response_filesfeature: #1275 - Removed the
swift.bundled_xctestsfeature: #1272 - Removed the implicit output from swift_library: #1260
- Moved
swift_usage_aspectandSwiftUsageInfofrom rules_swift into rules_apple: #1223 - Manually specifying the
-index-store-pathflag while also using theswift.index_while_buildingis no longer supported: #1248 - It is now an error to specify both
swiftinterfaceandswiftmoduleinswift_import: #1253
Deprecations
- Moved rules and other build definitions into their own public files and deprecated the umbrella
swift.bzlandproto.bzlfiles: #1231, #1236, and #1255- Please update your
loadstatements as theswift.bzlfile will be removed in the next major release
- Please update your
Other changes
- Added support for symbol graph extraction with the
swift_symbol_graph_extractrule: #772, #1195, #1246, #1270, and #1271 - Added support for the
fdo_instrument_order_filefeature: #1251 - Added the
swift.add_target_name_to_outputfeature, which allows multiple targets in a package to produce the same module name in the same build: #1098 and #1217 - Added the
swift.thin_ltoandswift.full_ltofeatures to enable LTO: #1208 - Added the
swift.propagate_generated_module_mapfeature to propagate the generated module map: #1212 - Added the
swift.headers_always_action_inputsfeature which causes all headers to always be included as inputs toSwiftCompileactions, even when using explicit modules: #1249 - Added an API to compile a
.swiftinterfacefile into a.swiftmodule: #1250 - Added an XCTest observer to
swift_testtargets that generates a JUnit-style XML log at the path in theXML_OUTPUT_PATHenvironment variable defined by Bazel: #1222, #1242, #1263, and #1273 - Added a
discover_testsattribute toswift_test: #1259, #1266, #1273, and #1274 - Added a mechanism to provide a list of protocol names for constant value extraction: #1170
- Added a
swift_common.get_toolchainhelper function: #1226, #1257, and #1258 resource_setis now defined forSwiftCompileactions: #1241- Swift compiler sandboxing is now disabled when using Xcode 15.3+, which fixes nested sandboxing errors: #1206
- We now correctly add
.swiftmoduledirectories to the search path: #1245 - We now correctly calculate the minimum supported OS when calculating the target triple for 'arm64-apple-ios-simulator' targets: #1247
- The new driver is now used on Xcode 14+ since it contains the fixes in swiftlang/swift-driver#1036: #1268
- Removed some no-longer-relevant "supports X" features: #1267
- Fixed LLDB expr evaluation for
swift_{binary,test}targets only containing Swift in theirsrcs: #1269
This release is compatible with Bazel 6.x LTS, 7.x LTS, and 8.x rolling releases.
MODULE.bazel Snippet
bazel_dep(name = "rules_swift", version = "2.0.0-rc1", repo_name = "build_bazel_rules_swift")Workspace Snippet
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "build_bazel_rules_swift",
sha256 = "4ed76051139b7b95fb7e4884e6728af8b7ac77e7c80589a7c9f8f6dd106e53c9",
url = "https://github.com/bazelbuild/rules_swift/releases/download/2.0.0-rc1/rules_swift.2.0.0-rc1.tar.gz",
)
load(
"@build_bazel_rules_swift//swift:repositories.bzl",
"swift_rules_dependencies",
)
swift_rules_dependencies()
load(
"@build_bazel_rules_swift//swift:extras.bzl",
"swift_rules_extra_dependencies",
)
swift_rules_extra_dependencies()