This repository was archived by the owner on Jun 1, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 1, 2026. It is now read-only.
Cannot build 1.1.3 on Alpine #83
Copy link
Copy link
Closed
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.status: investigatingThe issue is under investigation, which is determined to be non-trivial.The issue is under investigation, which is determined to be non-trivial.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
With #76, builds on Alpine fail.
The resulting output:
# pip install google-crc32c
Collecting google-crc32c
Downloading google-crc32c-1.1.3.tar.gz (12 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: google-crc32c
Building wheel for google-crc32c (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /usr/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpsx030db9
cwd: /tmp/pip-install-wrnldd24/google-crc32c_f2c995e00fea4c81833f393fe6486738
Complete output (22 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/google_crc32c
copying src/google_crc32c/__config__.py -> build/lib.linux-x86_64-3.9/google_crc32c
copying src/google_crc32c/cext.py -> build/lib.linux-x86_64-3.9/google_crc32c
copying src/google_crc32c/__init__.py -> build/lib.linux-x86_64-3.9/google_crc32c
copying src/google_crc32c/_checksum.py -> build/lib.linux-x86_64-3.9/google_crc32c
copying src/google_crc32c/python.py -> build/lib.linux-x86_64-3.9/google_crc32c
running build_ext
building 'google_crc32c._crc32c' extension
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/src
creating build/temp.linux-x86_64-3.9/src/google_crc32c
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -fomit-frame-pointer -g -fno-semantic-interposition -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/include/python3.9 -c src/google_crc32c/_crc32c.c -o build/temp.linux-x86_64-3.9/src/google_crc32c/_crc32c.o
src/google_crc32c/_crc32c.c:3:10: fatal error: crc32c/crc32c.h: No such file or directory
3 | #include <crc32c/crc32c.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for google-crc32c
Failed to build google-crc32c
ERROR: Could not build wheels for google-crc32c which use PEP 517 and cannot be installed directly
Environment details
- Programming language:
- OS: Alpine
- Language runtime version: 3.9.5
- Package version: 1.1.3
Steps to reproduce
pip install google-crc32c
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.status: investigatingThe issue is under investigation, which is determined to be non-trivial.The issue is under investigation, which is determined to be non-trivial.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Activity
mayansalama commentedon Aug 31, 2021
Also hit this today, I assume as a prereq from google-cloud-storage. Forcing 1.1.2 solved the issue for me using
google-cloud-storage==1.37.1oittaa commentedon Aug 31, 2021
You can also find another build failure example from here: https://github.com/oittaa/gcp-storage-emulator/pull/74/checks?check_run_id=3467604438
kaime commentedon Aug 31, 2021
Same issue here on
python:3.8.8-alpine3.13. Addedgoogle-crc32c==1.1.2beforegoogle-cloud-storage==1.42.0to requirements file to workaround it.armenzg commentedon Aug 31, 2021
I'm facing the same issue on Apple's M1 with Python 3.8. I've pinned to version 1.1.2 to work around it.
pin google-crc32c version
Fix PyPy integration tests in CI.
dilipped commentedon Aug 31, 2021
This also affected our automated kokoro tests for
gcloud alpha storage.I was able to reproduce on a GCE VM running Debian 4.19.181-1 by running the following command.
Fix PyPy integration tests in CI. (#1432)
danielduhh commentedon Aug 31, 2021
@tseaver any idea whats going on? Seems like the latest release didn't include the .whl
tseaver commentedon Aug 31, 2021
@danielduhh
We don't have specific support for Alpine Linux. Is there a reason why one of the
manylinuxwheels wouldn't install on your machine? Here are the list of wheels for the 1.1.3 release.Note that building from source is going to require that you already have the
google-crc32cC library (and headers, if packaged separately) installed on your machine.On my Ubuntu 20.04 laptop, which does not have the library installed globally:
tseaver commentedon Aug 31, 2021
@mbrancato, @mayansalama, @oittaa, @kaime, @armenzg, @dilipped: Can you please provide the output of the following, using the
python3executable into which you were attempting the install?/path/to/python3 -c "import platform; print(platform.platform()); print(platform.architecture())" /path/to/python3 -m pip debug --verboseOn my machine:
12 remaining items
kaime commentedon Sep 1, 2021
@tseaver This works on
python:3.8.8-alpine3.13👍oittaa commentedon Sep 1, 2021
@tseaver Here's the output. Copy & pasted from here: https://github.com/oittaa/gcp-storage-emulator/pull/76/checks?check_run_id=3485093270
oittaa commentedon Sep 1, 2021
Forcing
google-crc32c==1.1.2withgoogle-cloud-storagefixed the issue for me as well.shihgianlee commentedon Sep 1, 2021
@tseaver
pip3 install --upgrade pipbefore installinggoogle-cloud-storage==1.38.0works for me. Thanks!seantsb commentedon Sep 1, 2021
this did not appear to work for me :/
tseaver commentedon Sep 1, 2021
@seantsb The following Dockerfile works for me:
$ cat Dockerfile FROM alpine:3.13 RUN apk add --no-cache python3 \ && apk add --no-cache python3-dev \ && python3 -m ensurepip \ && pip3 install --upgrade setuptools pip wheel RUN CRC32C_PURE_PYTHON=1 pip3 install google-crc32c==1.1.3 $ docker run . ... Collecting google-crc32c==1.1.3 Downloading google-crc32c-1.1.3.tar.gz (12 kB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing wheel metadata: started Preparing wheel metadata: finished with status 'done' Building wheels for collected packages: google-crc32c Building wheel for google-crc32c (PEP 517): started Building wheel for google-crc32c (PEP 517): finished with status 'done' Created wheel for google-crc32c: filename=google_crc32c-1.1.3-py3-none-any.whl size=13003 sha256=576bc6e079c4d39d976c33f50628c06e416f41f4267081c280eb6943086d2a3f Stored in directory: /root/.cache/pip/wheels/d1/0d/df/00594dd92f619702b5f0f6e2bdf979be143b27137da3bd4334 Successfully built google-crc32c Installing collected packages: google-crc32c Successfully installed google-crc32c-1.1.3 ...We could maybe figure out how to get the underlying C library built, which would then allow creating the wheel without
CRC32C_PURE_PYTHON(and run lots faster).tseaver commentedon Sep 1, 2021
Hmm, seems to work:
$ cat Dockerfile FROM alpine:3.13 RUN apk add --no-cache gcc \ && apk add --no-cache g++ \ && apk add --no-cache musl-dev \ && apk add --no-cache git \ && apk add --no-cache make \ && apk add --no-cache cmake RUN git clone https://github.com/google/crc32c \ && cd crc32c \ && git submodule update --init --recursive \ && mkdir build \ && cd build \ && cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCRC32C_BUILD_TESTS=no \ -DCRC32C_BUILD_BENCHMARKS=no \ -DBUILD_SHARED_LIBS=yes \ .. \ && make all install RUN apk add --no-cache python3 \ && apk add --no-cache python3-dev \ && python3 -m ensurepip \ && pip3 install --upgrade setuptools pip wheel RUN pip3 install google-crc32c==1.1.3 $ docker build . ... Step 5/5 : RUN pip3 install google-crc32c==1.1.3 ---> Running in d8414f9fb28d Collecting google-crc32c==1.1.3 Downloading google-crc32c-1.1.3.tar.gz (12 kB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing wheel metadata: started Preparing wheel metadata: finished with status 'done' Building wheels for collected packages: google-crc32c Building wheel for google-crc32c (PEP 517): started Building wheel for google-crc32c (PEP 517): finished with status 'done' Created wheel for google-crc32c: filename=google_crc32c-1.1.3-cp38-cp38-linux_x86_64.whl size=20472 sha256=e2f54993aa1e2e0c609e39c4d969cedeb29eb5a93dc40ffc69e1aed3333a653f Stored in directory: /root/.cache/pip/wheels/d1/0d/df/00594dd92f619702b5f0f6e2bdf979be143b27137da3bd4334 Successfully built google-crc32c Installing collected packages: google-crc32c Successfully installed google-crc32c-1.1.3tseaver commentedon Sep 1, 2021
@oittaa We didn't have support for Linux wheels for Python 3.10-dev until recently (PR #78 isn't merged yet), and so your install failed trying to install the sdist. Unless you set
CRC32C_PURE_PYTHON=1in the environment, installing the sdist needs to have the headers / .so for the underlyingcrc32clibrary.fix: advise setting 'CRC32C_PURE_PYTHON' after build failure (#84)
ci: restore building 'manylinux1' wheels.
ci: restore building 'manylinux1' wheels.
fix: restore building 'manylinux1' wheels (#87)
seantsb commentedon Sep 1, 2021
@tseaver you linked this same issue; did you mean to reference #85 ?
If my system doesn't like 1.1.3, does using 1.1.2 instead just mean it's using the (slow) pure-python version? E.g. I might as well upgrade to 1.1.3 with
CRC32C_PURE_PYTHON=1for explicitness?tseaver commentedon Sep 2, 2021
Here's my resolution as of today's
1.1.4release:pip(missingmanylinux1_x86_64builds for 1.1.3) should now be able to install1.1.4(PR fix: restore building 'manylinux1' wheels #87). Upgrading to currentpipis still recommended, as the PyPA folks are dropping support formanylinux1at the end of 2021.manylinuxLinux (e.g., Alpine) can either set theCRC32C_PURE_PYTHON=1flag when installing, or add the fragment I posted above to build thecrc32clibrary in their Dockerfile before installing.