Releases: bazelbuild/rules_swift
2.3.1
What's Changed
- Add implicit deps to
swift_library_group
(#1468)
Full Changelog: 2.3.0...2.3.1
This release is compatible with Bazel 6.x LTS, 7.x LTS, 8.x LTS, and 9.x rolling releases.
MODULE.bazel Snippet
bazel_dep(name = "rules_swift", version = "2.3.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 = "5bb49e7a1764f3f227677c572d6487b5bfeb2613eaaae2a82b240d9b836a0b4e",
url = "https://github.com/bazelbuild/rules_swift/releases/download/2.3.1/rules_swift.2.3.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.3.0
What's Changed
package_name
is supported inmixed_language_library
rule by @luispadron in #1467
Full Changelog: 2.2.4...2.3.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.3.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 = "7a626237ca4d9ecf4f5b4cb5bf13ff63ab6b27e101f834e7e2e07c3b98d583f9",
url = "https://github.com/bazelbuild/rules_swift/releases/download/2.3.0/rules_swift.2.3.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.2.4
What's Changed
- Fix
apple.swizzle_absolute_xcttestsourcelocation
usage (#1457)
Full Changelog: 2.2.3...2.2.4
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.4", 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 = "9f142f9e7200455f716cf8c88cb06fc2f51768bf9e65402440f58acdf4a3db17",
url = "https://github.com/bazelbuild/rules_swift/releases/download/2.2.4/rules_swift.2.2.4.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.3
What's Changed
- Add
data
attribute tomixed_language_library
(#1450) - Set
alwayslink
on the clang target ofmixed_language_library
as well (#1451)
Full Changelog: 2.2.2...2.2.3
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.3", 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 = "1dffffcbdc969c3d0865fcabace3ff576a81009e2add5688e740d8a9342efef5",
url = "https://github.com/bazelbuild/rules_swift/releases/download/2.2.3/rules_swift.2.2.3.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.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_file
labels (#1426) - Allow existing
SwiftInfo
arguments until 3.0 (#1419) - Warn instead of fail when
swiftc
not 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_group
by @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_library
by @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.dSYM
bundle as an output when--apple_generate_dsym
is set by @brentleyjones in #1327 - Add the
swift_module_mapping
rule by @brentleyjones in #1329 - Add -file-prefix-map support by @brentleyjones in #1326
- Add the
module_mapping
flag 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_evolution
attribute toswift_library
by @brentleyjones in #1335 - Add copts parameter to compile_module_interface() by @brentleyjones in #1336
- Implement compilation support for
swift_module_mapping
by @brentleyjones in #1333 swift_import
: always link the import. by @brentleyjones in #1343- Add the
swift_module_mapping_test
rule 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_test
test runner compile by @brentleyjones in #1354 - Remove
force_apple_target
Starlark flag by @brentleyjones in #1350 - Add
swift.checked_exclusivity
feature by @brentleyjones in #1352 - Extract
derive_swift_module_name
as a free function in its own.bzl
file by @brentleyjones in #1347 - Remove the
swift_explicit_module
output group fromswift_clang_module_aspect
by @brentleyjones in #1349 - Allow configuring clang module dependencies for precompiled c modules by @brentleyjones in #1351
- Support
--test_filter
inswift_test
by @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_overlay
rule 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_features
when targeting an Apple platform by @brentleyjones in #1358 - Capture macro expansions in an output group named
macro_expansions
during debug builds by @brentleyjones in #1355 - Extract
create_swift_module_context
andcreate_{clang,swift}_module_inputs
as free functions in the lightweightproviders.bzl
file, and turncreate_swift_info
into the initializer callback forSwiftInfo
by @brentleyjones in #1357 - Add cross-import overlay
SwiftInfo
s to compilation prerequisites when needed by @brentleyjones in #1362 - Extract
create_swift_interop_info
as a free function in the lightweightswift_interop_info.bzl
file 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.compile
so that it returns aSwiftInfo
that can be propagated by callers by @brentleyjones in #1370 - Enable
swift.checked_exclusivity
by default by @brentleyjones in #1371 - Add a feature that enables
-index-include-locals
for Swift compiles by @brentleyjones in #1375 - Align with upstream
const_gather_protocols
change by @brentleyjones in #1376 - Provide a way for aspects to participate in
swift_feature_allowlist
checking by @brentleyjones in #1377 - Use
ConfigResultInfo
to set additional tools by @brentleyjones in #1378 - Add
swift.disable_clang_spi
feature and enable it by default by @brentleyjones in #1372 - Remove duplicate
-enable-library-evolution
flag by @brentleyjones in #1382 - Create an empty marker provider
SwiftClangModuleAspectInfo
by @brentleyjones in #1379 - Make sure
swift_import
propagates the.swiftinterface
file in itsSwiftInfo
if it's given one as an input by @brentleyjones in #1380 - Add an
is_framework
parameter tocompile_module_interface
by @brentleyjones in #1374 - Align
swift.supports_bare_slash_regex
code with upstream by @brentleyjones in #1384 - Write "isSystem" and "isFramework" in explicit swift module map by @brentleyjones in #1387
- Add
swift.internalize_at_link
feature and enable it by default by @brentleyjones in #1389 - Extract
command_line_objc_copts
tocompile_config.bzl
by @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_binary
targets by @brentleyjones in #1400 - Add
swift.disable_availability_checking
feature by @brentleyjones in #1401 - Move declaration of
.swiftsourceinfo
files behind a feature since they are non-deterministic (contain absolute paths) by @brentleyjones in #1403 - Bless
SwiftBinaryInfo
as a public provider for IDEs and language tooling that need to get at the Swift module of aswift_binary
orswift_test
target 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_v6
feature to support migration to the Swift 6 language mode by @brentleyjones in #1411 - Define
swift_compiler_plugin_import
to support pre-built compiler plugins, and add aplugins
attribute toswift_import
by @brentleyjones in #1412 - Enable
AccessLevelOnImport
by 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_library
targets no longer does anything, and theswift_c_module
rule was removed: #1191 and #1224- Use the new
swift_interop_hint
aspect hint instead - There were also some changes to how the
apple_common.Objc
provider is handled (e.g. d68b214)
- Use the new
- The deprecated swift proto library rules were removed: #1193
- The Bzlmod
module.compatibility_level
was increased: #1214- If you ruleset can support both pre-2.0 and post-2.0 rules_swift, please set
bazel_dep.max_compatibility_level = 2
instead 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_index
feature is now enabled by default: #1252 - Removed
swift.emit_symbol_graph
feature: #1229- Use the new
swift_symbol_graph_extract
rule
- Use the new
- Removed the
swift.use_response_files
feature: #1275 - Removed the
swift.bundled_xctests
feature: #1272 - Removed the implicit output from swift_library: #1260
- Moved
swift_usage_aspect
andSwiftUsageInfo
from rules_swift into rules_apple: #1223 - Manually specifying the
-index-store-path
flag while also using theswift.index_while_building
is no longer supported: #1248 - It is now an error to specify both
swiftinterface
andswiftmodule
inswift_import
: #1253
Deprecations
- Moved rules and other build definitions into their own public files and deprecated the umbrella
swift.bzl
andproto.bzl
files: #1231, #1236, and #1255- Please update your
load
statements as theswift.bzl
file will be removed in the next major release
- Please update your
Other changes
- Added support for symbol graph extraction with the
swift_symbol_graph_extract
rule: #772, #1195, #1246, #1270, and #1271 - Added support for the
fdo_instrument_order_file
feature: #1251 - Added the
swift.add_target_name_to_output
feature, which allows multiple targets in a package to produce the same module name in the same build: #1098 and #1217 - Added the
swift.thin_lto
andswift.full_lto
features to enable LTO: #1208 - Added the
swift.propagate_generated_module_map
feature to propagate the generated module map: #1212 - Added the
swift.headers_always_action_inputs
feature which causes all headers to always be included as inputs toSwiftCompile
actions, even when using explicit modules: #1249 - Added an API to compile a
.swiftinterface
file into a.swiftmodule
: #1250 - Added an XCTest observer to
swift_test
targets that generates a JUnit-style XML log at the path in theXML_OUTPUT_PATH
environment variable defined by Bazel: #1222, #1242, #1263, and #1273 - Added a
discover_tests
attribute 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_toolchain
helper function: #1226, #1257, and #1258 resource_set
is now defined forSwiftCompile
actions: #1241- Swift compiler sandboxing is now disabled when using Xcode 15.3+, which fixes nested sandboxing errors: #1206
- We now correctly add
.swiftmodule
directories 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()