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
The coverage job is broken: distutils build_ext fails on None #74459
Comments
Bug reported by Antoine Pitrou on the python-committers mailing list. According to Brett Canon, the first failure was: And the regression is related to my commit a5c62a8: bpo-23404. Collecting coverage Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-ewtgqc2r/coverage/setup.py", line 204, in
<module>
main()
File "/tmp/pip-build-ewtgqc2r/coverage/setup.py", line 194, in main
setup(**setup_args)
File "/home/travis/build/python/cpython/Lib/distutils/core.py",
line 148, in setup
dist.run_commands()
File "/home/travis/build/python/cpython/Lib/distutils/dist.py",
line 955, in run_commands
self.run_command(cmd)
File "/home/travis/build/python/cpython/Lib/distutils/dist.py",
line 974, in run_command
cmd_obj.run()
File
"/home/travis/build/python/cpython/venv/lib/python3.7/site-packages/setuptools/command/egg_info.py",
line 279, in run
self.find_sources()
File
"/home/travis/build/python/cpython/venv/lib/python3.7/site-packages/setuptools/command/egg_info.py",
line 306, in find_sources
mm.run()
File
"/home/travis/build/python/cpython/venv/lib/python3.7/site-packages/setuptools/command/egg_info.py",
line 533, in run
self.add_defaults()
File
"/home/travis/build/python/cpython/venv/lib/python3.7/site-packages/setuptools/command/egg_info.py",
line 562, in add_defaults
sdist.add_defaults(self)
File
"/home/travis/build/python/cpython/Lib/distutils/command/sdist.py", line
228, in add_defaults
self._add_defaults_ext()
File
"/home/travis/build/python/cpython/Lib/distutils/command/sdist.py", line
311, in _add_defaults_ext
build_ext = self.get_finalized_command('build_ext')
File "/home/travis/build/python/cpython/Lib/distutils/cmd.py",
line 299, in get_finalized_command
cmd_obj.ensure_finalized()
File "/home/travis/build/python/cpython/Lib/distutils/cmd.py",
line 107, in ensure_finalized
self.finalize_options()
File
"/home/travis/build/python/cpython/Lib/distutils/command/build_ext.py",
line 150, in finalize_options
py_include = sysconfig.get_python_inc()
File
"/home/travis/build/python/cpython/Lib/distutils/sysconfig.py", line
100, in get_python_inc
incdir = os.path.join(_sys_home, get_config_var('AST_H_DIR'))
File "/home/travis/build/python/cpython/Lib/posixpath.py", line
92, in join
genericpath._check_arg_types('join', a, *p)
File "/home/travis/build/python/cpython/Lib/genericpath.py", line
149, in _check_arg_types
(funcname, s.__class__.__name__)) from None
TypeError: join() argument must be str or bytes, not 'NoneType'
�Command "python setup.py egg_info" failed with error code 1 in |
To reproduce the bug, build the master branch of Python and then run: ./python -m venv venv Or just: $ ./venv/bin/python -c 'from distutils import sysconfig; print(sysconfig.get_python_inc())'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/haypo/prog/python/master/Lib/distutils/sysconfig.py", line 100, in get_python_inc
incdir = os.path.join(_sys_home, get_config_var('AST_H_DIR'))
File "/home/haypo/prog/python/master/Lib/posixpath.py", line 92, in join
genericpath._check_arg_types('join', a, *p)
File "/home/haypo/prog/python/master/Lib/genericpath.py", line 149, in _check_arg_types
(funcname, s.__class__.__name__)) from None
TypeError: join() argument must be str or bytes, not 'NoneType' |
Oh, I see. My commit a5c62a8 removed multiple variables from Makefile.pre.in to simplify it, but I didn't notice that some of them (only AST_H_DIR?) were used outside Makefile.pre.in. I completely forgot the evil sysconfig (evil in term of backward compatibility...). I removed the following variables from Makefile.pre.in:
I didn't see the point of the AST_H_DIR variable since its value was hardcoded to "Include" and it was only used to regenerate generated files related to AST. I don't understand why sysconfig chose this specific variable to get the "Include" subdirectory!? I'm writing a fix to replace AST_H_DIR variable with "Include". |
The change to sysconfig *may* be a regression wrt bpo-15366. I'm not in the position to be able to check this possibility, ATM, but it is possible that other things have also changed since this was commited 5 years ago. |
Jeremy Kloth: "I'm not in the position to be able to check this possibility, ATM, but it is possible that other things have also changed since this was commited 5 years ago." I expect that many bugs have been fixed in virtualenv and venv modules, so maybe bpo-15366 was fixed indirectly? It would be nice if you can tests on your side, since I'm not confident in my own tests :-) I modified the build system of Python 2.7, 3.5, 3.6 and master (3.7). So you can pick any of these branches to run your test :-) I'm not sure that the bug affected or can affect Python 2.7. |
The coverage job has been fixed and I'm unable to reproduce bpo-15366 bug (my change doesn't seem to have introduced a regression), so I close the issue. I sent an email to python-dev to warn about this change, so maybe others will double check. @jeremy: please double check my change to make sure that I didn't introduce a regression. |
I reopen the issue since Jeremy posted a new PR. |
Yeah, sorry, I was working (fighting ;) with the new GitHub workflow while you updated the status. |
Ok, I reproduced the bug: cd ~/prog/python/master mkdir ~/build_cpython cd ~/venv => error on missing Python.h |
Can this be closed? |
Can someone please check if the job pass on all branches? If yes, please |
Me: "Can someone please check if the job pass on all branches? If yes, please close the issue." Hum, I don't see the coverage job on my PR anymore. I don't know where it's gone. It seems like this issue is fixed, so I close it. |
#1515 has the "needs backport to 2.7" label, but I'm unable to reproduce the bug on Python 2.7:
AssertionError: Filename /home/vstinner/prog/python/2.7/Lib/os.py does not start with any of these prefixes: ['/usr/local'] So I removed the "needs backport to 2.7" label from the PR. I'm sorry, I don't know if Python 2.7 is affected or not. In case of doubt, I prefer to not backport the change. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: