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 7.0.0 bootstrap fails: bazel 7.0.0 bootstrap fails #20535

Closed
svenstaro opened this issue Dec 14, 2023 · 6 comments
Closed

bazel 7.0.0 bootstrap fails: bazel 7.0.0 bootstrap fails #20535

svenstaro opened this issue Dec 14, 2023 · 6 comments
Labels
team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug untriaged

Comments

@svenstaro
Copy link

Description of the bug:

Trying to bootstrap bazel 7.0.0, I get this:

INFO: Found 1 target...
Target //src:bazel_nojdk up-to-date:
  bazel-bin/src/bazel_nojdk
INFO: Elapsed time: 205.809s, Critical Path: 198.18s
INFO: 3348 processes: 98 internal, 2388 local, 862 worker.
INFO: Build completed successfully, 3348 total actions
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.

Build successful! Binary is here: /build/bazel/src/output/bazel
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
Computing main repo mapping:
FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.RuntimeException: Unrecoverable error while evaluating node 'com.google.devtools.build.lib.bazel.bzlmod.BazelLockFileValue$$Lambda$235/0x00000008002bf918@2c13cf1' (requested by nodes 'com.google.devtools.build.lib.bazel.bzlmod.BazelDepGraphValue$$Lambda$384/0x00000008004b8230@61ed06ef')
        at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:550)
        at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:414)
        at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1375)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.lang.RuntimeException: Unable to create instance of class com.google.devtools.build.lib.bazel.bzlmod.BazelLockFileValue. Registering an InstanceCreator or a TypeAdapter for this type, or adding a no-args constructor may fix this problem.
        at com.google.gson.internal.ConstructorConstructor$16.construct(ConstructorConstructor.java:275)
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:211)
        at com.google.gson.Gson.fromJson(Gson.java:991)
        at com.google.gson.Gson.fromJson(Gson.java:956)
        at com.google.gson.Gson.fromJson(Gson.java:905)
        at com.google.gson.Gson.fromJson(Gson.java:876)
        at com.google.devtools.build.lib.bazel.bzlmod.BazelLockFileFunction.getLockfileValue(BazelLockFileFunction.java:112)
        at com.google.devtools.build.lib.bazel.bzlmod.BazelLockFileFunction.compute(BazelLockFileFunction.java:87)
        at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:461)
        ... 7 more
Caused by: java.lang.UnsupportedOperationException: Abstract class can't be instantiated! Class name: com.google.devtools.build.lib.bazel.bzlmod.BazelLockFileValue
        at com.google.gson.internal.UnsafeAllocator.assertInstantiable(UnsafeAllocator.java:121)
        at com.google.gson.internal.UnsafeAllocator$1.newInstance(UnsafeAllocator.java:49)
        at com.google.gson.internal.ConstructorConstructor$16.construct(ConstructorConstructor.java:272)
        ... 15 more

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.

Download https://github.com/bazelbuild/bazel/releases/download/7.0.0/bazel-7.0.0-dist.zip and build is using EXTRA_BAZEL_ARGS="--tool_java_runtime_version=local_jdk" ./compile.sh.

Which operating system are you running Bazel on?

Arch Linux

What is the output of bazel info release?

N/A

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

N/A

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

N/A

Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

Bazel 6.4.0 built just fine with the exact same build instructions.

Have you found anything relevant by searching the web?

No response

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

Full build log:
bazel-log.txt

@sgowroji sgowroji added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Dec 14, 2023
@meisterT
Copy link
Member

meisterT commented Dec 14, 2023

@svenstaro
Copy link
Author

What is there to use? I might be missing something but that just seems like another bug report and I can't spot a fix for my case.

@meisterT
Copy link
Member

Sorry, had something else in the paste buffer apparently. Fixed the link above to point to bazelisk's bisect feature

@svenstaro
Copy link
Author

I've not tried to bisect bazel as I don't have the time to do that. However, I recommend my bootstrapping failure should be reproducible somewhat easily.

@fmeum
Copy link
Collaborator

fmeum commented Dec 14, 2023

Looks related to #20501. The missing classes are generated by an annotation processor, which may not be run during the bootstrap build.

Cc @Wyverald

@meteorcloudy
Copy link
Member

I'm looking into #20501, closing this one as a duplicate.

@meteorcloudy meteorcloudy closed this as not planned Won't fix, can't repro, duplicate, stale Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug untriaged
Projects
None yet
Development

No branches or pull requests

7 participants