Skip to content

[Bug]: js_run_binary is not configured for the execution platform when the use_execroot_entrypoint = True and the target platform != exec platform #2754

@nickschaap

Description

@nickschaap

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

Metadata

Metadata

Labels

bugSomething isn't workingprioritizedValuable work that we hope to complete soon

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions