Skip to content

Also persist facts in the hidden lockfile#27522

Closed
fmeum wants to merge 1 commit intobazelbuild:masterfrom
fmeum:fix-facts
Closed

Also persist facts in the hidden lockfile#27522
fmeum wants to merge 1 commit intobazelbuild:masterfrom
fmeum:fix-facts

Conversation

@fmeum
Copy link
Copy Markdown
Collaborator

@fmeum fmeum commented Nov 4, 2025

Otherwise facts are not added to the default lockfile when an entry in the hidden lockfile for a reproducible extension is used.

Also bump the lockfile version out of caution - users may already have hidden lockfiles that lack facts.

Along the way fix the print behavior of Facts which resulted in Facts(<unknown object net.starlark.java.eval.Dict>) since it called the wrong repr override.

@fmeum
Copy link
Copy Markdown
Collaborator Author

fmeum commented Nov 4, 2025

@bazel-io fork 8.5.0

@fmeum
Copy link
Copy Markdown
Collaborator Author

fmeum commented Nov 4, 2025

@bazel-io fork 9.0.0

@github-actions github-actions bot added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Nov 4, 2025
Otherwise facts are not added to the default lockfile when an entry in the hidden lockfile for a reproducible extension is used.

Also bump the lockfile version out of caution - users may already have hidden lockfiles that lack facts.
@Wyverald Wyverald added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Nov 4, 2025
@copybara-service copybara-service bot closed this in bed7a1f Nov 5, 2025
@github-actions github-actions bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Nov 5, 2025
bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Nov 5, 2025
Otherwise facts are not added to the default lockfile when an entry in the hidden lockfile for a reproducible extension is used.

Also bump the lockfile version out of caution - users may already have hidden lockfiles that lack facts.

Along the way fix the `print` behavior of `Facts` which resulted in `Facts(<unknown object net.starlark.java.eval.Dict>)` since it called the wrong `repr` override.

Closes bazelbuild#27522.

PiperOrigin-RevId: 828559479
Change-Id: I77f002fa0e74c23b9fab5bb05948bcbe76f8f49b
github-merge-queue bot pushed a commit that referenced this pull request Nov 6, 2025
Otherwise facts are not added to the default lockfile when an entry in
the hidden lockfile for a reproducible extension is used.

Also bump the lockfile version out of caution - users may already have
hidden lockfiles that lack facts.

Along the way fix the `print` behavior of `Facts` which resulted in
`Facts(<unknown object net.starlark.java.eval.Dict>)` since it called
the wrong `repr` override.

Closes #27522.

PiperOrigin-RevId: 828559479
Change-Id: I77f002fa0e74c23b9fab5bb05948bcbe76f8f49b

Commit
bed7a1f

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
@fmeum fmeum deleted the fix-facts branch November 12, 2025 10:03
fmeum added a commit to fmeum/bazel that referenced this pull request Nov 12, 2025
Otherwise facts are not added to the default lockfile when an entry in the hidden lockfile for a reproducible extension is used.

Also bump the lockfile version out of caution - users may already have hidden lockfiles that lack facts.

Along the way fix the `print` behavior of `Facts` which resulted in `Facts(<unknown object net.starlark.java.eval.Dict>)` since it called the wrong `repr` override.

Closes bazelbuild#27522.

PiperOrigin-RevId: 828559479
Change-Id: I77f002fa0e74c23b9fab5bb05948bcbe76f8f49b
(cherry picked from commit bed7a1f)
github-merge-queue bot pushed a commit that referenced this pull request Nov 13, 2025
Otherwise facts are not added to the default lockfile when an entry in
the hidden lockfile for a reproducible extension is used.

Also bump the lockfile version out of caution - users may already have
hidden lockfiles that lack facts.

Along the way fix the `print` behavior of `Facts` which resulted in
`Facts(<unknown object net.starlark.java.eval.Dict>)` since it called
the wrong `repr` override.

Closes #27522.

PiperOrigin-RevId: 828559479
Change-Id: I77f002fa0e74c23b9fab5bb05948bcbe76f8f49b 
(cherry picked from commit bed7a1f)

Closes #27523
copybara-service bot pushed a commit that referenced this pull request Dec 5, 2025
ModuleExtensionId is not comparable by itself and needs a comparator. Before this fix, I was able to crash Bazel with this message:

