homebrew-core
homebrew-core copied to clipboard
bazel 5.3.1
Created by brew bump
Created with brew bump-formula-pr
.
on linux:
==> /home/linuxbrew/.linuxbrew/Cellar/bazel/5.3.1/bin/bazel build //:bazel-test
file is invalid or corrupted (missing end of central directory record)
Opening zip "/home/linuxbrew/.linuxbrew/Cellar/bazel/5.3.1/libexec/bin/bazel-real": Cannot find central directory
FATAL: Failed to open '/home/linuxbrew/.linuxbrew/Cellar/bazel/5.3.1/libexec/bin/bazel-real' as a zip file: (error: 5): Input/output error
Weird, I cannot reproduce this failure locally. Might be worth trying to deparallelize the build.
let's give a re-run before updating the build flow.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. To keep this pull request open, add a help wanted
or in progress
label.
#111955
Weird, I cannot reproduce this failure locally. Might be worth trying to deparallelize the build.
@danielnachun I think I can reproduce this issue in codespace. (looks like we did strip the binary when installing bazel-real?), can you help me understand that? Thanks!
Here are the error logs
@chenrui333 ➜ /workspaces/homebrew-core xxx $ bazel --help
WARNING: Invoking Bazel in batch mode since it is not invoked from within a workspace (below a directory having a WORKSPACE file).
file is invalid or corrupted (missing end of central directory record)
Opening zip "/home/linuxbrew/.linuxbrew/Cellar/bazel/5.3.2/libexec/bin/bazel-real": Cannot find central directory
FATAL: Failed to open '/home/linuxbrew/.linuxbrew/Cellar/bazel/5.3.2/libexec/bin/bazel-real' as a zip file: (error: 5): Input/output error
@chenrui333 ➜ /workspaces/homebrew-core xxx $ uname -a
Linux codespaces-d485d1 5.4.0-1094-azure #100~18.04.1-Ubuntu SMP Mon Oct 17 11:44:30 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
@chenrui333 ➜ /workspaces/homebrew-core xxx $ file /home/linuxbrew/.linuxbrew/Cellar/bazel/5.3.2/libexec/bin/bazel-real
/home/linuxbrew/.linuxbrew/Cellar/bazel/5.3.2/libexec/bin/bazel-real: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /home/linuxbrew/.linuxbrew/lib/ld.so, for GNU/Linux 3.2.0, BuildID[sha1]=308deeb38d8592a0887a52201363e6bc498efa5d, not stripped
@chenrui333 ➜ /workspaces/homebrew-core (bump-oil-0.12.9 ✗) $ file /home/linuxbrew/.linuxbrew/Cellar/bazel/5.3.2/bin/bazel
/home/linuxbrew/.linuxbrew/Cellar/bazel/5.3.2/bin/bazel: Bourne-Again shell script, ASCII text executable
@chenrui333 ➜ /workspaces/homebrew-core (bump-oil-0.12.9 ✗) $ uname -a
Linux codespaces-d485d1 5.4.0-1094-azure #100~18.04.1-Ubuntu SMP Mon Oct 17 11:44:30 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
It's possible that is actually somewhat related to the problems in https://github.com/Homebrew/homebrew-core/pull/116717, which seems to be happening because they append a compressed archive to the end of an ELF binary (if I understand their Makefile). Bazel is much harder to understand but that error may imply that there is similarly some sort of problem with an archive embedded within the binary.
I haven't been able to examine the output yet because I can't even get bazel
5.3.2 to build from source successfully. But once I hopefully do then I can take a look at what's going on there.
https://github.com/bazelbuild/bazel/issues/600#issuecomment-156456154
The bazel binary is a tiny C++ launcher with a zip file tacked on its butt.
So it does sound like our relocation can't handle these "binaries".
A full unzip bazel-real
still works so it is still seen as a valid archive.
Bazel is looking for some specific locations in zip file: https://github.com/bazelbuild/bazel/blob/5.3.2/src/main/cpp/archive_utils.cc#L38-L54 https://github.com/bazelbuild/bazel/blob/5.3.2/third_party/ijar/zip.cc#L720-L760
I think we have enough to make a new issue as both oil
and bazel
have what appear to be identical problems. My guess is that either our patchelf.rb
doesn't implement something correctly from upstream patchelf
, or the patchelf
upstream itself is broken as well.
Interestingly I have packaged oil
myself in Anaconda and bazel
is already packaged, so it is possible to do some relocation on these without breaking them. I think the most useful thing we can do as a starting point is to build oil
(and bazel
if we can get it to work) from source with brew install --build-from-source
and brew install --build-bottle
followed by brew bottle
and compare the binaries. That should make it really easy to compare the binaries and figure out how they are getting broken.
bazel
5.3.0 was packaged before the Linux migration. Current 5.3.2 is probably broken as we disabled the test on Linux.
I think existing Linux oil
bottle is also the same. It was built on Ubuntu 16.04.
Relocation failures are with new Linux toolchain.
bazel
5.3.0 was packaged before the Linux migration. Current 5.3.2 is probably broken as we disabled the test on Linux.
yeah, we have tested before disabling the test. Should remove the bottle for bazel as well?
Yes, we should drop the bazel
bottle for now until we can fix the patchelf
issues.