What happened?
In rules_js v3 support was added for 3p packages which specify optional dependencies that are included based on platform. For example, esbuild specifies various optional dependencies which included pre-compiled binaries for a variety of supported platforms. js_run_binary uses run_binary from bazel_lib and specifically configures its tool label under the exec configuration. However, if you are using use_execroot_entrypoint = True (the default). Only target platform configured sources will be available. This causes issues when you are building a target that transitions to a target that does not match the host.
Ideally the default configuration for js_run_binary would support this use case.
Version
Development (host) and target OS/architectures:
Output of bazel --version:
Bazelisk version: 1.27.0
Aspect CLI version: 2026.7.4-75a8f73d
INFO: Invocation ID: 419c9392-c1cd-417b-8d0a-80a6f2e244e1
Build label: 7.7.1
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Wed Nov 12 17:35:45 2025 (1762968945)
Build timestamp: 1762968945
Build timestamp as int: 1762968945
Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:
aspect_rules_js v3.0.2
rules_nodejs v6.7.3
Language(s) and/or frameworks involved:
How to reproduce
Any other information?
No response
What happened?
In rules_js v3 support was added for 3p packages which specify optional dependencies that are included based on platform. For example, esbuild specifies various optional dependencies which included pre-compiled binaries for a variety of supported platforms.
js_run_binaryusesrun_binaryfrombazel_liband specifically configures its tool label under theexecconfiguration. However, if you are usinguse_execroot_entrypoint = True(the default). Only target platform configured sources will be available. This causes issues when you are building a target that transitions to a target that does not match the host.Ideally the default configuration for
js_run_binarywould support this use case.Version
Development (host) and target OS/architectures:
Output of
bazel --version:Version of the Aspect rules, or other relevant rules from your
WORKSPACEorMODULE.bazelfile:aspect_rules_js v3.0.2
rules_nodejs v6.7.3
Language(s) and/or frameworks involved:
How to reproduce
Any other information?
No response