-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Error on invalid path characters in .bazelignore
#21170
Conversation
fail "Bazel build should have failed" | ||
fi | ||
expect_log "java.nio.file.InvalidPathException: Nul character not allowed" | ||
bazel shutdown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
@sgowroji tests are passing now! This is ready for review. |
Fixes bazelbuild#20906. cc @meteorcloudy Closes bazelbuild#21170. PiperOrigin-RevId: 605291552 Change-Id: I8d42729f176b4325ee402c0c6143db9d534c5e0b
@bazel-io fork 7.1.0 |
Fixes bazelbuild#20906. cc @meteorcloudy Closes bazelbuild#21170. PiperOrigin-RevId: 605291552 Change-Id: I8d42729f176b4325ee402c0c6143db9d534c5e0b
Fixes #20906. cc @meteorcloudy Closes #21170. Commit 026f493 PiperOrigin-RevId: 605291552 Change-Id: I8d42729f176b4325ee402c0c6143db9d534c5e0b Co-authored-by: Sushain Cherivirala <[email protected]>
Fixes #20906.
cc @meteorcloudy