Skip to content

[bazel] update .bazelversion to 8.0.0 #119425

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

Merged
merged 5 commits into from
Dec 10, 2024

Conversation

nickdesaulniers
Copy link
Member

Fixes:

ERROR: The project you're trying to build requires Bazel 7.3.0 (specified
in llvm-project/utils/bazel/.bazelversion), but it wasn't found in
/usr/bin.

You can install the required Bazel version via apt:
  sudo apt update && sudo apt install bazel-7.3.0

If this doesn't work, check Bazel's installation instructions for help:
  https://bazel.build/install/ubuntu

Link: https://blog.bazel.build/2024/12/09/bazel-8-release.html

@nickdesaulniers
Copy link
Member Author

Hmm...even with this change, I'm observing:

$ cd llvm-project/utils/bazel
$ bazel query @llvm-project//libc/... | xargs bazel test --config=generic_clang --test_output=errors --test_tag_filters=-nobuildkite --build_tag_filters=-nobuildkite --@llvm-project//libc:mpfr=system
ERROR: Error computing the main repository mapping: error loading package 'external': Both --enable_bzlmod and --enable_workspace are disabled, but one of them must be enabled to fetch external dependencies.
ERROR: Error computing the main repository mapping: error loading package 'external': Both --enable_bzlmod and --enable_workspace are disabled, but one of them must be enabled to fetch external dependencies.

@keith
Copy link
Member

keith commented Dec 10, 2024

yea for this we need to add --enable_workspace to the .bazelrc until we support bzlmod

@nickdesaulniers
Copy link
Member Author

$ bazel query @llvm-project//libc/... --enable_workspace
ERROR: Failed to load Starlark extension '@@rules_cc//cc/toolchains:toolchain_config_utils.bzl'.
Cycle in the workspace file detected. This indicates that a repository is used prior to being defined.
The following chain of repository dependencies lead to the missing definition.
 - @@rules_cc
This could either mean you have to add the '@@rules_cc' repository with a statement like `http_archive` in your WORKSPACE file (note that transitive dependencies are not added automatically), or move an existing definition earlier in your WORKSPACE file.
ERROR: Error computing the main repository mapping: cycles detected during computation of main repo mapping

@keith
Copy link
Member

keith commented Dec 10, 2024

yea looks like we have to add that to the WORKSPACE now

@nickdesaulniers
Copy link
Member Author

diff --git a/utils/bazel/WORKSPACE b/utils/bazel/WORKSPACE
index 66ba1ac1b17e..a3b8be7814d4 100644
--- a/utils/bazel/WORKSPACE
+++ b/utils/bazel/WORKSPACE
@@ -4,6 +4,7 @@
 
 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
 load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
+load("@rules_cc//cc:defs.bzl", "http_archive")
 
 SKYLIB_VERSION = "1.3.0"
 

didn't seem to work

@keith
Copy link
Member

keith commented Dec 10, 2024

you have to pull in that repo as shown here https://github.com/bazelbuild/rules_cc/releases/tag/0.0.17

@llvmbot llvmbot added the bazel "Peripheral" support tier build system: utils/bazel label Dec 10, 2024
@nickdesaulniers
Copy link
Member Author

WARNING: WORKSPACE support will be removed in Bazel 9 (late 2025), please migrate to Bzlmod, see https://bazel.build/external/migration.
WARNING: Couldn't auto load rules or symbols, because no dependency on module/repository 'rules_android' found. This will result in a failure if there's a reference to those rules or symbols.
ERROR: /usr/local/google/home/ndesaulniers/.cache/bazel/_bazel_ndesaulniers/02cf1b716d72de9bb7498bab3b083b83/external/rules_python/python/private/reexports.bzl:37:17: name 'PyInfo' is not defined (did you mean 'CcInfo'?)
ERROR: /usr/local/google/home/ndesaulniers/.cache/bazel/_bazel_ndesaulniers/02cf1b716d72de9bb7498bab3b083b83/external/rules_python/python/private/reexports.bzl:40:24: name 'PyRuntimeInfo' is not defined
ERROR: error loading package under directory 'libc': error loading package '@@llvm-project//libc': Internal error while loading Starlark builtins: Failed to autoload external symbols: at /usr/local/google/home/ndesaulniers/.cache/bazel/_bazel_ndesaulniers/02cf1b716d72de9bb7498bab3b083b83/external/rules_python/python/py_info.bzl:18:6: compilation of module 'python/private/reexports.bzl' failed Most likely you need to upgrade the version of rules repository in the WORKSPACE file.

