Skip to content

Export tools from locally configured toolchain - #1972

Open
adincebic wants to merge 3 commits into
mainfrom
adin/export-tools
Open

adincebic wants to merge 3 commits into
mainfrom
adin/export-tools

Conversation

@adincebic

@adincebic adincebic commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

This makes Swift tools from locally discovered toolchain available as labels.

It is similar to what we added for standalone toolchain in #1896.

To use this, we need to make repo available through module extension first:

local_swift = use_extension(
    "@rules_swift//swift:extensions.bzl",
    "local_toolchain",
)

use_repo(local_swift, "rules_swift_local_config")

Then we can bazel run available tools:

bazel run @rules_swift_local_config//:swift

The files are symlinks to the installed executables. Tools missing from
the installation, such as some LLVM tools in Xcode, have no exported label.

All available tools can be discovered by querying the repo:

bazel query '@rules_swift_local_config//:*'

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