Skip to content

Export Swift binary from standalone toolchain - #1896

Merged
adincebic merged 1 commit into
mainfrom
adin/export-swift-binary
Sep 9, 2026
Merged

Export Swift binary from standalone toolchain#1896
adincebic merged 1 commit into
mainfrom
adin/export-swift-binary

Conversation

@adincebic

@adincebic adincebic commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Allowing Swift binary to be invoked from things like rules_swift_package_manager.
Currently the rules_swift_package_manager invokes swift package during loading phase which fails with standalone Swift toolchain because it can't find swift on the path.

To work around that, we are allowing Swift binary to be injected by the consumer:

swift_deps.from_package(
    swift = "//third_party/swift:Package.swift",
    resolved = "//third_party/swift:Package.resolved",
    swift_executable = "@swift_toolchain_ubuntu22.04//:usr/bin/swift",
)

Referencing @swift_toolchain_ubuntu22.04//:usr/bin/swift currently fails because the swift binary needs to be exported.

Example usage in cgrindel/rules_swift_package_manager#2511

@adincebic
adincebic merged commit 228500c into main Sep 9, 2026
16 checks passed
@adincebic
adincebic deleted the adin/export-swift-binary branch September 9, 2026 11:18
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.

2 participants