Introduce runtime_toolchain_type#3859
Merged
alexeagle merged 3 commits intobazel-contrib:mainfrom Oct 21, 2025
Merged
Conversation
|
4 tasks
Contributor
Author
|
This requires follow up fixes in |
2bdbe1f to
3a0c8a3
Compare
guw
commented
Aug 23, 2025
Member
|
I really like where this is going. I will review this in detail soon. |
fmeum
reviewed
Aug 23, 2025
alexeagle
reviewed
Sep 25, 2025
Collaborator
alexeagle
left a comment
There was a problem hiding this comment.
why does this introduce a new zlib dependency? is that related to the toolchain type, or is it fixing some existing issue at HEAD?
Contributor
Author
|
I couldn't build the project successfully on my Mac without it (ran into bazelbuild/bazel#25124). Thus, the dependency is likely there but as a transitive. I agree that this might be too problematic. Any recommendations @alexeagle? |
According to discussions in bazel-contrib#3854 having two toolchains of the same type for different things is troublesome. It's better to have separate runtime as well as compile toolchains. This commit creates a new runtime_toolchain_type and registers toolchains without execution constraints for this type. Once merged, rules_ts can start consuming the new toolchain type in its js_binary rule to ensure the correct Node for the correct target environment is selected. Fixed [Bug]: Execution toolchain defined without `target_compatible_with` makes it a candidate to selection Fixes bazel-contrib#3854 Work towards bazel-contrib#3795
3a4fc5f to
72f5f23
Compare
Collaborator
|
I'm going to remove zlib dep, if there's a problem it can be a separate PR |
13 tasks
jbedard
pushed a commit
to aspect-build/rules_js
that referenced
this pull request
Nov 13, 2025
`js_binary` should use the new runtime toolchain to avoid execution toolchain being leaked into target environments (eg., `js_image_oci`) See bazel-contrib/rules_nodejs#3854 Depends on: - bazel-contrib/rules_nodejs#3859 ### Changes are visible to end-users: yes - Searched for relevant documentation and updated as needed: yes - Breaking change (forces users to change their own code or config): no - Suggested release notes appear below: yes > Switched `js_binary` (and `js_test`) to start using the new runtime toolchain type introduced by `rules_nodejs` to better support cross-platform builds (eg., building `arm64` container from `amd64`). ### Test plan - Covered by existing test cases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

According to discussions in #3854 having two toolchains of the same type for different things is troublesome. It's better to have separate runtime as well as compile toolchains.
This commit creates a new runtime_toolchain_type and registers toolchains without execution constraints for this type. Once merged, rules_ts can start consuming the new toolchain type in its js_binary rule to ensure the correct Node for the correct target environment is selected.
Fixed [Bug]: Execution toolchain defined without
target_compatible_withmakes it a candidate to selectionFixes #3854
Work towards #3795
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
It tries to remain compatible and support existing consumers.
Other information
This is an alternative to #3800.