Skip to content

Commit

Permalink
fix: register Node.js toolchains in correct order (#3750)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan authored Jun 6, 2024
1 parent 4c37320 commit 153cd20
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,22 @@ node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(name = "nodejs")
use_repo(node, "nodejs_toolchains")

register_toolchains("@nodejs_toolchains//:all")
# Toolchain registration under bzlmod should match the order of WORKSPACE registration
# which is the order specified in the PLATFORMS dict https://github.com/bazelbuild/rules_nodejs/blob/4c373209b058d46f2a5f9ab9f8abf11b161ae459/nodejs/private/nodejs_toolchains_repo.bzl#L20.
# For each platform, `:<PLATFORM>_toolchain_target` should be registered before `:<PLATFORM>_toolchain`,
# https://github.com/bazelbuild/rules_nodejs/blob/4c373209b058d46f2a5f9ab9f8abf11b161ae459/nodejs/repositories.bzl#L461/.
# See https://github.com/bazelbuild/bazel/issues/19645 and https://github.com/bazelbuild/rules_nodejs/pull/3750 for more context.
register_toolchains("@nodejs_toolchains//:linux_amd64_toolchain_target")
register_toolchains("@nodejs_toolchains//:linux_amd64_toolchain")
register_toolchains("@nodejs_toolchains//:linux_arm64_toolchain_target")
register_toolchains("@nodejs_toolchains//:linux_arm64_toolchain")
register_toolchains("@nodejs_toolchains//:linux_s390x_toolchain_target")
register_toolchains("@nodejs_toolchains//:linux_s390x_toolchain")
register_toolchains("@nodejs_toolchains//:linux_ppc64le_toolchain_target")
register_toolchains("@nodejs_toolchains//:linux_ppc64le_toolchain")
register_toolchains("@nodejs_toolchains//:darwin_amd64_toolchain_target")
register_toolchains("@nodejs_toolchains//:darwin_amd64_toolchain")
register_toolchains("@nodejs_toolchains//:darwin_arm64_toolchain_target")
register_toolchains("@nodejs_toolchains//:darwin_arm64_toolchain")
register_toolchains("@nodejs_toolchains//:windows_amd64_toolchain_target")
register_toolchains("@nodejs_toolchains//:windows_amd64_toolchain")

0 comments on commit 153cd20

Please sign in to comment.