```
FATAL: bazel crashed due to an internal error. Printing stack trace: java.lang.ClassCastException: class com.google.devtools.build.lib.bazel.bzlmod.ModuleExtensionId cannot be cast to class java.lang.Comparable (com.google.devtools.build.lib.bazel.bzlmod.ModuleExtensionId is in unnamed module of loader 'app'; java.lang.Comparable is in module java.base of loader 'bootstrap')
        at com.google.common.collect.NaturalOrdering.compare(NaturalOrdering.java:29)
        at com.google.common.collect.ImmutableSortedMap.lambda$fromEntries$0(ImmutableSortedMap.java:536)
        at java.base/java.util.TimSort.countRunAndMakeAscending(Unknown Source)
        at java.base/java.util.TimSort.sort(Unknown Source)
        at java.base/java.util.Arrays.sort(Unknown Source)
        at com.google.common.collect.ImmutableSortedMap.fromEntries(ImmutableSortedMap.java:528)
        at com.google.common.collect.ImmutableSortedMap.fromEntries(ImmutableSortedMap.java:495)
        at com.google.common.collect.ImmutableSortedMap.copyOfInternal(ImmutableSortedMap.java:474)
        at com.google.common.collect.ImmutableSortedMap.copyOf(ImmutableSortedMap.java:372)
        at com.google.devtools.build.lib.bazel.bzlmod.BazelLockFileModule.afterCommand(BazelLockFileModule.java:135)
        at com.google.devtools.build.lib.runtime.BlazeRuntime.afterCommand(BlazeRuntime.java:734)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:711)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:257)
        at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:607)
        at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$0(GrpcServerImpl.java:677)
        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)
```

Fixes #27522

Closes #27816.

PiperOrigin-RevId: 840671327
Change-Id: Ia7eb05be4fd099f0e2711065faf4c344d45265b5
bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Dec 5, 2025
ModuleExtensionId is not comparable by itself and needs a comparator. Before this fix, I was able to crash Bazel with this message:

```
FATAL: bazel crashed due to an internal error. Printing stack trace: java.lang.ClassCastException: class com.google.devtools.build.lib.bazel.bzlmod.ModuleExtensionId cannot be cast to class java.lang.Comparable (com.google.devtools.build.lib.bazel.bzlmod.ModuleExtensionId is in unnamed module of loader 'app'; java.lang.Comparable is in module java.base of loader 'bootstrap')
        at com.google.common.collect.NaturalOrdering.compare(NaturalOrdering.java:29)
        at com.google.common.collect.ImmutableSortedMap.lambda$fromEntries$0(ImmutableSortedMap.java:536)
        at java.base/java.util.TimSort.countRunAndMakeAscending(Unknown Source)
        at java.base/java.util.TimSort.sort(Unknown Source)
        at java.base/java.util.Arrays.sort(Unknown Source)
        at com.google.common.collect.ImmutableSortedMap.fromEntries(ImmutableSortedMap.java:528)
        at com.google.common.collect.ImmutableSortedMap.fromEntries(ImmutableSortedMap.java:495)
        at com.google.common.collect.ImmutableSortedMap.copyOfInternal(ImmutableSortedMap.java:474)
        at com.google.common.collect.ImmutableSortedMap.copyOf(ImmutableSortedMap.java:372)
        at com.google.devtools.build.lib.bazel.bzlmod.BazelLockFileModule.afterCommand(BazelLockFileModule.java:135)
        at com.google.devtools.build.lib.runtime.BlazeRuntime.afterCommand(BlazeRuntime.java:734)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:711)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:257)
        at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:607)
        at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$0(GrpcServerImpl.java:677)
        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)
```

Fixes bazelbuild#27522

Closes bazelbuild#27816.

PiperOrigin-RevId: 840671327
Change-Id: Ia7eb05be4fd099f0e2711065faf4c344d45265b5
bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Dec 5, 2025
ModuleExtensionId is not comparable by itself and needs a comparator. Before this fix, I was able to crash Bazel with this message:

```
FATAL: bazel crashed due to an internal error. Printing stack trace: java.lang.ClassCastException: class com.google.devtools.build.lib.bazel.bzlmod.ModuleExtensionId cannot be cast to class java.lang.Comparable (com.google.devtools.build.lib.bazel.bzlmod.ModuleExtensionId is in unnamed module of loader 'app'; java.lang.Comparable is in module java.base of loader 'bootstrap')
        at com.google.common.collect.NaturalOrdering.compare(NaturalOrdering.java:29)
        at com.google.common.collect.ImmutableSortedMap.lambda$fromEntries$0(ImmutableSortedMap.java:536)
        at java.base/java.util.TimSort.countRunAndMakeAscending(Unknown Source)
        at java.base/java.util.TimSort.sort(Unknown Source)
        at java.base/java.util.Arrays.sort(Unknown Source)
        at com.google.common.collect.ImmutableSortedMap.fromEntries(ImmutableSortedMap.java:528)
        at com.google.common.collect.ImmutableSortedMap.fromEntries(ImmutableSortedMap.java:495)
        at com.google.common.collect.ImmutableSortedMap.copyOfInternal(ImmutableSortedMap.java:474)
        at com.google.common.collect.ImmutableSortedMap.copyOf(ImmutableSortedMap.java:372)
        at com.google.devtools.build.lib.bazel.bzlmod.BazelLockFileModule.afterCommand(BazelLockFileModule.java:135)
        at com.google.devtools.build.lib.runtime.BlazeRuntime.afterCommand(BlazeRuntime.java:734)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:711)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:257)
        at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:607)
        at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$0(GrpcServerImpl.java:677)
        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)
```

Fixes bazelbuild#27522

Closes bazelbuild#27816.

