Tags: bazelbuild/rules_swift
Tags
3.x: Update protobuf dependency version to 33.4 for Bazel 9 (#1648) > Bazel 9 enforces a minimum dependency on protobuf version 33.4, which includes support for a prebuilt protobuf compiler. Users can set the --@protobuf//bazel/toolchains:prefer_prebuilt_protoc flag to avoid having to build protoc. See the announcement on Protobuf News for more information.
Fix .swiftsourceinfo readonly bugs in version 3+ (#1550) Similar to #1533 but when using `--strategy=worker` In rules_swift < 3.x the .swiftsourceinfo files are unconditionally written to the module path. In rules_swift >= 3.x these same files are no longer tracked by Bazel unless explicitly requested. When using non-sandboxed mode, previous builds will contain these files and cause build failures when Swift tries to use them, in order to work around this compatibility issue, we check the module path for the presence of .swiftsourceinfo files and if they are present but not requested, we remove them. Testing: - `bazel clean --expunge` - `git checkout 2.8.2` - `bazel build @com_github_apple_swift_argument_parser//... --strategy=worker,local --worker_sandboxing=false` (pass) - `git checkout master` - `bazel build @com_github_apple_swift_argument_parser//... --strategy=worker,local --worker_sandboxing=false` (failure) - `git checkout <this-branch>` - `bazel build @com_github_apple_swift_argument_parser//... --strategy=worker,local --worker_sandboxing=false` (pass)
2.x cherry-pick: Add `clang_deps` attr to `mixed_language_library` (#… …1540) (#1542) At Square, we're using a headermap for the Swift generated header, so that the objective-C half of a module is able to import it using `#import <Module/Module-Swift.h>`. This headermap target can't be placed in `deps`, as doing so creates a dependency cycle. Here is an example of what the use case looks like: master...jschear:rules_swift:js/demo_swift_header_imports_in_clang_half ``` header_map( name = "swift_headermap", module_name = "MixedAnswer", propagate_include = False, # This relies on us knowing the naming scheme used for internal targets in mixed_language_library, which is not ideal. deps = ["MixedAnswer_swift"], ) mixed_language_library( name = "MixedAnswer", hdrs = ["MixedAnswer.h"], clang_copts = [ "-I$(execpath :swift_headermap)", "-I.", ], clang_deps = [":swift_headermap"], clang_srcs = [ "MixedAnswer.m", "MixedAnswerPrivate.m", "MixedAnswerPrivate.h", ], enable_modules = True, module_name = "MixedAnswer", swift_srcs = [ "MixedAnswer.swift", ], target_compatible_with = ["@platforms//os:macos"], ) ```
PreviousNext