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: 2.8.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: 2.9.0
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jun 12, 2025

  1. Cherry-pick 2.x: Add always_include_developer_search_paths to `mixe…

    …d_language_librar… (#1541)
    
    …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
    d187295 View commit details
    Browse the repository at this point in the history
  2. 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"],
    )
    ```
    jschear authored Jun 12, 2025
    Configuration menu
    Copy the full SHA
    aa175e1 View commit details
    Browse the repository at this point in the history
Loading