Error on invalid path characters in .bazelignore#21170
Closed
sushain97 wants to merge 2 commits intobazelbuild:masterfrom
Closed
Error on invalid path characters in .bazelignore#21170sushain97 wants to merge 2 commits intobazelbuild:masterfrom
.bazelignore#21170sushain97 wants to merge 2 commits intobazelbuild:masterfrom
Conversation
sushain97
commented
Feb 1, 2024
| fail "Bazel build should have failed" | ||
| fi | ||
| expect_log "java.nio.file.InvalidPathException: Nul character not allowed" | ||
| bazel shutdown |
Contributor
Author
There was a problem hiding this comment.
I'm not super happy about this.
If you remove it, a different test in this file fails which doesn't fail individually:
** test_symlink_cycle_ignored **************************************************
WORKSPACE
-- Test log: -----------------------------------------------------------
$TEST_TMPDIR defined: output root default is '/private/var/tmp/_bazel/57872f73c892b24b35be334f00d21dae/sandbox/darwin-sandbox/4132/execroot/_main/_tmp/205f62347f64a58315b97e6ebfa13f59' and max_idle_secs default is '15'.
WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files:
/etc/bazel.bazelrc
FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.NullPointerException: Cannot invoke "com.google.devtools.build.lib.skyframe.IgnoredPackagePrefixesValue.getPatterns()" because "ignoredPackagePrefixesValue" is null
at com.google.devtools.build.lib.skyframe.SkyframeExecutor.handleDiffs(SkyframeExecutor.java:3181)
at com.google.devtools.build.lib.skyframe.SequencedSkyframeExecutor.sync(SequencedSkyframeExecutor.java:282)
at com.google.devtools.build.lib.runtime.CommandEnvironment.syncPackageLoading(CommandEnvironment.java:752)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:582)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:250)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:604)
at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$1(GrpcServerImpl.java:676)
at io.grpc.Context$1.run(Context.java:566)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Adding this fixes it which means that my change makes it so that Bazel doesn't crash when it encounters this issue. But, it might crash on the next run unless it's restarted after the .bazelignore is fixed.
Open to thoughts on what might be going wrong here. I would expect Bazel to re-evaluate the IgnoredPackagePrefixesFunction after the .bazelignore changes.
This can be reproduced more easily by trying to "fix" the .bazelignore afterwards:
diff --git a/src/test/shell/bazel/bazelignore_test.sh b/src/test/shell/bazel/bazelignore_test.sh
index 8ef9130268..248950ef39 100755
--- a/src/test/shell/bazel/bazelignore_test.sh
+++ b/src/test/shell/bazel/bazelignore_test.sh
@@ -215,7 +215,9 @@ test_invalid_path() {
fail "Bazel build should have failed"
fi
expect_log "java.nio.file.InvalidPathException: Nul character not allowed"
- bazel shutdown
+
+ rm .bazelignore
+ bazel build //... || fail "Bazel build should have succeeded"
}
run_suite "Integration tests for .bazelignore"results in
FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.NullPointerException: Cannot invoke "com.google.devtools.build.lib.skyframe.IgnoredPackagePrefixesValue.getPatterns()" because "ignoredPackagePrefixesValue" is null
at com.google.devtools.build.lib.skyframe.SkyframeExecutor.handleDiffs(SkyframeExecutor.java:3181)
at com.google.devtools.build.lib.skyframe.SequencedSkyframeExecutor.sync(SequencedSkyframeExecutor.java:282)
at com.google.devtools.build.lib.runtime.CommandEnvironment.syncPackageLoading(CommandEnvironment.java:752)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:582)
at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:250)
at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:604)
at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$1(GrpcServerImpl.java:676)
at io.grpc.Context$1.run(Context.java:566)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Contributor
Author
|
@sgowroji tests are passing now! This is ready for review. |
meteorcloudy
approved these changes
Feb 5, 2024
bazel-io
pushed a commit
to bazel-io/bazel
that referenced
this pull request
Feb 8, 2024
Fixes bazelbuild#20906. cc @meteorcloudy Closes bazelbuild#21170. PiperOrigin-RevId: 605291552 Change-Id: I8d42729f176b4325ee402c0c6143db9d534c5e0b
Collaborator
|
@bazel-io fork 7.1.0 |
bazel-io
pushed a commit
to bazel-io/bazel
that referenced
this pull request
Feb 8, 2024
Fixes bazelbuild#20906. cc @meteorcloudy Closes bazelbuild#21170. PiperOrigin-RevId: 605291552 Change-Id: I8d42729f176b4325ee402c0c6143db9d534c5e0b
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Feb 8, 2024
Fixes #20906. cc @meteorcloudy Closes #21170. Commit 026f493 PiperOrigin-RevId: 605291552 Change-Id: I8d42729f176b4325ee402c0c6143db9d534c5e0b Co-authored-by: Sushain Cherivirala <sushain@skc.name>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #20906.
cc @meteorcloudy