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

infra: Fix bazel 8.0 WORKSPACE disable problem #12838

Closed

Conversation

arthurscchan
Copy link
Contributor

@arthurscchan arthurscchan commented Dec 11, 2024

The base-builder depends on the google/fuzztest project to precompile the centipede module. The google/fuzztest uses the WORKSPACE approach to provide repository location. But since bazel 8 (released yesterday), the WORKSPACE approach is no longer enabled by default (https://bazel.build/versions/8.0.0/external/migration). Also, in the Dockerfile of the base-builder, we automatically install the latest version of bazel (which is bazel 8 from yesterday), that make the building of fuzztest and eventually the base-builder failed.

This PR fixes the problem temporary by forcing the installation of bazel version 7.4.0 to avoid the disabling of WORKSPACE defintion, this make the build of google/fuzztest success.

@DavidKorczynski
Copy link
Collaborator

/gcbrun trial_build.py --fuzzing-engines libfuzzer

@arthurscchan
Copy link
Contributor Author

Remark:

This line in base-builder Docker file fails (https://github.com/google/oss-fuzz/blob/master/infra/base-images/base-builder/Dockerfile#L154) with the following errors.

ERROR: no such package '@@[unknown repo 'com_google_absl' requested from @@]//absl/strings': The repository '@@[unknown repo 'com_google_absl' requested from @@]' could not be resolved: No repository visible as '@com_google_absl' from main repository. Was the repository introduced in WORKSPACE? The WORKSPACE file is disabled by default in Bazel 8 (late 2024) and will be removed in Bazel 9 (late 2025), please migrate to Bzlmod. See https://bazel.build/external/migration
ERROR: /src/fuzztest/centipede/BUILD:169:11: no such package '@@[unknown repo 'com_google_absl' requested from @@]//absl/strings': The repository '@@[unknown repo 'com_google_absl' requested from @@]' could not be resolved: No repository visible as '@com_google_absl' from main repository. Was the repository introduced in WORKSPACE? The WORKSPACE file is disabled by default in Bazel 8 (late 2024) and will be removed in Bazel 9 (late 2025), please migrate to Bzlmod. See https://bazel.build/external/migration and referenced by '//centipede:config_file'
Target //centipede:test_util_sh up-to-date (nothing to build)
ERROR: Analysis of target '//centipede:config_file' failed; build aborted: Analysis failed

Because Bazel 8 is used from yesterday automatically and it does not enable WORKSPACE by default. Thus the project no longer can retrieve the correct repository for com_google_absl which is defined in WORKSPACE.

@DavidKorczynski
Copy link
Collaborator

/gcbrun trial_build.py all --fuzzing-engines libfuzzer

DavidKorczynski added a commit that referenced this pull request Dec 12, 2024
supercedes: #12838

Signed-off-by: David Korczynski <[email protected]>
@arthurscchan
Copy link
Contributor Author

superseded by #12840 with less intrusive approach.

@arthurscchan arthurscchan deleted the fix-new-bazel-problem branch December 12, 2024 11:02
DavidKorczynski added a commit that referenced this pull request Dec 12, 2024
supersedes: #12838 with a less
intrusive approach

Signed-off-by: David Korczynski <[email protected]>
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