Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bazelbuild/rules_swift
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.0.2
Choose a base ref
...
head repository: bazelbuild/rules_swift
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3.1.0
Choose a head ref
  • 6 commits
  • 72 files changed
  • 5 contributors

Commits on Jun 12, 2025

  1. Add always_include_developer_search_paths to `mixed_language_librar…

    …y` (#1539)
    
    This allows Swift code in the library to depend on XCTest.
    
    If this was passed in `kwargs`, it gets passed along to the internal
    `objc_library` targets:
    ```
    ~/Development/rules_swift master $ bazel build //examples/apple/mixed_language:MixedAnswer
    ERROR: /Users/jschear/Development/rules_swift/examples/apple/mixed_language/BUILD:5:23: //examples/apple/mixed_language:MixedAnswer_headers: no such attribute 'always_include_developer_search_paths' in 'objc_library' rule
    ERROR: /Users/jschear/Development/rules_swift/examples/apple/mixed_language/BUILD:5:23: //examples/apple/mixed_language:MixedAnswer_clang: no such attribute 'always_include_developer_search_paths' in 'objc_library' rule
    ```
    We _could_ alternatively `.pop` it off of `kwargs` before passing to
    `objc_library`, but tracking which attributes belong to `swift_library`
    vs. `obj_library` and which are shared can get a bit complex.
    jschear authored Jun 12, 2025
    Configuration menu
    Copy the full SHA
    580e10c View commit details
    Browse the repository at this point in the history
  2. Add clang_deps attr to mixed_language_library (#1540)

    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"],
    )
    ```
    jschear authored Jun 12, 2025
    Configuration menu
    Copy the full SHA
    321bf26 View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2025

  1. Use ctx.coverage_instrumented to detect if a target should be instr…

    …umented (#1547)
    
    Signed-off-by: Brentley Jones <[email protected]>
    Co-authored-by: Fabian Meumertzheim <[email protected]>
    brentleyjones and fmeum authored Jun 27, 2025
    Configuration menu
    Copy the full SHA
    ccfe585 View commit details
    Browse the repository at this point in the history

Commits on Jul 7, 2025

  1. bump buildifier in bazelci and correct new lints (#1548)

    also bump rules_cc to 0.1.2
    aaronsky authored Jul 7, 2025
    Configuration menu
    Copy the full SHA
    37ef09a View commit details
    Browse the repository at this point in the history
  2. fix rules_cc for 7.x WORKSPACE/non-bzlmod users (#1549)

    only way i could figure to get this to work was to not assist in
    standing up neither `protobuf_deps()` nor `rules_cc_dependencies()` in
    `swift_extra_dependencies()` – this works around the ordering issue that
    breaks transitive dep loading of both rules_python/rules_java and our
    stardoc configuration
    aaronsky authored Jul 7, 2025
    Configuration menu
    Copy the full SHA
    7445b2c View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2025

  1. 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)
    luispadron authored Jul 9, 2025
    Configuration menu
    Copy the full SHA
    6d28b81 View commit details
    Browse the repository at this point in the history
Loading