Skip to content

Conversation

@konstantin-s-bogom
Copy link
Member

The needed Bazel version to build gVisor got bumped. However, instead of doing the same bump in two places whenever this happens, we can simply use bazelisk in syzkaller to determine which bazel version to use automatically.

@konstantin-s-bogom konstantin-s-bogom changed the title tools/docker: Install bazelisk instead of bazel tools/docker: install bazelisk instead of bazel Aug 27, 2025
@a-nogikh
Copy link
Collaborator

Please note this ci/aux error:

Error: Wrong commit subject format: 'tools/docker: Install bazelisk instead of bazel'. Please use 'main/affected/package: short change description'. See docs/contributing.md for details. Regex pattern used to check commit subjects is '^(Revert "|(([a-z0-9/_.-]+|Makefile|CONTRIBUTORS|README.md)(, )?)+:\ [^A-Z].+[^.]$)'.

@a-nogikh
Copy link
Collaborator

a-nogikh commented Aug 27, 2025

Thanks for preparing the change!

I have two related concerns.

First, we've been constantly facing the following bazel bug:

FATAL: corrupt installation: file '/syzkaller/.cache/bazel/_bazel_root/install/b5809df73e78297dbe63cb34dab47669/A-server.jar' is missing or modified.  Please remove '/syzkaller/.cache/bazel/_bazel_root/install/b5809df73e78297dbe63cb34dab47669' and try again.

I wonder if using bazelisk may make this problem worse given that /syzkaller (and therefore the bazel cache) is mounted as a volume and preserved across runs. Should we better keep the bazel cache within the Docker container so that it's reset on every restart?

Second, we have a test where we run bazel --version. Will it keep working fine after the change to bazelisk?

func TestCompilerIdentity(t *testing.T) {
t.Parallel()
for _, compiler := range []string{"gcc", "clang", "bazel"} {
t.Run(compiler, func(t *testing.T) {
t.Parallel()
if _, err := exec.LookPath(compiler); err != nil {
t.Skipf("compiler '%v' is not found: %v", compiler, err)
}
id, err := compilerIdentity(compiler)

@konstantin-s-bogom
Copy link
Member Author

Please note this ci/aux error:

I've changed the title, I just think the ci didn't rerun after that.

I wonder if using bazelisk may make this problem worse given that /syzkaller (and therefore the bazel cache) is mounted as a volume and preserved across runs.

I think we'll have to see. I don't think it will make the problem better or worse, since I think bazel should take the bazel version into account when generating the cache key, so I expect that different versions of bazel won't be sharing caches.

Second, we have a test where we run bazel --version. Will it keep working fine after the change to bazelisk?

Thanks for pointing out the test, I fixed it:

build🤖 pwd
/syzkaller/pkg/build

build🤖 go test
PASS
ok      github.com/google/syzkaller/pkg/build   1.493s

@a-nogikh
Copy link
Collaborator

It has run the CI, now the problem is a bit different:

pkg/build/build.go:195:1: File is not properly formatted (gofmt)

./tools/syz-env gofmt -s -w pkg/build/build.go should help.

The needed Bazel version to build gVisor got bumped. However, instead of
doing the same bump in two places whenever this happens, we can simply
use bazelisk in syzkaller to determine which bazel version to use
automatically.
@a-nogikh a-nogikh added this pull request to the merge queue Aug 28, 2025
Merged via the queue into google:master with commit bee60a8 Aug 28, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants