You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
js_run_binary sets use_execroot_entry_point = True by default, and hoists runfiles of the tool to srcs so that they are included as execroot inputs to the action, while also preserving the runfiles input. The downside of this is that any actions required to build those runfiles will get executed twice: once under the default fastbuild configuration, for the execroot input, and once under a transition, for the runfiles input. For example, if there are npm packages in the runfiles dependencies, then their NpmPackageExtract (and NpmLifecycleHook if present) actions run twice.
I was able to work around this in a specific case where it had a significant performance impact by avoiding the use of data dependencies, but it would be nice if there was a generic solution such that every use of js_run_binary would not be affected by default.
Version
Development (host) and target OS/architectures:
Output of bazel --version: bazel 7.4.0
Version of the Aspect rules, or other relevant rules from your WORKSPACE or MODULE.bazel file: rules_js 2.1.2
Language(s) and/or frameworks involved: JS
How to reproduce
In rules_js, run bazel clean && bazel build --execution_log_compact_file=compact_exec.log //examples/js_binary:run2 && ../bazel/bazel-bin/src/tools/execlog/parser --log_path compact_exec.log.
acorn/CHANGELOG.md output from first NpmPackageExtract, in darwin_arm64-fastbuild:
What happened?
js_run_binary
setsuse_execroot_entry_point = True
by default, and hoists runfiles of the tool to srcs so that they are included as execroot inputs to the action, while also preserving the runfiles input. The downside of this is that any actions required to build those runfiles will get executed twice: once under the defaultfastbuild
configuration, for the execroot input, and once under a transition, for the runfiles input. For example, if there are npm packages in the runfiles dependencies, then theirNpmPackageExtract
(andNpmLifecycleHook
if present) actions run twice.I was able to work around this in a specific case where it had a significant performance impact by avoiding the use of data dependencies, but it would be nice if there was a generic solution such that every use of
js_run_binary
would not be affected by default.Version
Development (host) and target OS/architectures:
Output of
bazel --version
: bazel 7.4.0Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file: rules_js 2.1.2Language(s) and/or frameworks involved: JS
How to reproduce
In rules_js, run
bazel clean && bazel build --execution_log_compact_file=compact_exec.log //examples/js_binary:run2 && ../bazel/bazel-bin/src/tools/execlog/parser --log_path compact_exec.log
.acorn/CHANGELOG.md output from first
NpmPackageExtract
, indarwin_arm64-fastbuild
:acorn/CHANGELOG.md output from second
NpmPackageExtract
, indarwin_arm64-opt-exec-ST-d57f47055a04
:First acorn/CHANGELOG.md input:
Second acorn/CHANGELOG.md input:
Any other information?
No response
The text was updated successfully, but these errors were encountered: