Skip to content

julia: own the Julia toolchain type and version flag so registering them does not fetch rules_julia - #14987

Merged
TrapsterDK merged 1 commit into
mainfrom
lazy-julia-toolchain-type
Nov 28, 2026
Merged

TrapsterDK merged 1 commit into
mainfrom
lazy-julia-toolchain-type

Conversation

@TrapsterDK

@TrapsterDK TrapsterDK commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Every consumer fetched the rules_julia archive, @julia_toolchains and toml.bzl, even without Julia targets. register_toolchains("@julia_toolchains//:all") needed the hub, so Bazel evaluated the rules_julia extension. The @dx_toolchains//julia source toolchain named @rules_julia//julia:toolchain_type and @rules_julia//julia/settings:version_<V>.

Follows #14981 (.NET) and #14985 (Ruby).

  • //julia:toolchain_type is a new rules_dx toolchain type. //julia/private/runtime:version is a rules_dx-owned version flag (default JULIA_RUNTIME_VERSION), and :runtime_version is the config_setting the toolchains use.
  • @dx_toolchains//julia now also declares the release toolchain of each platform (julia_stock_toolchain_targets), pointing at @julia_toolchains//:julia_<V>_<platform>_toolchain. MODULE.bazel no longer registers @julia_toolchains//:all.
  • patches/rules_julia/toolchain_aliases.patch is Alias each toolchain's implementation in the toolchain hub periareon/rules_julia#54: the hub emits one alias() per toolchain.
  • toolchain_type_alias.patch and version_alias.patch make @rules_julia//julia:toolchain_type and @rules_julia//julia/settings:version aliases of ours. --@rules_julia//julia/settings:version, rules_julia's version_<V> settings and its transitions still work. The flag no longer checks its value against the known versions, because that list lives in rules_julia.
  • runtime/defs.bzl and tools/julia_tool.bzl use the rules_dx type and flag.
  • Behaviour change: a version requested with julia_toolchain.toolchain(version = ...) is no longer registered automatically. A consumer that needs one registers @julia_toolchains//:all itself.
  • rules_dx++dx_pins+rules_julia, rules_dx++julia_toolchain+julia_toolchains and toml.bzl+ leave the go, java, java_check and rust cold-start lists. rules_julia is a FOREIGN fragment for go, java and rust.
  • external_repos budgets go down by three each (core 224, python 227 / 238). These numbers are predicted; CI measures them.
  • api/labels.txt and docs/supported-surface.md list the new type.

Upstream: periareon/rules_julia#53 (issue), periareon/rules_julia#54 (PR). The type and flag alias patches stay rules_dx only, because both have to live outside the rules_julia repo for it to go unfetched.

No local build or test was run (builder cap). CI and /evidence on this PR do the verification.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hvdpJxYihWhnWtH8yv

@TrapsterDK
TrapsterDK force-pushed the lazy-julia-toolchain-type branch from 6dc3837 to 14b4edf Compare November 28, 2026 11:10
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

/evidence platforms=["linux_x86_64"] task=test scope=//tools/testing/consumer:network_test

@github-actions

Copy link
Copy Markdown
Contributor

Evidence started on lazy-julia-toolchain-type: https://github.com/devhusdk/rules_dx/actions/runs/46144353073

…hem does not fetch rules_julia

rules_dx no longer registers @julia_toolchains//:all. @dx_toolchains//julia
now declares the per-platform release toolchains next to the source-built
one, typed by //julia:toolchain_type, gated by a rules_dx version flag, and
pointing at the aliases periareon/rules_julia#54 adds to the hub. Patches
make rules_julia's toolchain type and version flag aliases of ours.
@TrapsterDK
TrapsterDK force-pushed the lazy-julia-toolchain-type branch from 14b4edf to edcfc55 Compare November 28, 2026 13:36
@TrapsterDK
TrapsterDK merged commit b38e4ee into main Nov 28, 2026
7 checks passed
@TrapsterDK
TrapsterDK deleted the lazy-julia-toolchain-type branch November 28, 2026 13:37
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