PiperOrigin-RevId: 840671327
Change-Id: Ia7eb05be4fd099f0e2711065faf4c344d45265b5
github-merge-queue bot pushed a commit that referenced this pull request Dec 5, 2025
…27881)

ModuleExtensionId is not comparable by itself and needs a comparator.
Before this fix, I was able to crash Bazel with this message:

```
FATAL: bazel crashed due to an internal error. Printing stack trace: java.lang.ClassCastException: class com.google.devtools.build.lib.bazel.bzlmod.ModuleExtensionId cannot be cast to class java.lang.Comparable (com.google.devtools.build.lib.bazel.bzlmod.ModuleExtensionId is in unnamed module of loader 'app'; java.lang.Comparable is in module java.base of loader 'bootstrap')
        at com.google.common.collect.NaturalOrdering.compare(NaturalOrdering.java:29)
        at com.google.common.collect.ImmutableSortedMap.lambda$fromEntries$0(ImmutableSortedMap.java:536)
        at java.base/java.util.TimSort.countRunAndMakeAscending(Unknown Source)
        at java.base/java.util.TimSort.sort(Unknown Source)
        at java.base/java.util.Arrays.sort(Unknown Source)
        at com.google.common.collect.ImmutableSortedMap.fromEntries(ImmutableSortedMap.java:528)
        at com.google.common.collect.ImmutableSortedMap.fromEntries(ImmutableSortedMap.java:495)
        at com.google.common.collect.ImmutableSortedMap.copyOfInternal(ImmutableSortedMap.java:474)
        at com.google.common.collect.ImmutableSortedMap.copyOf(ImmutableSortedMap.java:372)
        at com.google.devtools.build.lib.bazel.bzlmod.BazelLockFileModule.afterCommand(BazelLockFileModule.java:135)
        at com.google.devtools.build.lib.runtime.BlazeRuntime.afterCommand(BlazeRuntime.java:734)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:711)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:257)
        at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:607)
        at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$0(GrpcServerImpl.java:677)
        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)
```

Fixes #27522

Closes #27816.

PiperOrigin-RevId: 840671327
Change-Id: Ia7eb05be4fd099f0e2711065faf4c344d45265b5

Commit
b2587f6

Co-authored-by: Malte Poll <1780588+malt3@users.noreply.github.com>
github-merge-queue bot pushed a commit that referenced this pull request Dec 5, 2025
…27882)

ModuleExtensionId is not comparable by itself and needs a comparator.
Before this fix, I was able to crash Bazel with this message:

```
FATAL: bazel crashed due to an internal error. Printing stack trace: java.lang.ClassCastException: class com.google.devtools.build.lib.bazel.bzlmod.ModuleExtensionId cannot be cast to class java.lang.Comparable (com.google.devtools.build.lib.bazel.bzlmod.ModuleExtensionId is in unnamed module of loader 'app'; java.lang.Comparable is in module java.base of loader 'bootstrap')
        at com.google.common.collect.NaturalOrdering.compare(NaturalOrdering.java:29)
        at com.google.common.collect.ImmutableSortedMap.lambda$fromEntries$0(ImmutableSortedMap.java:536)
        at java.base/java.util.TimSort.countRunAndMakeAscending(Unknown Source)
        at java.base/java.util.TimSort.sort(Unknown Source)
        at java.base/java.util.Arrays.sort(Unknown Source)
        at com.google.common.collect.ImmutableSortedMap.fromEntries(ImmutableSortedMap.java:528)
        at com.google.common.collect.ImmutableSortedMap.fromEntries(ImmutableSortedMap.java:495)
        at com.google.common.collect.ImmutableSortedMap.copyOfInternal(ImmutableSortedMap.java:474)
        at com.google.common.collect.ImmutableSortedMap.copyOf(ImmutableSortedMap.java:372)
        at com.google.devtools.build.lib.bazel.bzlmod.BazelLockFileModule.afterCommand(BazelLockFileModule.java:135)
        at com.google.devtools.build.lib.runtime.BlazeRuntime.afterCommand(BlazeRuntime.java:734)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.execExclusively(BlazeCommandDispatcher.java:711)
        at com.google.devtools.build.lib.runtime.BlazeCommandDispatcher.exec(BlazeCommandDispatcher.java:257)
        at com.google.devtools.build.lib.server.GrpcServerImpl.executeCommand(GrpcServerImpl.java:607)
        at com.google.devtools.build.lib.server.GrpcServerImpl.lambda$run$0(GrpcServerImpl.java:677)
        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)
```

Fixes #27522

Closes #27816.

PiperOrigin-RevId: 840671327
Change-Id: Ia7eb05be4fd099f0e2711065faf4c344d45265b5

Commit
b2587f6

Co-authored-by: Malte Poll <1780588+malt3@users.noreply.github.com>
@iancha1992
Copy link
Copy Markdown
Member

A fix for this issue has been included in Bazel 9.0.0 RC5. Please test out the release candidate and report any issues as soon as possible.
If you're using Bazelisk, you can point to the latest RC by setting USE_BAZEL_VERSION=9.0.0rc5. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants