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

Bazel build fails due to bad pip cache #84

Open
sren-applied opened this issue Mar 28, 2023 · 1 comment
Open

Bazel build fails due to bad pip cache #84

sren-applied opened this issue Mar 28, 2023 · 1 comment

Comments

@sren-applied
Copy link

Environments can get into a bad state by interrupted pip installs or other corruption of the pip wheel, which leads to all subsequent builds failing with errors similar to:

File "/home/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/f1d1ae8a5075539a72e45ef6b412b203/external/com_github_ali5h_rules_pip/third_party/py/pip/_internal/metadata/base.py", line 321, in as_zipfile
--
  | return zipfile.ZipFile(self.location, allowZip64=True)
  | File "/usr/lib/python3.8/zipfile.py", line 1269, in __init__
  | self._RealGetContents()
  | File "/usr/lib/python3.8/zipfile.py", line 1336, in _RealGetContents
  | raise BadZipFile("File is not a zip file")
  | zipfile.BadZipFile: File is not a zip file
  | Traceback (most recent call last):
  | File "/home/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/f1d1ae8a5075539a72e45ef6b412b203/external/com_github_ali5h_rules_pip/src/whl.py", line 401, in <module>
  | main()
  | File "/home/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/f1d1ae8a5075539a72e45ef6b412b203/external/com_github_ali5h_rules_pip/src/whl.py", line 262, in main
  | pkg = install_package(args.package, args.directory, pip_args)
  | File "/home/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/f1d1ae8a5075539a72e45ef6b412b203/external/com_github_ali5h_rules_pip/src/whl.py", line 108, in install_package
  | dist_info = glob.glob(os.path.join(directory, "*.dist-info"))[0]
  | IndexError: list index out of range
  | )

Internally we've wrapped the pip install with a retry and removal of the package from the local pip cache; wanted to see if there was interest in having the change upstreamed. @ali5h

@ali5h
Copy link
Owner

ali5h commented Jul 22, 2023

yeah, that would be great

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

No branches or pull requests

2 participants