Skip to content

sdk: enable cross-import overlays with SwiftBuild - #361

Open
SrgGrch wants to merge 1 commit into
xtool-org:mainfrom
SrgGrch:enable-cross-import-overlays-for-swb
Open

SrgGrch wants to merge 1 commit into
xtool-org:mainfrom
SrgGrch:enable-cross-import-overlays-for-swb

Conversation

@SrgGrch

@SrgGrch SrgGrch commented Oct 16, 2026 •

Copy link
Copy Markdown

What does this PR do?

Fixes #360 cross-import overlays on Linux for builds with swift 6.4+.

This PR adds "-Xfrontend", "-enable-cross-import-overlays" to toolchan-swb.json as it was added to toolchan.json.
Also bumps sdkEpoch so SDK will rebuild after update.

How was it tested?

Build was tested locally with branch built from sources.

xtool new example, then replace the app file

Fix was tested on this example:

import SwiftUI
import PhotosUI

@main
struct exampleApp: App {
    @State private var item: PhotosPickerItem?

    var body: some Scene {
        WindowGroup {
            PhotosPicker("Pick a photo", selection: $item)
        }
    }
}

It fails on version 1.22.2, but builds normally when xtool built from this branch.

AI tool usage

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

  • 0 - No AI was used to write code
  • 1 - I was assisted by AI. 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

  • Configuration Updates
    • Generated Swift toolchain settings no longer explicitly select the LLD linker. Existing frontend and cross-import overlay options remain unchanged. This affects linker selection for generated toolsets; no public API changes are included.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f320f1e4-628a-433f-b00a-138e68c3b520
📥 Commits

Reviewing files that changed from the base of the PR and between 316a11e and a9fea47.

📒 Files selected for processing: 1
  • Sources/XToolSupport/SDKBuilder.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.

📝 Walkthrough

The SDK epoch increases from 3 to 4. The generated toolset-swb.json no longer includes -use-ld=lld; it retains -Xfrontend and -enable-cross-import-overlays.

Changes: Swift build toolset

Layer / File(s) Summary
SDK epoch and compiler options
Sources/XToolSupport/SDKBuilder.swift
The SDK epoch changes from 3 to 4. The generated toolset removes -use-ld=lld and retains -Xfrontend and -enable-cross-import-overlays.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: kabiroberai

Merge Risk: ⚪ Minimal · up to a9fea

The updated SwiftBuild toolset enables cross-import overlays for supported Swift 6.4+ builds, addressing the reported Linux import failure. No actionable merge blocker is evident.

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 clearly and concisely identifies the main change: enabling cross-import overlays with SwiftBuild. It matches the pull request objectives and the changeset.
Linked Issues check Passed Issue #360 requires the SwiftBuild SDK toolset to enable cross-import overlays for Swift 6.4+. SDKBuilder.buildSDK() now writes -Xfrontend and -enable-cross-import-overlays to toolset-swb.json…
Out of Scope Changes check Passed The whole-PR diff changes only Sources/XToolSupport/SDKBuilder.swift. Both changes support issue #360: the compiler options fix the SwiftBuild configuration, and the epoch change refreshes generated…
Full details: Linked Issues check

Explanation

Issue #360 requires the SwiftBuild SDK toolset to enable cross-import overlays for Swift 6.4+. SDKBuilder.buildSDK() now writes -Xfrontend and -enable-cross-import-overlays to toolset-swb.json. The change also increments sdkEpoch from 3 to 4, which causes the SDK to rebuild. The reported PhotosUI and SwiftUI reproduction passed with the branch build.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff changes only Sources/XToolSupport/SDKBuilder.swift. Both changes support issue #360: the compiler options fix the SwiftBuild configuration, and the epoch change refreshes generated SDKs. No unrelated implementation or test changes are present.

✨ 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

Comment @coderabbitai help to get the list of available commands.

@SrgGrch

SrgGrch commented Oct 16, 2026

Copy link
Copy Markdown
Author

Maybe you also want to add -use-ld=lld to the toolchain-swb.json

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.

Cross import overlays seem broken when toolset-swb.json is used

1 participant