-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
7.1.0rc1 crashes with Unrecoverable error while evaluating node REPOSITORY_DIRECTORY
#21483
Comments
Unrecoverable error while evaluating node REPOSITORY_DIRECTORY
This was last touched in https://github.com/bazelbuild/bazel/pull/21182/files
|
@bazel-io fork 7.1.0 |
@criemen Is it possible to construct a minimal reproducible case? It'll make it much easier to diagnose this problem. |
@meteorcloudy here you go: https://github.com/criemen/bazel-710rc1-repro Luckily, it was fairly easy to hit. |
|
Same bug on master, culprit is b1294e3. Investigating. |
This part of the rules_nodejs code triggers the bug: https://github.com/bazelbuild/rules_nodejs/blob/943800d8d601872dae53f5c1e17414d316834cac/nodejs/private/nodejs_repo_host_os_alias.bzl#L34-L38 This is because we try to watch the symlink target, but the target in this case actually points into where another repo (in this case I think there are two things that need to be fixed:
|
Number 1 is P1 (that should solve the immediate bug); number 2 is P2 or P3 since nobody should explicitly call |
Would you mind filing a |
Watching a path in an undefined repo (eg. `$output_base/external/i_am_undefined/blah`) currently causes an NPE because we expect it to need a skyframe restart when it actually doesn't. The underlying reason is rather convoluted, but the gist is that we request `RepositoryDirectoryValue.Key(@@i_am_undefined)` explicitly, when we don't actually have to -- we can simply use `FileValue.Key($output_base/external/i_am_undefined/blah` directly, and rely on the fact that `FileFunction` knows to request the corresponding `RepositoryDirectoryValue` and behave appropriately when the repo is undefined. (This is due to logic in `ExternalFilesHelper.maybeHandleExternalFile`.) Additionally, this PR removes the `rctx.symlink(watch_target=)` parameter. The symlink target's existence and its contents should not affect the creation of the symlink at all, so there's no reason to ever watch it. Fixes #21483.
Watching a path in an undefined repo (eg. `$output_base/external/i_am_undefined/blah`) currently causes an NPE because we expect it to need a skyframe restart when it actually doesn't. The underlying reason is rather convoluted, but the gist is that we request `RepositoryDirectoryValue.Key(@@i_am_undefined)` explicitly, when we don't actually have to -- we can simply use `FileValue.Key($output_base/external/i_am_undefined/blah` directly, and rely on the fact that `FileFunction` knows to request the corresponding `RepositoryDirectoryValue` and behave appropriately when the repo is undefined. (This is due to logic in `ExternalFilesHelper.maybeHandleExternalFile`.) Additionally, this PR removes the `rctx.symlink(watch_target=)` parameter. The symlink target's existence and its contents should not affect the creation of the symlink at all, so there's no reason to ever watch it. Fixes #21483.
Watching a path in an undefined repo (eg. `$output_base/external/i_am_undefined/blah`) currently causes an NPE because we expect it to need a skyframe restart when it actually doesn't. The underlying reason is rather convoluted, but the gist is that we request `RepositoryDirectoryValue.Key(@@i_am_undefined)` explicitly, when we don't actually have to -- we can simply use `FileValue.Key($output_base/external/i_am_undefined/blah` directly, and rely on the fact that `FileFunction` knows to request the corresponding `RepositoryDirectoryValue` and behave appropriately when the repo is undefined. (This is due to logic in `ExternalFilesHelper.maybeHandleExternalFile`.) Additionally, this PR removes the `rctx.symlink(watch_target=)` parameter. The symlink target's existence and its contents should not affect the creation of the symlink at all, so there's no reason to ever watch it. Fixes #21483.
re point 2: I ended up making it the same as watching any other nonexistent path (i.e. not throwing) because that repo can technically become defined at some point (see unit test in #21562).
|
Watching a path in an undefined repo (eg. `$output_base/external/i_am_undefined/blah`) currently causes an NPE because we expect it to need a skyframe restart when it actually doesn't. The underlying reason is rather convoluted, but the gist is that we request `RepositoryDirectoryValue.Key(@@i_am_undefined)` explicitly, when we don't actually have to -- we can simply use `FileValue.Key($output_base/external/i_am_undefined/blah` directly, and rely on the fact that `FileFunction` knows to request the corresponding `RepositoryDirectoryValue` and behave appropriately when the repo is undefined. (This is due to logic in `ExternalFilesHelper.maybeHandleExternalFile`.) Additionally, this PR removes the `rctx.symlink(watch_target=)` parameter. The symlink target's existence and its contents should not affect the creation of the symlink at all, so there's no reason to ever watch it. Fixes bazelbuild#21483. Closes bazelbuild#21562. PiperOrigin-RevId: 612898526 Change-Id: I30deb9d9b2d19e0869517f4b6b126078446745b4
Watching a path in an undefined repo (eg. `$output_base/external/i_am_undefined/blah`) currently causes an NPE because we expect it to need a skyframe restart when it actually doesn't. The underlying reason is rather convoluted, but the gist is that we request `RepositoryDirectoryValue.Key(@@i_am_undefined)` explicitly, when we don't actually have to -- we can simply use `FileValue.Key($output_base/external/i_am_undefined/blah` directly, and rely on the fact that `FileFunction` knows to request the corresponding `RepositoryDirectoryValue` and behave appropriately when the repo is undefined. (This is due to logic in `ExternalFilesHelper.maybeHandleExternalFile`.) Additionally, this PR removes the `rctx.symlink(watch_target=)` parameter. The symlink target's existence and its contents should not affect the creation of the symlink at all, so there's no reason to ever watch it. Fixes #21483. Closes #21562. Commit aba1186 PiperOrigin-RevId: 612898526 Change-Id: I30deb9d9b2d19e0869517f4b6b126078446745b4 Co-authored-by: Xdng Yng <wyverald@gmail.com>
A fix for this issue has been included in Bazel 7.1.0 RC2. Please test out the release candidate and report any issues as soon as possible. |
Description of the bug:
Buildling our project (working fine with 7.0.2) on Ubuntu 22.04 crashes with
The error is reproducible.
Which category does this issue belong to?
Core
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I've not worked on getting a small reproducing example yet (our repo is unfortunately closed source).
This looks somewhat similar other crashes, though, so I wonder if this is necessary right now.
Which operating system are you running Bazel on?
Ubuntu 22.04
What is the output of
bazel info release
?release 7.1.0rc1
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?private repository
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: