diff --git a/doc/rules.md b/doc/rules.md
index 6d9fdb366..e2ad7921c 100644
--- a/doc/rules.md
+++ b/doc/rules.md
@@ -993,9 +993,9 @@ swift_library(
mixed_language_library(name, alwayslink, clang_copts, clang_defines, clang_srcs, data,
enable_modules, hdrs, includes, linkopts, module_map, module_name,
- non_arc_srcs, private_deps, sdk_dylibs, sdk_frameworks, swift_copts,
- swift_defines, swift_srcs, swiftc_inputs, textual_hdrs, umbrella_header,
- weak_sdk_frameworks, deps, kwargs)
+ non_arc_srcs, package_name, private_deps, sdk_dylibs, sdk_frameworks,
+ swift_copts, swift_defines, swift_srcs, swiftc_inputs, textual_hdrs,
+ umbrella_header, weak_sdk_frameworks, deps, kwargs)
Creates a mixed language library from a Clang and Swift library target pair.
@@ -1022,6 +1022,7 @@ Once that is the case, this macro will be deprecated.
| module_map | A `File` representing an existing module map that should be used to represent the module, or `None` (the default) if the module map should be generated based on `hdrs`. If this argument is provided, then `module_name` must also be provided.
Warning: If a module map (whether provided here or not) is able to be found via an include path, it will result in duplicate module definition errors for downstream targets unless sandboxing or remote execution is used. | `None` |
| module_name | The name of the Swift module being built.
If left unspecified, the module name will be computed based on the target's build label, by stripping the leading `//` and replacing `/`, `:`, and other non-identifier characters with underscores. | `None` |
| non_arc_srcs | The list of Objective-C files that are processed to create the library target that DO NOT use ARC. The files in this attribute are treated very similar to those in the `clang_srcs` attribute, but are compiled without ARC enabled. | `[]` |
+| package_name | The semantic package of the Swift target being built. Targets with the same `package_name` can access APIs using the 'package' access control modifier in Swift 5.9+. | `None` |
| private_deps | A list of targets that are implementation-only dependencies of the target being built. Libraries/linker flags from these dependencies will be propagated to dependent for linking, but artifacts/flags required for compilation (such as .swiftmodule files, C headers, and search paths) will not be propagated. | `[]` |
| sdk_dylibs | A list of of SDK `.dylib` libraries to link with. For instance, "libz" or "libarchive". "libc++" is included automatically if the binary has any C++ or Objective-C++ sources in its dependency tree. When linking a binary, all libraries named in that binary's transitive dependency graph are used. | `[]` |
| sdk_frameworks | A list of SDK frameworks to link with (e.g. "AddressBook", "QuartzCore").
When linking a top level Apple binary, all SDK frameworks listed in that binary's transitive dependency graph are linked. | `[]` |
diff --git a/mixed_language/mixed_language_library.bzl b/mixed_language/mixed_language_library.bzl
index 927d1c25c..5e603c24e 100644
--- a/mixed_language/mixed_language_library.bzl
+++ b/mixed_language/mixed_language_library.bzl
@@ -47,6 +47,7 @@ def mixed_language_library(
module_map = None,
module_name = None,
non_arc_srcs = [],
+ package_name = None,
private_deps = [],
sdk_dylibs = [],
sdk_frameworks = [],
@@ -118,6 +119,9 @@ def mixed_language_library(
the library target that DO NOT use ARC. The files in this attribute
are treated very similar to those in the `clang_srcs` attribute, but
are compiled without ARC enabled.
+ package_name: The semantic package of the Swift target being built. Targets
+ with the same `package_name` can access APIs using the 'package'
+ access control modifier in Swift 5.9+.
private_deps: A list of targets that are implementation-only
dependencies of the target being built. Libraries/linker flags from
these dependencies will be propagated to dependent for linking, but
@@ -314,6 +318,7 @@ a mixed language Swift library, use a clang only library rule like \
generated_header_name = module_name + "-Swift.h",
linkopts = linkopts,
module_name = module_name,
+ package_name = package_name,
private_deps = private_deps,
swiftc_inputs = swiftc_inputs,
tags = internal_tags,