PY_CFLAGS contains reference to -specs=/usr/share/dpkg/no-pie-compile.specs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python3.6 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Cosmic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
SRU:
Impact]
* Causing a build failure
[Test Case]
* See below. Or just check that the flag doesn't show
up when building extensions.
[Regression Potential]
* I don't see any. These flags are injected anyway
in the package builds for extensions. It's only about
virtualenv installations.
Minimal reproduction (docker):
FROM ubuntu:bionic
RUN apt-get update && \
apt-get install -y --no-install-
apt-get clean && \
rm -rf /var/lib/
RUN virtualenv /venv -ppython3 && \
/venv/bin/pip install ujson
Fails with:
Collecting ujson
Downloading https:/
Building wheels for collected packages: ujson
Running setup.py bdist_wheel for ujson: started
Running setup.py bdist_wheel for ujson: finished with status 'error'
Complete output from command /venv/bin/python3 -u -c "import setuptools, tokenize;
running bdist_wheel
running build
running build_ext
building 'ujson' extension
creating build
creating build/temp.
creating build/temp.
creating build/temp.
x86_64-
x86_64-
error: command 'x86_64-
-----
Failed building wheel for ujson
Running setup.py clean for ujson
Failed to build ujson
Installing collected packages: ujson
Running setup.py install for ujson: started
Running setup.py install for ujson: finished with status 'error'
Complete output from command /venv/bin/python3 -u -c "import setuptools, tokenize;
running install
running build
running build_ext
building 'ujson' extension
creating build
creating build/temp.
creating build/temp.
creating build/temp.
x86_
x86_
error: command 'x86_64-
---
Command "/venv/bin/python3 -u -c "import setuptools, tokenize;
The command '/bin/sh -c virtualenv /venv -ppython3 && /venv/bin/pip install ujson' returned a non-zero code: 1
The root cause of this seems to be the PY_CFLAGS sysconfig setting which contains flags that were used to build python itself, including a reference to a file which doesn't exist:
root@71b2faa3da
CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-
CONFIGURE_CFLAGS = "-g -fdebug-
CONFIG_ARGS = "'--enable-shared' '--prefix=/usr' '--enable-ipv6' '--enable-
PY_CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-
PY_CORE_CFLAGS = "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-
description: | updated |
tags: |
added: verification-done verification-done-bionic removed: verification-needed verification-needed-bionic |
confirmed. we need to change that for 18.04. For now you can work around this by install the dpkg-dev package.