bazel: add patches to compile with gcc-11#28548
Conversation
|
Based on #27138 (comment) I'm guessing that this wasn't enough to solve the issue? |
|
#29016 adds Bazel 5, might be worth looking at. If that fixes GCC 11 build issues I vote we close this. |
|
My apologies for this PR languishing so long. I committed another set of changes to address older versions.
Bazel 5 does build without the patches. I allowed for that in the constraints settings of this PR. I do not think we should close this though as this gets bazel 3 to build with newer GCC versions. Note: I could not build versions |
|
Also see #30655 |
|
So, I need Bazel 4.1+ for Apple M1 support, and we have a few open Bazel PRs now, including #29016 and #30655. I'm no longer maintaining the Bazel package, which means that no one is maintaining the package, which means that no one cares if the package breaks. So I'm inclined to just start merging things and ask questions later. This PR seems to encompass most (all?) of #30655, and #29016 hasn't gotten a response since I reviewed it. So I'm thinking about just merging this and closing #30655 and #29016. Any objections from @elfprince13 or @haralmha? Any volunteers to officially maintain the package? |
|
@adamjstewart sounds good to me. We are building the bazel based packages from wheels now anyway. |
|
Tried building this on macOS 12.3.1 and Apple M1 Pro with Apple Clang 13.1.6 and JDK 18.0.1.1 but it doesn't build for me. Here is the build log: spack-build-out.txt. Any idea why this doesn't work? |
|
I can check tomorrow if this solves my issue. |
|
Also tried Bazel 5.1.1 but I also saw build issues. Maybe my JDK version is too new? |
|
Just tried building Bazel 4.2.2 and this also needs a patch for: >> 72881 external/com_google_absl/absl/synchronization/internal/graphcycles.cc:451:26: error: no member named 'numeric_limits' in namespace 'std'
72882 if (x->version == std::numeric_limits<uint32_t>::max()) {
72883 ~~~~~^
>> 72884 external/com_google_absl/absl/synchronization/internal/graphcycles.cc:451:41: error: unexpected type name 'uint32_t': expected expression
72885 if (x->version == std::numeric_limits<uint32_t>::max()) {
72886 ^
>> 72887 external/com_google_absl/absl/synchronization/internal/graphcycles.cc:451:52: error: no member named 'max' in the global namespace
72888 if (x->version == std::numeric_limits<uint32_t>::max()) {
72889 ~~^
72890 3 errors generated.
72891 [935 / 2,844] 7 actions running
72892 JavacBootstrap .../devtools/build/buildjar/libstarlark-deps.jar; 48s local
72893 Compiling src/google/protobuf/descriptor.cc; 12s local |
@elfprince13 This PR patches that already. Version 4.2.2 builds fine for me. |
|
@glennpj when you get a chance can you rebase and make sure your patches still apply to all versions? @elfprince13 and I can test this and get it merged soon. |
|
Need to rebase/merge master. Probably want to run |
|
Let me see if I can fix that for you! |
|
Oops, didn't intend to run that for you... |
|
I was able to run spack style --fix==> Running style checks on spack
selected: isort, mypy, black, flake8
==> Modified files
var/spack/repos/builtin/packages/bazel/package.py
==> Running isort checks
isort checks were clean
==> Running mypy checks
Success: no issues found in 555 source files
mypy checks were clean
==> Running black checks
reformatted var/spack/repos/builtin/packages/bazel/package.py
All done! ✨ 🍰 ✨
1 file reformatted.
black checks were clean
==> Running flake8 checks
var/spack/repos/builtin/packages/bazel/package.py:124: [E501] line too long (137 > 99 characters)
flake8 found errors
I've updated the branch with isort fixes. |
|
@spackbot fix style |
|
Let me see if I can fix that for you! |
|
I was able to run spack style --fix==> Running style checks on spack
selected: isort, mypy, black, flake8
==> Modified files
var/spack/repos/builtin/packages/bazel/package.py
==> Running isort checks
isort checks were clean
==> Running mypy checks
Success: no issues found in 555 source files
mypy checks were clean
==> Running black checks
reformatted var/spack/repos/builtin/packages/bazel/package.py
All done! ✨ 🍰 ✨
1 file reformatted.
black checks were clean
==> Running flake8 checks
var/spack/repos/builtin/packages/bazel/package.py:124: [E501] line too long (137 > 99 characters)
flake8 found errors
I've updated the branch with isort fixes. |
- deprecate versions 0.16 and lower as they do not build - versions older than 0.22 depend on java@8 - adjust when patches are applied - adjust gcc conflicts directive
|
So, spackbot adds a |
|
The conflicts label is for usage of the conflicts directive in a package, not for merge conflicts. Maybe we should remove that label, I agree that it's kind of confusing. |
The label referring to package conflicts makes perfect sense, but my brain did associate it with the merge conflicts at the time. Perhaps |
|
Is this PR good to go now? @elfprince13 can you test this and make sure it solves your problems? |
adamjstewart
left a comment
There was a problem hiding this comment.
Added a commit to fix some issues I noticed during patching. With these changes, all patches now apply successfully to all versions. I haven't actually tested building older bazel with newer GCC, but I'll leave that part to someone else to test.
| @@ -0,0 +1,14 @@ | |||
| diff --git a/third_party/ijar/zlib_client.h b/third_party/ijar/zlib_client.h | |||
There was a problem hiding this comment.
Any reason not to combine 1 and 2 into a single patch?
There was a problem hiding this comment.
No, the reason they are separate was just to be consistent with the source the patches were derived from. That is also why they are named the way they are. I thought that would be the most clear way to track what is going on.
works over here.... |
It didn't but #40084 should get us the rest of the way there. |
Bazel does not currently build with GCC-11. There are patches available on the bazel project site for Alpine Linux that should work. The problem is that java-tools also needs patching.