That first warning seems fine, since we have #55924. Not sure yet about the rest.

@keith
Copy link
Member

keith commented Dec 10, 2024

i think we should try updating rules_python to fix

@nickdesaulniers
Copy link
Member Author

@keith
Copy link
Member

keith commented Dec 10, 2024

we should probably try to fix bazel CI before landing so we can differentiate issues

@nickdesaulniers
Copy link
Member Author

nickdesaulniers commented Dec 10, 2024

we should probably try to fix bazel CI before landing so we can differentiate issues

Working on that, too. 😉

#119433

@nickdesaulniers
Copy link
Member Author

we should probably try to fix bazel CI before landing so we can differentiate issues

Where is this bazel CI?

@keith
Copy link
Member

keith commented Dec 10, 2024

@nickdesaulniers
Copy link
Member Author

nickdesaulniers commented Dec 10, 2024

build is still red, now due to #114333 and 9735873. Am I also on the hook to fix those? :^)

Fixes:

    ERROR: The project you're trying to build requires Bazel 7.3.0 (specified
    in llvm-project/utils/bazel/.bazelversion), but it wasn't found in
    /usr/bin.

    You can install the required Bazel version via apt:
      sudo apt update && sudo apt install bazel-7.3.0

    If this doesn't work, check Bazel's installation instructions for help:
      https://bazel.build/install/ubuntu

Link: https://blog.bazel.build/2024/12/09/bazel-8-release.html
@rupprecht
Copy link
Collaborator

build is still red, now due to #114333 and 9735873. Am I also on the hook to fix those? :^)

I'm looking at the MLIR one now, will get the LLDB one next.

@keith
Copy link
Member

keith commented Dec 10, 2024

I'm prepping a fix for the LLDB one

@keith
Copy link
Member

keith commented Dec 10, 2024

#119456

@nickdesaulniers
Copy link
Member Author

Once #119457 is green, I'll merge this?

@nickdesaulniers
Copy link
Member Author

It's green. merging

@nickdesaulniers nickdesaulniers merged commit 5877e5b into llvm:main Dec 10, 2024
6 checks passed
@nickdesaulniers
Copy link
Member Author

@nickdesaulniers
Copy link
Member Author

warning: input 'external/llvm-project/llvm/utils/lit/tests/shtest-run-at-line.py' contained no tests
error: did not discover any tests for provided path(s)

I think is the relevant error?

@nickdesaulniers
Copy link
Member Author

cc @GMNGeoffrey

@nickdesaulniers
Copy link
Member Author

lit.py: /usr/local/google/home/ndesaulniers/.cache/bazel/_bazel_ndesaulniers/02cf1b716d72de9bb7498bab3b083b83/sandbox/linux-sandbox/6372/execroot/__main__/bazel-out/k8-fastbuild/bin/external/llvm-project/mlir/test/Dialect/SPIRV/Linking/ModuleCombiner/basic.mlir.test.runfiles/llvm-project/llvm/utils/lit/lit/discovery.py:137: warning: unable to find test suite for 'external/llvm-project/mlir/test/Dialect/SPIRV/Linking/ModuleCombiner/basic.mlir'

so I think anything running lit is having an issue. Perhaps something in llvm/utils/lit/lit/discovery.py needs to be fixed?

@nickdesaulniers
Copy link
Member Author

I suspect that "external" is no longer being added to a path somewhere...

@keith
Copy link
Member

keith commented Dec 10, 2024

I bisected to bazelbuild/bazel@52105e3, it's a known issue that we rely on this, we just need to flip it back for now: #119462

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bazel "Peripheral" support tier build system: utils/bazel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants