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

Some wheels published fail to install with "BadZipFile - Bad CRC-32 for file" #531

Open
jselig-rigetti opened this issue Jan 31, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@jselig-rigetti
Copy link
Contributor

Found during rigetti/pyquil#1817

This may only affect some platforms and versions, but can be reproduced by:

docker run -it --platform="linux/x86_64" python:3.9 pip install qcs-sdk-python

Resulting in:

ERROR: Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 160, in exc_logging_wrapper
    status = run_func(*args)
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 247, in wrapper
    return func(self, options, args)
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 507, in run
    installed = install_given_reqs(
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/req/__init__.py", line 73, in install_given_reqs
    requirement.install(
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/req/req_install.py", line 796, in install
    install_wheel(
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/operations/install/wheel.py", line 729, in install_wheel
    _install_wheel(
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/operations/install/wheel.py", line 589, in _install_wheel
    file.save()
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/operations/install/wheel.py", line 388, in save
    shutil.copyfileobj(f, dest)
  File "/usr/local/lib/python3.9/shutil.py", line 205, in copyfileobj
    buf = fsrc_read(length)
  File "/usr/local/lib/python3.9/zipfile.py", line 926, in read
    data = self._read1(n)
  File "/usr/local/lib/python3.9/zipfile.py", line 1016, in _read1
    self._update_crc(data)
  File "/usr/local/lib/python3.9/zipfile.py", line 944, in _update_crc
    raise BadZipFile("Bad CRC-32 for file %r" % self.name)
zipfile.BadZipFile: Bad CRC-32 for file 'qcs_sdk/qcs_sdk.cpython-39-x86_64-linux-gnu.so'
@jselig-rigetti jselig-rigetti added the bug Something isn't working label Jan 31, 2025
@jselig-rigetti
Copy link
Contributor Author

jselig-rigetti commented Jan 31, 2025

Starting in the repo root directory, running either of the following

docker run -it --platform="linux/x86_64" --entrypoint /bin/bash -v $(pwd):/code quay.io/pypa/manylinux_2_34_x86_64:latest
docker run -it --platform="linux/aarch64" --entrypoint /bin/bash -v $(pwd):/code quay.io/pypa/manylinux_2_34_aarch64:latest

Then this setup

(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y) && . "$HOME/.cargo/env" && cargo install cargo-make
python3.9 -m venv /.venv && source /.venv/bin/activate

cd /code/crates/python
cargo make install-deps

cd /code
maturin build -i 3.9 --release --manifest-path crates/python/Cargo.toml --out /dist

Makes this complete successfully

pip install /dist/*.whl
python -c "import qcs_sdk; print(qcs_sdk.__version__)"

... since this is the case, maybe we can override the inputs.container

@pavoljuhas
Copy link

+1 - there seems to be the same issue for the recently released
qcs_sdk_python-0.21.9-cp312-cp312-win_amd64.whl - https://github.com/quantumlib/Cirq/actions/runs/13122857922/job/36614926452#step:5:832

Can you please yank out the broken files from the PyPI release?

pavoljuhas added a commit to pavoljuhas/Cirq that referenced this issue Feb 3, 2025
The wheel installation fails on Windows Python 3.12 with
`Bad CRC-32 for file 'qcs_sdk/qcs_sdk.cp312-win_amd64.pyd'`

Revert after the fix of rigetti/qcs-sdk-rust#531
github-merge-queue bot pushed a commit to quantumlib/Cirq that referenced this issue Feb 3, 2025
The wheel installation fails on Windows Python 3.12 with
`Bad CRC-32 for file 'qcs_sdk/qcs_sdk.cp312-win_amd64.pyd'`

Revert after the fix of rigetti/qcs-sdk-rust#531
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants