Skip to content

Commit

Permalink
fix: missing pkg-config in image build
Browse files Browse the repository at this point in the history
Build was failing with the following error during the installation of
mysqlclient==2.2.0:

	#39 22.19 Collecting mysqlclient==2.2.0 (from -r requirements/production.txt (line 435))
	#39 22.20   Downloading mysqlclient-2.2.0.tar.gz (89 kB)
	#39 22.20      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 89.5/89.5 kB 95.8 MB/s eta 0:00:00
	#39 22.24   Installing build dependencies: started
	#39 24.79   Installing build dependencies: finished with status 'done'
	#39 24.81   Getting requirements to build wheel: started
	#39 25.07   Getting requirements to build wheel: finished with status 'error'
	#39 25.08   error: subprocess-exited-with-error
	#39 25.08
	#39 25.08   × Getting requirements to build wheel did not run successfully.
	#39 25.08   │ exit code: 1
	#39 25.08   ╰─> [24 lines of output]
	#39 25.08       /bin/sh: 1: pkg-config: not found
	#39 25.08       /bin/sh: 1: pkg-config: not found
	#39 25.08       Trying pkg-config --exists mysqlclient
	#39 25.08       Command 'pkg-config --exists mysqlclient' returned non-zero exit status 127.
	#39 25.08       Trying pkg-config --exists mariadb
	#39 25.08       Command 'pkg-config --exists mariadb' returned non-zero exit status 127.
	#39 25.08       Traceback (most recent call last):
	#39 25.08         File "/openedx/venv/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
	#39 25.08           main()
	#39 25.08         File "/openedx/venv/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
	#39 25.08           json_out['return_val'] = hook(**hook_input['kwargs'])
	#39 25.08         File "/openedx/venv/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
	#39 25.08           return hook(config_settings)
	#39 25.08         File "/tmp/pip-build-env-5hyrozx4/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
	#39 25.08           return self._get_build_requires(config_settings, requirements=['wheel'])
	#39 25.08         File "/tmp/pip-build-env-5hyrozx4/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
	#39 25.08           self.run_setup()
	#39 25.08         File "/tmp/pip-build-env-5hyrozx4/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 341, in run_setup
	#39 25.08           exec(code, locals())
	#39 25.08         File "<string>", line 154, in <module>
	#39 25.08         File "<string>", line 48, in get_config_posix
	#39 25.08         File "<string>", line 27, in find_package_name
	#39 25.08       Exception: Can not find valid pkg-config name.
	#39 25.08       Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually
	#39 25.08       [end of output]
  • Loading branch information
regisb committed Sep 8, 2023
1 parent bddd793 commit 21b82de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.d/20230908_095220_regis_nightly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [Bugfix] Fix missing pkg-config during image build. (by @regisb)
7 changes: 4 additions & 3 deletions tutordiscovery/templates/discovery/build/discovery/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ FROM docker.io/ubuntu:20.04 as minimal

ENV DEBIAN_FRONTEND=noninteractive
RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked{% endif %} \
--mount=type=cache,target=/var/lib/apt,sharing=locked{% endif %} \
apt update && \
apt install -y curl git-core language-pack-en python3 python3-pip python3-venv \
build-essential libcairo2 libffi-dev libmysqlclient-dev libxml2-dev libxslt-dev libjpeg-dev libssl-dev
apt install -y curl git-core language-pack-en python3 python3-dev python3-pip python3-venv \
build-essential libcairo2 libffi-dev libmysqlclient-dev libxml2-dev libxslt-dev libjpeg-dev libssl-dev \
pkg-config
ENV LC_ALL en_US.UTF-8

ARG APP_USER_ID=1000
Expand Down

0 comments on commit 21b82de

Please sign in to comment.