Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make node toolchain_type public so new toolchains can be added (#…
…2591) Enables rules_nodejs to be used in cross-compilation contexts, where the target architecture is not supported by rules_nodejs. rules_nodejs's default toolchains are limited via target_compatible_with, which means they will not work when cross-compiling to Android or iOS with --platforms for example. With this change, users can define their own toolchain that is limited by execution platform instead of target platform. For example, if you're targeting an unsupported platform, but building on a Mac, you can place the following in the local WORKSPACE: register_toolchains("//ts/node_toolchain") And the following in ts/node_toolchain/BUILD.bazel: toolchain( name = "node_toolchain", exec_compatible_with = [ "@platforms//os:osx", "@platforms//cpu:x86_64", ], toolchain = "@nodejs_darwin_amd64_config//:toolchain", toolchain_type = "@build_bazel_rules_nodejs//toolchains/node:toolchain_type", ) Closes #2565
- Loading branch information