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

Poetry 1.7.1 fails to install blurhash-python in Docker Build Github Actions #21

Closed
adonistseriotis opened this issue Jan 23, 2024 · 3 comments

Comments

@adonistseriotis
Copy link

adonistseriotis commented Jan 23, 2024

  • Poetry version: 1.7.1
  • Python version: 3.10.9
  • OS version and name: Ubuntu 22.04 (ubuntu-latest in Github Actions Runner)

Issue


poetry install fails on blurhash-python version 1.2.1 with error:

#13 94.79 
#13 94.79   ChefBuildError
#13 94.79 
#13 94.79   Backend subprocess exited when trying to invoke build_wheel
#13 94.79   
#13 94.79   WARNING setuptools_scm.pyproject_reading toml section missing 'pyproject.toml does not contain a tool.setuptools_scm section'
#13 94.79   running bdist_wheel
#13 94.79   running build
#13 94.79   running build_py
#13 94.79   creating build
#13 94.79   creating build/lib.linux-aarch64-cpython-310
#13 94.79   creating build/lib.linux-aarch64-cpython-310/blurhash
#13 94.79   copying src/blurhash/_version.py -> build/lib.linux-aarch64-cpython-310/blurhash
#13 94.79   copying src/blurhash/__init__.py -> build/lib.linux-aarch64-cpython-310/blurhash
#13 94.79   running build_ext
#13 94.79   generating cffi module 'build/temp.linux-aarch64-cpython-310/blurhash._functions.c'
#13 94.79   creating build/temp.linux-aarch64-cpython-310
#13 94.79   building 'blurhash._functions' extension
#13 94.79   creating build/temp.linux-aarch64-cpython-310/build
#13 94.79   creating build/temp.linux-aarch64-cpython-310/build/temp.linux-aarch64-cpython-310
#13 94.79   creating build/temp.linux-aarch64-cpython-310/src
#13 94.79   gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Isrc/ -I/tmp/tmp1a5eylby/.venv/include -I/var/lang/include/python3.10 -c build/temp.linux-aarch64-cpython-310/blurhash._functions.c -o build/temp.linux-aarch64-cpython-310/build/temp.linux-aarch64-cpython-310/blurhash._functions.o -std=gnu99
#13 94.79   error: command 'gcc' failed: No such file or directory
#13 94.79   
#13 94.79 
#13 94.79   at /var/lang/lib/python3.10/site-packages/poetry/installation/chef.py:164 in _prepare
#13 95.04       160│ 
#13 95.04       161│                 error = ChefBuildError("\n\n".join(message_parts))
#13 95.04       162│ 
#13 95.04       163│             if error is not None:
#13 95.04     → 164│                 raise error from None
#13 95.04       165│ 
#13 95.04       166│             return path
#13 95.04       167│ 
#13 95.05       168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
#13 95.05 
#13 95.05 Note: This error originates from the build backend, and is likely not a problem with poetry but with blurhash-python (1.2.1) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "blurhash-python (==1.2.1)"'.
#13 95.05 
#13 95.05   • Installing uvicorn (0.23.1)
#13 95.06   • Installing uvloop (0.19.0)
#13 95.52   • Installing watchfiles (0.19.0)
#13 96.44   • Installing websockets (11.0.3)
#13 ERROR: process "/bin/sh -c poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root" did not complete successfully: exit code: 1
------
 > [8/9] RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root:
95.04       166│             return path
95.04       167│ 
95.05       168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
95.05 
95.05 Note: This error originates from the build backend, and is likely not a problem with poetry but with blurhash-python (1.2.1) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "blurhash-python (==1.2.1)"'.
95.05 
95.05   • Installing uvicorn (0.23.1)
95.06   • Installing uvloop (0.19.0)
95.52   • Installing watchfiles (0.19.0)
96.44   • Installing websockets (11.0.3)
------
Dockerfile:39
--------------------
  37 |     
  38 |     # Project initialization:
  39 | >>> RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root
  40 |     
  41 |     # Copy function code
--------------------
ERROR: failed to solve: process "/bin/sh -c poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root" did not complete successfully: exit code: 1
Error: buildx failed with: ERROR: failed to solve: process "/bin/sh -c poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root" did not complete successfully: exit code: 1

I've tried everything, even downgrading Poetry and blurhash-python but it keeps failing whereas it works on my local development device (macbook air M1 14.3).

The only issue I found similar to this error is: Installing a package that depends on setuptools fails intermittently: Backend 'setuptools.build_meta:legacy' is not available. #7611 on Poetry repository but no luck.

Maybe pyproject.toml file needs updating its build backend.

@lautat
Copy link
Contributor

lautat commented Jan 24, 2024

Hi,

The log you pasted above contains a clue what the issue could be:

#13 94.79   gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Isrc/ -I/tmp/tmp1a5eylby/.venv/include -I/var/lang/include/python3.10 -c build/temp.linux-aarch64-cpython-310/blurhash._functions.c -o build/temp.linux-aarch64-cpython-310/build/temp.linux-aarch64-cpython-310/blurhash._functions.o -std=gnu99
#13 94.79   error: command 'gcc' failed: No such file or directory

That looks a lot like gcc, which is required to build the package from source, is not installed on the runner by default.

I tried installing blurhash on my computer using Poetry 1.7.1, from both wheel and source distribution. Both methods were successful, so the issue shouldn't be with the package.

@lautat
Copy link
Contributor

lautat commented Jan 24, 2024

I figured out a way to build wheels for aarch64. I'm releasing a new version, 1.2.2, which adds wheels for Python 3.12 and aarch64 architecture, for every supported Python version. I'm using qemu to build and test the wheels, so hopefully it'll work on real hardware too 🤞

@lautat
Copy link
Contributor

lautat commented Jan 24, 2024

I have released the new version: https://pypi.org/project/blurhash-python/1.2.2/. You should be able to install it without gcc. Let me know if you're unable to install the new version.

@lautat lautat closed this as completed Jan 24, 2024
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