Releases: bazelbuild/rules_swift
2.2.2
What's Changed
- Remove unnecessary SwiftBinaryInfo required provider from plugins attribute (#1445)
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.2.2", 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 = "5563621eb523f35373eb06a744f00a4c1d631e9b9af256754cd3ff152f888940",
url = "https://github.com/bazelbuild/rules_swift/releases/download/2.2.2/rules_swift.2.2.2.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()2.2.1
What's Changed
- Fix
build_filelabels (#1426) - Allow existing
SwiftInfoarguments until 3.0 (#1419) - Warn instead of fail when
swiftcnot found on Linux (#1433)
Full Changelog: 2.2.0...2.2.1
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.2.1", 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 = "fec71cca4c100e5d6ba9a700b17b3f3da94f43e693fa0e4e81ce7768ff66cd84",
url = "https://github.com/bazelbuild/rules_swift/releases/download/2.2.1/rules_swift.2.2.1.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()2.2.0
What's Changed
- Adding target name to output path for plugin executable by @tymurmustafaiev in #1294
- Simplify
swift_library_groupby @brentleyjones in #1292 - Fix coverage executable substitution in template by @sebastianv1 in #1297
- Remove arm simulator minimum version adjustment by @brentleyjones in #1298
- Un-conditionalize logic for features that require Xcode 15.0 or higher (dropping support for Xcode 14) by @luispadron in #1311
- Add toolchains by @brentleyjones in #1321
- Allow the Swift toolchain to be associated with an execution group and pass an optional execution group name down to actions that use it by @brentleyjones in #1318
- Add
mixed_langauge_libraryby @brentleyjones in #1293 - Fix non-Apple toolchains by @brentleyjones in #1323
- Switch the Swift rules over to toolchains by @brentleyjones in #1319
- Support
swift_{binary,test}generating a.dSYMbundle as an output when--apple_generate_dsymis set by @brentleyjones in #1327 - Add the
swift_module_mappingrule by @brentleyjones in #1329 - Add -file-prefix-map support by @brentleyjones in #1326
- Add the
module_mappingflag to the Swift rules by @brentleyjones in #1332 - Add new swift.modular_indexing feature to index explicit PCMs by @brentleyjones in #1331
- Don't use an absolute path for index unit names by @brentleyjones in #1334
- Add visibility to Starlark flags by @brentleyjones in #1338
- Add a Boolean
library_evolutionattribute toswift_libraryby @brentleyjones in #1335 - Add copts parameter to compile_module_interface() by @brentleyjones in #1336
- Implement compilation support for
swift_module_mappingby @brentleyjones in #1333 swift_import: always link the import. by @brentleyjones in #1343- Add the
swift_module_mapping_testrule by @brentleyjones in #1340 - Remove checks for Xcode versions prior to 14.0 and unconditionally enable features that require 14.0 or greater by @brentleyjones in #1353
- Only pass test runner deps to
swift_testtest runner compile by @brentleyjones in #1354 - Remove
force_apple_targetStarlark flag by @brentleyjones in #1350 - Add
swift.checked_exclusivityfeature by @brentleyjones in #1352 - Extract
derive_swift_module_nameas a free function in its own.bzlfile by @brentleyjones in #1347 - Remove the
swift_explicit_moduleoutput group fromswift_clang_module_aspectby @brentleyjones in #1349 - Allow configuring clang module dependencies for precompiled c modules by @brentleyjones in #1351
- Support
--test_filterinswift_testby @brentleyjones in #1341 - Support for alwayslink outputs. by @brentleyjones in #1356
- Disable AEGs inside xcode_swift_toolchain by @brentleyjones in #1359
- Define the
swift_cross_import_overlayrule by @brentleyjones in #1342 - Disable AEGs inside swift_library by @brentleyjones in #1361
- Disable AEGs inside rules which uses swift toolchain from a rule's attribute by @brentleyjones in #1360
- Pass
language = "objc"tocc_common.configure_featureswhen targeting an Apple platform by @brentleyjones in #1358 - Capture macro expansions in an output group named
macro_expansionsduring debug builds by @brentleyjones in #1355 - Extract
create_swift_module_contextandcreate_{clang,swift}_module_inputsas free functions in the lightweightproviders.bzlfile, and turncreate_swift_infointo the initializer callback forSwiftInfoby @brentleyjones in #1357 - Add cross-import overlay
SwiftInfos to compilation prerequisites when needed by @brentleyjones in #1362 - Extract
create_swift_interop_infoas a free function in the lightweightswift_interop_info.bzlfile by @brentleyjones in #1366 - Compile a .swiftinterface file into a .swiftmodule if present in apple_sdk_module rule by @brentleyjones in #1368
- Simplify
swift_common.compileso that it returns aSwiftInfothat can be propagated by callers by @brentleyjones in #1370 - Enable
swift.checked_exclusivityby default by @brentleyjones in #1371 - Add a feature that enables
-index-include-localsfor Swift compiles by @brentleyjones in #1375 - Align with upstream
const_gather_protocolschange by @brentleyjones in #1376 - Provide a way for aspects to participate in
swift_feature_allowlistchecking by @brentleyjones in #1377 - Use
ConfigResultInfoto set additional tools by @brentleyjones in #1378 - Add
swift.disable_clang_spifeature and enable it by default by @brentleyjones in #1372 - Remove duplicate
-enable-library-evolutionflag by @brentleyjones in #1382 - Create an empty marker provider
SwiftClangModuleAspectInfoby @brentleyjones in #1379 - Make sure
swift_importpropagates the.swiftinterfacefile in itsSwiftInfoif it's given one as an input by @brentleyjones in #1380 - Add an
is_frameworkparameter tocompile_module_interfaceby @brentleyjones in #1374 - Align
swift.supports_bare_slash_regexcode with upstream by @brentleyjones in #1384 - Write "isSystem" and "isFramework" in explicit swift module map by @brentleyjones in #1387
- Add
swift.internalize_at_linkfeature and enable it by default by @brentleyjones in #1389 - Extract
command_line_objc_coptstocompile_config.bzlby @brentleyjones in #1391 - Allow rules/aspects to optionally depend on the Swift toolchain by @brentleyjones in #1392
- Write entries for clang modules in explicit swift module map by @brentleyjones in #1394
- Consolidate default features logic by @brentleyjones in #1397
- Align macro support with upstream by @brentleyjones in #1395
- Allow testing of
swift_binarytargets by @brentleyjones in #1400 - Add
swift.disable_availability_checkingfeature by @brentleyjones in #1401 - Move declaration of
.swiftsourceinfofiles behind a feature since they are non-deterministic (contain absolute paths) by @brentleyjones in #1403 - Bless
SwiftBinaryInfoas a public provider for IDEs and language tooling that need to get at the Swift module of aswift_binaryorswift_testtarget by @brentleyjones in #1404 - Remove j2objc related code by @brentleyjones in #1406
- Add the ability to enable upcoming and experimental Swift features via Bazel features by @brentleyjones in #1405
- Add the
swift.enable_v6feature to support migration to the Swift 6 language mode by @brentleyjones in #1411 - Define
swift_compiler_plugin_importto support pre-built compiler plugins, and add apluginsattribute toswift_importby @brentleyjones in #1412 - Enable
AccessLevelOnImportby default by @brentleyjones in #1413
Full Changelog: 2.1.1...2.2.0
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.2.0"...2.1.1
What's Changed
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.1.1", 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 = "9919ed1d8dae509645bfd380537ae6501528d8de971caebed6d5185b9970dc4d",
url = "https://github.com/bazelbuild/rules_swift/releases/download/2.1.1/rules_swift.2.1.1.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()2.1.0
What's Changed
- Update extract symbol graphs rule to include swiftdoc by @luispadron in #1286
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.1.0", 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 = "8e0c72aa2be5ae44da44521c46e0700df184953e8dbc5d5423222b8cb141c64f",
url = "https://github.com/bazelbuild/rules_swift/releases/download/2.1.0/rules_swift.2.1.0.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()2.0.0
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 - Fixed usage of params files in
_swift_proto_compile: #1283
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", 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 = "32eeb4ef33c708d9c9a4ee0fa8475322ef149dabc81884ddc3b50eb2efff7843",
url = "https://github.com/bazelbuild/rules_swift/releases/download/2.0.0/rules_swift.2.0.0.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()2.0.0-rc1
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()1.18.0
What's Changed
- Remove unnecessary uses of
ctx.resolve_tools(Thanks, @tjgq!) - Update apple_support to 1.15.1 (Thanks, @luispadron!)
- Update
swift_importdocs and add warning (Thanks, @luispadron!) - Add
swift_proto_library_grouprule (Thanks, @AttilaTheFun!)
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 = "1.18.0", 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 = "bb01097c7c7a1407f8ad49a1a0b1960655cf823c26ad2782d0b7d15b323838e2",
url = "https://github.com/bazelbuild/rules_swift/releases/download/1.18.0/rules_swift.1.18.0.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()Full Changelog: 1.17.0...1.18.0
1.17.0
What's Changed
- Replace instances of
to_json()method withjson.encode(...)(Thanks, @c-mita!) - Add
swift.emit_swiftdocandswift.emit_swiftsourceinfofeatures to control Bazel tracking the .swiftdoc and .swiftsourceinfo files (Thanks, @chiragramani!) - Add
swift.emit_private_swiftinterfacefeature to control emitting .private.swiftinterface files (Thanks, @luispadron!) - Add the
swift_proto_libraryrules (Thanks, @AttilaTheFun!)
This release is compatible with 6.x LTS, 7.x LTS, and bazel 8.x rolling releases
MODULE.bazel Snippet
bazel_dep(name = "rules_swift", version = "1.17.0", 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 = "9bc9dc949062405412404c0f07f7323ba310f3f91f42af414ac27e338ba7bb8c",
url = "https://github.com/bazelbuild/rules_swift/releases/download/1.17.0/rules_swift.1.17.0.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()1.16.0
What's Changed
- Add the
swift_library_grouprule - Add the
always_include_developer_search_pathsattribute toswift_library
This release is compatible with 6.x LTS, 7.x LTS, and bazel 8.x rolling releases
MODULE.bazel Snippet
bazel_dep(name = "rules_swift", version = "1.16.0", 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 = "7aabe3bbef8d2e07c9ee07acb386f0a257bd2f76ea8e21005688b506dc8da67b",
url = "https://github.com/bazelbuild/rules_swift/releases/download/1.16.0/rules_swift.1.16.0.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()