Skip to content
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

bazel crash on windows with java.nio.file.InvalidPathException: Illegal char <*> at index ... #20906

Closed
cloudhan opened this issue Jan 16, 2024 · 8 comments
Labels
area-Windows Windows-specific issues and feature requests P2 We'll consider working on this in future. (Assignee optional) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug

Comments

@cloudhan
Copy link

cloudhan commented Jan 16, 2024

Description of the bug:

Bazel crashed as follows:

FATAL: bazel crashed due to an internal error. Printing stack trace:
java.nio.file.InvalidPathException: Illegal char <*> at index 43: C:/users/cloud/workspaces/rules_cuda/bazel-*
        at java.base/sun.nio.fs.WindowsPathParser.normalize(Unknown Source)
        at java.base/sun.nio.fs.WindowsPathParser.parse(Unknown Source)
        at java.base/sun.nio.fs.WindowsPathParser.parse(Unknown Source)
        at java.base/sun.nio.fs.WindowsPath.parse(Unknown Source)
        at java.base/sun.nio.fs.WindowsFileSystem.getPath(Unknown Source)
        at java.base/java.nio.file.Path.of(Unknown Source)
        at com.google.devtools.build.lib.skyframe.LocalDiffAwareness$Factory.lambda$maybeCreate$0(LocalDiffAwareness.java:113)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
        at com.google.devtools.build.lib.skyframe.LocalDiffAwareness$Factory.maybeCreate(LocalDiffAwareness.java:113)
        at com.google.devtools.build.lib.skyframe.DiffAwarenessManager.maybeGetDiffAwarenessState(DiffAwarenessManager.java:169)
        at com.google.devtools.build.lib.skyframe.DiffAwarenessManager.getDiff(DiffAwarenessManager.java:108)
        at com.google.devtools.build.lib.skyframe.SkyframeExecutor.handleDiffs(SkyframeExecutor.java:3138)
        at com.google.devtools.build.lib.skyframe.SequencedSkyframeExecutor.sync(SequencedSkyframeExecutor.java:285)
        at com.google.devtools.build.lib.runtime.CommandEnvironment.syncPackageLoading(CommandEnvironment.java:737)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:567)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:244)
        at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:550)
        at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$1(GrpcServerImpl.java:621)
        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)

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.

See https://github.com/bazel-contrib/rules_cuda/actions/runs/7531757668/job/20501002440#step:7:21

To reproduce locally:

rules_cuda-cloudhan-v7.zip

# to repo root
cd rules_cuda-cloudhan-v7

# out of repo @examples build with --noenable_bzlmod crashes bazel
bazelisk build --noenable_bzlmod @rules_cuda_examples//basic:all

# the following works correctly however...
cd examples
bazelisk build --noenable_bzlmod @rules_cuda_examples//basic:all

Which operating system are you running Bazel on?

Windows 11 and Windows Server 2019

What is the output of bazel info release?

release 7.0.0, bazel info (no release) crashed with the same error

Any other information, logs, or outputs that you want to share?

bazel info crashed with the same error

@cloudhan cloudhan changed the title bazel crash on windows with java.nio.file.InvalidPathException: Illegal char <*> at index 33: D:/a/rules_cuda/rules_cuda/bazel-* bazel crash on windows with java.nio.file.InvalidPathException: Illegal char <*> at index ... Jan 16, 2024
@cloudhan
Copy link
Author

The direct cause should be the bazel-* in the .bazelignore. But the root cause is unknown, these have been working correctly during bazel 5 and 6.

cloudhan added a commit to bazel-contrib/rules_cuda that referenced this issue Jan 16, 2024
@sgowroji sgowroji added area-Windows Windows-specific issues and feature requests team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website labels Jan 16, 2024
@fmeum
Copy link
Collaborator

fmeum commented Jan 16, 2024

@bazel-io fork 7.0.1

@fmeum
Copy link
Collaborator

fmeum commented Jan 16, 2024

Looks like a regression introduced by 4dabe43.

Cc @sushain97

@sushain97
Copy link
Contributor

I agree that Bazel shouldn't crash in this case. That being said, aren't wildcards not supported per #7093? So, the fix would be just improving the error message?

@meteorcloudy
Copy link
Member

@sushain97 Yes, fixing the crashing is the immediate goal.

In the meantime, giving this is not that serious. I'm making this a soft release blocker for 7.0.1, which means it won't block 7.0.1 if other things clear out.

@meteorcloudy meteorcloudy added P2 We'll consider working on this in future. (Assignee optional) and removed untriaged labels Jan 16, 2024
bazel-io pushed a commit to bazel-io/bazel that referenced this issue Feb 8, 2024
Fixes bazelbuild#20906.
cc @meteorcloudy

Closes bazelbuild#21170.

PiperOrigin-RevId: 605291552
Change-Id: I8d42729f176b4325ee402c0c6143db9d534c5e0b
bazel-io pushed a commit to bazel-io/bazel that referenced this issue 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 issue Feb 8, 2024
Fixes #20906.
cc @meteorcloudy

Closes #21170.

Commit
026f493

PiperOrigin-RevId: 605291552
Change-Id: I8d42729f176b4325ee402c0c6143db9d534c5e0b

Co-authored-by: Sushain Cherivirala <[email protected]>
@iancha1992
Copy link
Member

A fix for this issue has been included in Bazel 7.1.0 RC1. Please test out the release candidate and report any issues as soon as possible. Thanks!

@cloudhan
Copy link
Author

@iancha1992 Now it doesn't crash but produe the following error

ERROR: Error computing the main repository mapping: error during computation of main repo mapping: Invalid path in C:/rules_cuda-cloudhan-v7/.bazelignore: java.nio.file.InvalidPathException: Illegal char <*> at index 6: bazel-*

I am not sure if it is by design if you want to address the root cause. For example, in the case someone want it ignore foobar-* will still result in Illegal char <*> at index 7: foobar-* as manually verified.

I am OK with deleting the line in .bazelignore as a workaround for my case, tho.

@sushain97
Copy link
Contributor

I am not sure if it is by design if you want to address the root cause. For example, in the case someone want it ignore foobar-* will still result in Illegal char <*> at index 7: foobar-* as manually verified.

@cloudhan adding support for wildcards is tracked in #7093.

You will need to delete the entry from .bazelignore for your builds to pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Windows Windows-specific issues and feature requests P2 We'll consider working on this in future. (Assignee optional) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants