Skip to content

swb: point SWIFT_LIBRARY_PATH at the SDK's Swift libraries - #465

Open
ap-1 wants to merge 1 commit into
xtool-org:pre/2.xfrom
ap-1:swift-library-path
Open

ap-1 wants to merge 1 commit into
xtool-org:pre/2.xfrom
ap-1:swift-library-path

Conversation

@ap-1

@ap-1 ap-1 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

On Linux, apps linked through clang, like the app target of an Xcode project, fail when they need the Swift compatibility libraries (for example libswiftCompatibility56 when a dependency targets iOS 15), because Swift Build looks for them next to the host toolchain.

This sets SWIFT_LIBRARY_PATH to the SDK's Swift libraries for the destination platform.

How was it tested?

Built a Capacitor app's Xcode project whose plugins target iOS 15

AI tool usage

How much of the code in this PR was AI-assisted? (check one)

  • 0 - No AI was used to write code
  • 1 - I was assisted by AI in writing code. I reviewed the finished result.
  • 2 - I set the AI going and left it to it; nobody has read the result - no review, or AI review only

Summary by CodeRabbit

  • Bug Fixes
    • Non-macOS builds now use the platform-specific Swift library location within the Swift resources. This improves library resolution during builds on those platforms. The change is limited to build behavior; no user-facing interface changes are included.

Signed-off-by: Anish Pallati <i@anish.land>
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

On non-macOS platforms, BuildCoordinator sets SWIFT_LIBRARY_PATH[__destination_platform=YES] to a platform-specific directory beneath the Swift resource directory.

Changes: Swift library path configuration

Layer / File(s) Summary
Set platform-specific library path
Sources/XToolSupport/BuildCoordinator.swift
On non-macOS platforms, BuildCoordinator adds the directory beneath swiftResourceDir that uses $(PLATFORM_NAME) to the destination-platform Swift library path.

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Bug fix

Suggested reviewers: kabiroberai

Merge Risk: Minimal · up to f5b91

This change points the Swift library path at the destination SDK's libraries on non-macOS hosts, so apps that need Swift compatibility libraries can link. The override is scoped to the destination platform, and no concrete risk was found. It is ready to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: SWIFT_LIBRARY_PATH now points at the SDK's Swift libraries. The raw summary confirms that BuildCoordinator sets SWIFT_LIBRARY_PATH[__destination_platform=YES] to the p…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: SWIFT_LIBRARY_PATH now points at the SDK's Swift libraries. The raw summary confirms that BuildCoordinator sets SWIFT_LIBRARY_PATH[__destination_platform=YES] to the platform-specific directory under the Swift resource directory on non-macOS platforms. The objectives describe the same goal, so the title matches the change and is specific enough for a teammate scanning history.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ed208fb5-0c34-4c70-873f-70e68391270f
Commits

Reviewing files that changed from the base of the PR and between 73dc5f1 and f5b91a4.

Files selected for processing: 1

  • Sources/XToolSupport/BuildCoordinator.swift

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant