← All tasks
pythonMagicStack/uvloop #320Not a task: not reproduced

building wheel from sdist fails

envgap__MagicStack__uvloop-320

01 / FAILURE SIGNATURE

As reported upstream

error: don't know how to compile C/C++ code on platform 'posix' with '<distutils.unixccompiler.UnixCCompiler object at 0x7f054bc1fa10>' compiler
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
74d381e87a98e4a58e682aa83c2dc4d81ea814a5
Manifest
setup.py
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

MagicStack/uvloop #320 · read the original issue
<!--

Thanks for wanting to report an issue you've found in uvloop. Please fill in

the template below.



It will be much easier for us to fix the issue if a test case that reproduces

the problem is provided, with clear instructions on how to run it.



Thank you!

-->



* **uvloop version**: 0.14.0

* **Python version**: 3.6 and 3.7

* **Platform**: Linux (CentOS 7

* **Can you reproduce the bug with `PYTHONASYNCIODEBUG` in env?**: N/A

* **Does uvloop behave differently from vanilla asyncio? How?**: N/A



<!-- Enter your issue details below this comment. -->



What I did:

```pip wheel --global-option build_ext --global-option --inplace uvloop==0.14.0```



What I expected:



The command would build uvloop and bundle it as a wheel for me.



What I saw:



The command fails with ```error: don't know how to compile C/C++ code on platform 'posix' with '<distutils.unixccompiler.UnixCCompiler object at 0x7f054bc1fa10>' compiler``` after build_ext runs (e.g. during the processing of bdist_wheel).



The (heavily) snipped output from the above command is:



```

</path/to/venv>/lib/python3.7/site-packages/pip/_internal/commands/wheel.py:117: UserWarning: Disabling all use of wheels due to the use of --build-option / --global-option / --install-option.

  cmdoptions.check_install_build_global(options)

Looking in indexes: https://pypi.org/simple, https://<private repo>/simple

Collecting uvloop==0.14.0

  Using cached uvloop-0.14.0.tar.gz (2.0 MB)

Building wheels for collected packages: uvloop

  Building wheel for uvloop (setup.py) ... error

  ERROR: Command errored out with exit status 1:

   command: </path/to/venv>/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-12kxwkdh/uvloop/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-12kxwkdh/uvloop/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' build_ext --inplace bdist_wheel -d /tmp/pip-wheel-exvxqjuv

       cwd: /tmp/pip-wheel-12kxwkdh/uvloop/

  Complete output (226 lines):

  running build_ext



 ... <lots of successful build output



 building 'uvloop.loop' extension



... <more successful built output>



  copying build/lib.linux-x86_64-3.7/uvloop/loop.cpython-37m-x86_64-linux-gnu.so -> uvloop

  running bdist_wheel

  running build

  running build_py



... <lots of copying/writing for building the wheel>



  copying uvloop/includes/uv.pxd -> build/lib.linux-x86_64-3.7/uvloop/includes

  running build_ext

  error: don't know how to compile C/C++ code on platform 'posix' with '<distutils.unixccompiler.UnixCCompiler object at 0x7f054bc1fa10>' compiler

  ----------------------------------------

  ERROR: Failed building wheel for uvloop

  Running setup.py clean for uvloop

Failed to build uvloop

ERROR: Failed to build one or more wheels

```



Other observations:



The pip wheel command essentially downloads your sdist, unwinds it, cd's to that directory, and runs ```python setup.py build_ext --inplace bdist_wheel```  This mimics your make file other than the fact that build_ext and bdist_wheel are on one command line.



If I manually run ```python setup.py build_ext --inplace && python setup.py bdist_wheel```, then the wheel is successfully built.  I can't tell exactly how, but it seems like something is building the extension in bdist_wheel instead of simply inheriting what was build by build_ext.  That, in turn, is triggering what may be a latent distutils issue that I documented [here](https://bugs.python.org/issue39917).

Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]