Repository navigation
Closed
Description
🐞 bug report
Affected Rule
The issue is caused by the rule:yarn_install (would probably also happen with npm_install)
Is this a regression?
NoDescription
With a large amount of dependencies in a project, yarn_install results in a "Timed out".
More precisely it is the _create_build_files execute, which calls generate_build_file.ts (in my test it timed out during findPackages()).
It works, if I extend the timeout for the repository_ctx.execute in _create_build_files.
🔬 Minimal Reproduction
Tested with https://github.com/angular/components
bazel build src/cdk/bidi
🔥 Exception or Error
INFO: Repository npm instantiated at:
no stack (--record_rule_instantiation_callstack not enabled)
Repository rule yarn_install defined at:
/home/lukas/.cache/bazel/_bazel_lukas/14787a90d7607eee821eb51658cd0614/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl:450:16: in
ERROR: An error occurred during the fetch of repository 'npm':
Traceback (most recent call last):
File "/home/lukas/.cache/bazel/_bazel_lukas/14787a90d7607eee821eb51658cd0614/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl", line 448
_create_build_files(<4 more arguments>)
File "/home/lukas/.cache/bazel/_bazel_lukas/14787a90d7607eee821eb51658cd0614/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl", line 162, in _create_build_files
fail(<1 more arguments>)
generate_build_file.ts failed:
STDOUT:
STDERR:
Timed out
ERROR: no such package '@npm//': Traceback (most recent call last):
File "/home/lukas/.cache/bazel/_bazel_lukas/14787a90d7607eee821eb51658cd0614/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl", line 448
_create_build_files(<4 more arguments>)
File "/home/lukas/.cache/bazel/_bazel_lukas/14787a90d7607eee821eb51658cd0614/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl", line 162, in _create_build_files
fail(<1 more arguments>)
generate_build_file.ts failed:
STDOUT:
STDERR:
Timed out
🌍 Your Environment
Operating System:
WSL 2 Ubuntu 20.04 (Windows 10)
Output of bazel version:
Bazelisk version: v1.6.0
Build label: 3.1.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Apr 22 10:32:27 2020 (1587551547)
Build timestamp: 1587551547
Build timestamp as int: 1587551547
Rules_nodejs version:
(Please check that you have matching versions between WORKSPACE file and @bazel/* npm packages.)
2.2.0
Anything else relevant?
Metadata
Metadata
Assignees
Labels
No labels
Activity
fix(builtin): give a longer timeout for _create_build_files
fix(builtin): give a longer timeout for _create_build_files
kyubisation commentedon Oct 17, 2020
@alexeagle Thank you very much for the fix. This might simply be caused by performance limitations in WSL.
fix(builtin): give a longer timeout for _create_build_files
fix: test file pattern (bazel-contrib#2089)
arnaudgibert commentedon Jun 21, 2021
I still got the problem even with this fix. So for future references, doing a simple
bazel cleancan save you a lot of trouble. 😉kyubisation commentedon Jun 22, 2021
Also a lesson learned; I previously used the mounted Windows drives from WSL, which is extremely slow and generally not recommended (for this use case). I have since switched to directly using the WSL file system.
arnaudgibert commentedon Jun 22, 2021
And for those who still use wsl1 try wsl2 which is way faster for I/O on drive.