Skip to content
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

gh-93939: Build C extensions without setup.py #94474

Merged
merged 4 commits into from
Jul 14, 2022

Conversation

tiran
Copy link
Member

@tiran tiran commented Jul 1, 2022

Combines GH-93940, GH-94452, and GH-94433

Automerge-Triggered-By: GH:tiran

@tiran tiran force-pushed the gh-93939-setup-stdlib-all branch 3 times, most recently from 1a3a959 to af65a4c Compare July 6, 2022 11:58
@tiran tiran changed the title gh-93939: [PoC] Build Python without setup.py gh-93939: Build C extensions without setup.py Jul 6, 2022
@tiran tiran added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 6, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @tiran for commit 1469caf9703e411b73a00169a6bf0c5e688f5e72 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 6, 2022
@tiran tiran force-pushed the gh-93939-setup-stdlib-all branch from 1469caf to 68b3032 Compare July 7, 2022 11:00
@tiran tiran marked this pull request as ready for review July 7, 2022 13:10
@tiran tiran added 🔨 test-with-buildbots Test PR w/ buildbots; report in status section build The build process and cross-build and removed DO-NOT-MERGE labels Jul 7, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @tiran for commit 68b3032229ee0185f029772e5e43f72cbb4b402d 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 7, 2022
@tiran tiran force-pushed the gh-93939-setup-stdlib-all branch from 68b3032 to 11701ba Compare July 8, 2022 09:55
@merwok
Copy link
Member

merwok commented Jul 8, 2022

Is there a need for force pushes? Github notifications lead to nothing, which is a little annoying.

@pradyunsg
Copy link
Member

FWIW, You can click on "force-pushed" in the event about the force push, to see what changed between the two force-pushes.

Submitting feedback to GitHub to have the notifications for force-pushed go to that, instead of "oh, I can't show you what changed" may help make GitHub prioritze fixing that higher.

@tiran
Copy link
Member Author

tiran commented Jul 8, 2022

I only force push to rebase. It is the easiest and fastest way for me to resolve merge conflicts. The PR has frequent conflicts, even right now.

@tiran
Copy link
Member Author

tiran commented Jul 8, 2022

image

@tiran tiran force-pushed the gh-93939-setup-stdlib-all branch 2 times, most recently from 40e1554 to 87f243d Compare July 9, 2022 11:19
@tiran tiran added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 9, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @tiran for commit 87f243d764d4909388aed35e59f177d598c096ca 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 9, 2022
@tiran
Copy link
Member Author

tiran commented Jul 12, 2022

setup.py's check_extension_import feature is now provided by a script. Here is an example output with tk-dev missing and a modified _sqlite that is missing _sqlite/util.c dependency.

[ERROR] _sqlite3 failed to import: build/lib.linux-x86_64-3.12/_sqlite3.cpython-312-x86_64-linux-gnu.so: undefined symbol: _pysqlite_seterror

The necessary bits to build these optional modules were not found:
_tkinter                                                       
To find the necessary bits, look in configure.ac and config.log.

Following modules built successfully but were removed because they could not be imported:
_sqlite3                                                       

Checked 109 modules (30 built-in, 76 shared, 1 n/a on linux-x86_64, 0 disabled, 1 missing, 1 failed on import)

validate_tzpath is performed by configure.ac

xxsubtype is now an optional extension. It is skipped when Python is built without test C extension modules.

@miss-islington
Copy link
Contributor

Sorry, I can't merge this PR. Reason: Base branch was modified. Review and try the merge again..

@miss-islington miss-islington merged commit 81dca70 into python:main Jul 14, 2022
@tiran tiran deleted the gh-93939-setup-stdlib-all branch July 14, 2022 07:52
@tiran
Copy link
Member Author

tiran commented Jul 14, 2022

#94848 addresses the build issue with LTO + pydebug.

@vstinner
Copy link
Member

vstinner commented Aug 3, 2022

My little precious setup.py... YOU WILL NEVER BE FORGOTTEN 😭😭😭

_bootsubprocess.py (that I wrote)... I hate you, I'm glad that you're dead! If I recall correctly, I had to write _bootsubprocess to use the clean subprocess module, rather than naive fork+exec code, in distutils. distutils... I also hate you by the way.

@ayappanec
Copy link
Contributor

This broke the AIX build with the below error.

./python -E -S -m sysconfig --generate-posix-vars ;
if test $? -ne 0 ; then
echo "generate-posix-vars failed" ;
rm -f ./pybuilddir.txt ;
exit 1 ;
fi

Traceback (most recent call last):
File "/home/buildusr/cpython_master/cpython/Lib/_aix_support.py", line 7, in
import subprocess
File "/home/buildusr/cpython_master/cpython/Lib/subprocess.py", line 104, in
from _posixsubprocess import fork_exec as _fork_exec
ModuleNotFoundError: No module named '_posixsubprocess'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/home/buildusr/cpython_master/cpython/Lib/sysconfig.py", line 851, in
_main()
File "/home/buildusr/cpython_master/cpython/Lib/sysconfig.py", line 839, in _main
_generate_posix_vars()
File "/home/buildusr/cpython_master/cpython/Lib/sysconfig.py", line 511, in _generate_posix_vars
pybuilddir = f'build/lib.{get_platform()}-{_PY_VERSION_SHORT}'
^^^^^^^^^^^^^^
File "/home/buildusr/cpython_master/cpython/Lib/sysconfig.py", line 781, in get_platform
from _aix_support import aix_platform
File "/home/buildusr/cpython_master/cpython/Lib/_aix_support.py", line 11, in
import _bootsubprocess as subprocess
ModuleNotFoundError: No module named '_bootsubprocess'
generate-posix-vars failed
gmake: *** [Makefile:871: pybuilddir.txt] Error 1
gmake: *** Waiting for unfinished jobs....

@tiran
Copy link
Member Author

tiran commented Aug 26, 2022

Please open a new bug for the problem.

@hroncok
Copy link
Contributor

hroncok commented Oct 26, 2022

I found a regression, reported as #98707

@haampie
Copy link
Contributor

haampie commented Jan 13, 2023

Thanks for doing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet