Repository navigation
Closed
Description
As of now, setuptools 48.0.0 has been released fo 3h.
Our CI builds (running on aubuntu:18.04 image) have started to fail around that time, with the following error
$ poetry install
Installing dependencies from lock file
...
- Installing pyyaml (5.3.1)
[EnvCommandError]
Command ['/root/.cache/pypoetry/virtualenvs/xxx-qtBNWNw5-py3.7/bin/pip', 'install', '--no-deps', 'pyyaml==5.3.1'] errored with the following return code 1, and output:
Collecting pyyaml==5.3.1
Cache entry deserialization failed, entry ignored
Downloading https://files.pythonhosted.org/packages/64/c2/b80047c7ac2478f9501676c988a5411ed5572f35d1beff9cae07d321512c/PyYAML-5.3.1.tar.gz (269kB)
Building wheels for collected packages: pyyaml
Running setup.py bdist_wheel for pyyaml: started
Running setup.py bdist_wheel for pyyaml: finished with status 'error'
Complete output from command /root/.cache/pypoetry/virtualenvs/xxx-qtBNWNw5-py3.7/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-k5apwpdq/pyyaml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp3opgs21ypip-wheel- --python-tag cp37:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
Failed building wheel for pyyaml
Running setup.py clean for pyyaml
Failed to build pyyaml
Installing collected packages: pyyaml
Running setup.py install for pyyaml: started
Running setup.py install for pyyaml: finished with status 'error'
Complete output from command /root/.cache/pypoetry/virtualenvs/xxx-qtBNWNw5-py3.7/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-k5apwpdq/pyyaml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-v6e72ix9-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/.cache/pypoetry/virtualenvs/xxx-qtBNWNw5-py3.7/include/site/python3.7/pyyaml:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/yaml
copying lib3/yaml/dumper.py -> build/lib.linux-x86_64-3.7/yaml
copying lib3/yaml/tokens.py -> build/lib.linux-x86_64-3.7/yaml
copying lib3/yaml/loader.py -> build/lib.linux-x86_64-3.7/yaml
copying lib3/yaml/nodes.py -> build/lib.linux-x86_64-3.7/yaml
copying lib3/yaml/reader.py -> build/lib.linux-x86_64-3.7/yaml
copying lib3/yaml/cyaml.py -> build/lib.linux-x86_64-3.7/yaml
copying lib3/yaml/resolver.py -> build/lib.linux-x86_64-3.7/yaml
copying lib3/yaml/parser.py -> build/lib.linux-x86_64-3.7/yaml
copying lib3/yaml/events.py -> build/lib.linux-x86_64-3.7/yaml
copying lib3/yaml/composer.py -> build/lib.linux-x86_64-3.7/yaml
copying lib3/yaml/serializer.py -> build/lib.linux-x86_64-3.7/yaml
copying lib3/yaml/constructor.py -> build/lib.linux-x86_64-3.7/yaml
copying lib3/yaml/scanner.py -> build/lib.linux-x86_64-3.7/yaml
copying lib3/yaml/representer.py -> build/lib.linux-x86_64-3.7/yaml
copying lib3/yaml/__init__.py -> build/lib.linux-x86_64-3.7/yaml
copying lib3/yaml/emitter.py -> build/lib.linux-x86_64-3.7/yaml
copying lib3/yaml/error.py -> build/lib.linux-x86_64-3.7/yaml
running build_ext
building '_yaml' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/ext
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/root/.cache/pypoetry/virtualenvs/xxx-qtBNWNw5-py3.7/include -I/usr/include/python3.7m -c ext/_yaml.c -o build/temp.linux-x86_64-3.7/ext/_yaml.o
error: [Errno 2] No such file or directory: 'x86_64-linux-gnu-gcc': 'x86_64-linux-gnu-gcc'
Installing the exact same set of locked dependencies using setuptools-47.3.2 works flawlessly.
Would you need any additional details to determine if this is indeed caused by setuptools ?
Regards.
Metadata
Metadata
Assignees
Labels
No labels

Activity
pganssle commentedon Jul 3, 2020
First thought: I'm guessing pyyaml tries to install a C extension and falls back to a pure python implementation. If they do this by catching some distutils-based exception, it may be that the exception they are catching comes from the standard library and the exception raised comes from setuptools' adopted version.
If that's the problem, pytz-deprecation-shim has some hacks in it to ensure that the pytz-equivalent exceptions can be caught by catching pytz exceptions. I can provide a link when I get back to my computer.
jaraco commentedon Jul 3, 2020
For what it's worth, installing PyYAML from source does seem to work for me on macOS and Setuptools 48:
Verbose output
So it does seem the issue may be related to the poetry invocation.
jaraco commentedon Jul 3, 2020
I am able to replicate the issue on Ubuntu:
jaraco commentedon Jul 3, 2020
I now suspect the issue is intrinsic to the distutils adoption... that something with distutils, either the version that comes with Python 3.9 or the changes applied for PyPy compatibility, have broken the compiler name.
Oh!
So testing the same thing against
Setuptools<48, I can see that the compiler name is correct (and missing), but the fallback works as expected, which seems to confirm Paul's suspicion.jaraco commentedon Jul 3, 2020
I've determined that with Setuptools 47.x, a missing compiler results in a
distutitls.errors.CompileError, but with Setuptools 48, aFileNotFoundErroris raised:jaraco commentedon Jul 3, 2020
(my thought process here):
jaraco commentedon Jul 3, 2020
Digging into the trace when the error occurs:
I now strongly suspect python/cpython#18743.
jaraco commentedon Jul 3, 2020
If my hunch is correct, that should mean that the same error will occur when using Setuptools 47 and Python 3.9. I'm rebuilding jaraco/multipy-tox to include Python 3.9 and confirm/refute that possibility.
jaraco commentedon Jul 3, 2020
Confirmed - the issue is a preview of what's to come with Python 3.9:
webknjaz commentedon Jul 3, 2020
FTR it also breaks Ansible but in a different way: ansible/ansible#70456 (#2230).
jaraco commentedon Jul 3, 2020
Acknowledged. Based on these findings, I'm going to temporarily disable distutils adoption in the latest release to ease the transition.
Disable adopted distutils while troubleshooting #2228 and #2230.
Update changelog. Ref #2228 and #2230.
webknjaz commentedon Jul 3, 2020
@jaraco here's your chance to exercise the use of the new "yank" feature!
jaraco commentedon Jul 3, 2020
I'm not sure yank is helpful here, because Setuptools has already seen subsequent releases, so those would need to be yanked also. I'll just release a new 49.1 that fixes the issue at "latest".
webknjaz commentedon Jul 3, 2020
I'd just yank =48.0 and =49.0 so they'd be still installable but marked as not recommended.
Replace OSError with DistutilsExecError. Fixes #3 and pypa/setuptools…
Replace OSError with DistutilsExecError. Fixes #3 and pypa/setuptools…
Update changelog. Ref #2228.
jaraco commentedon Jul 5, 2020
I've confirmed the 49.0.1 release fixes the issue:
brouberol commentedon Jul 5, 2020
openstack-setuptools: Autospec creation for update from version 49.1.…
setuptools: Autospec creation for update from version 49.1.0 to versi…