You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gh-162115: Add tooling to process site packages in an Apple Xcode project. - #162194
Corrects the initial configuration of the Python environment in the iOS testbed:
Uses an explicit PyConfig.module_search_path rather than dynamically appending to site.path in the running interpreter
Pre-processes the third-party dependencies into the standard library site-packages folder, rather than manually appending the app_packages folder onto the site path in the running interpreter
This ensures that all the user-supplied code is on the Python path at the time the interpreter configuration completes. This matters because the start-time configuration is what persists into sub-interpreters; without these changes, code in app and app_packages can't be found in a sub-interpreter without reproducing the path modifications.
It's also a lot simpler, and a lot closer to the "standard desktop" experience in terms of interpreter configuration.
To facilitate the site-packages handling, a new install_site_packages method has been added to the framework utility script. This new script means we can now easily document how to handle a site-packages folder, rather than needing somewhat nebulous descriptions of how to configure a third-party packages folder.
This is all backwards compatible - the historical behaviour was to treat app_packages as a folder that needs post-processing; any code that uses the old setup will continue to work. Projects that opt into using the install_site_packages script will have better site-related behaviour.
This PR also takes the opportunity to factor out the shell script parts of the Xcode project into a standalone shell script file. Defining the script inline works, but it can be difficult to debug due to the need for double escaping.
Marked for backport to 3.14 and 3.15 because the testbed project is used by cibuildwheel (and others), and subinterpreter tests fail without these changes.
Summary of the results of the build (if available):
Click to see traceback logs
Note: switching to '846acf18ca5ed8e5805a5d7d89d76217a77e9828'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 846acf18ca5ed gh-162115: Add tooling to process site packages in an Apple Xcode project. (#162194)
Switched to and reset branch 'main'
find: ‘build’: No such file or directoryfind: ‘build’: No such file or directoryfind: ‘build’: No such file or directoryfind: ‘build’: No such file or directorymake[2]: [Makefile:3565: clean-retain-profile] Error 1 (ignored)
In function ‘type_set_bases_unlocked’,
inlined from ‘type_set_bases’ at Objects/typeobject.c:2058:11:
Objects/typeobject.c:1965:9: warning: ‘best_base’ may be used uninitialized [-Wmaybe-uninitialized]
1965 | raise_new_bases_error(check, best_base, old_base);
|^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Objects/typeobject.c: In function ‘type_set_bases’:
Objects/typeobject.c:1948:19: note: ‘best_base’ declared here
1948 | PyTypeObject *best_base;
|^~~~~~~~~
In function ‘type_set_bases_unlocked’,
inlined from ‘type_set_bases’ at Objects/typeobject.c:2058:11:
Objects/typeobject.c:1965:9: warning: ‘best_base’ may be used uninitialized [-Wmaybe-uninitialized]
1965 | raise_new_bases_error(check, best_base, old_base);
|^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Objects/typeobject.c: In function ‘type_set_bases’:
Objects/typeobject.c:1948:19: note: ‘best_base’ declared here
1948 | PyTypeObject *best_base;
|^~~~~~~~~
Assembler messages:
Fatal error: can't create Modules/_testlimitedcapi/long.o: No space left on device
make[2]: *** [Makefile:3992: Modules/_testlimitedcapi/long.o] Error 1make[2]: *** Waiting for unfinished jobs..../tmp/cc25Btpk.s: Assembler messages:/tmp/cc25Btpk.s: Fatal error: can't write 3928 bytes to section .debug_info of Modules/_tkinter.o: 'No space left on device'/tmp/cc25Btpk.s: Fatal error: Modules/_tkinter.o: No such file or directorymake[2]: *** [Makefile:3914: Modules/_tkinter.o] Error 1/tmp/ccDSEvqQ.s: Assembler messages:/tmp/ccDSEvqQ.s: Fatal error: Modules/_testcapi/pyatomic.o: No space left on devicemake[2]: *** [Makefile:3957: Modules/_testcapi/pyatomic.o] Error 1./Modules/socketmodule.c: In function ‘getsockaddrarg’:
./Modules/socketmodule.c:2643:9: warning: ‘strncpy’ specified bound 64 equals destination size [-Wstringop-truncation]
2643 | strncpy((char *)sa->salg_name, name, sizeof(sa->salg_name));
|^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/tmp/ccEqjlqM.s: Assembler messages:/tmp/ccEqjlqM.s: Fatal error: can't write 3927 bytes to section .gnu.debuglto_.debug_info of Modules/_testinternalcapi.o: 'No space left on device'/tmp/ccEqjlqM.s: Fatal error: Modules/_testinternalcapi.o: No such file or directorymake[2]: *** [Makefile:3924: Modules/_testinternalcapi.o] Error 1/tmp/ccAJ8Dkw.s: Assembler messages:/tmp/ccAJ8Dkw.s: Fatal error: can't write 681 bytes to section .gnu.lto__make_call_from_thread.28.ec4a0c5456cd65d2 of Modules/_testcapimodule.o: 'No space left on device'/tmp/ccAJ8Dkw.s: Fatal error: Modules/_testcapimodule.o: No such file or directorymake[2]: *** [Makefile:3935: Modules/_testcapimodule.o] Error 1
Assembler messages:
Fatal error: can't create Modules/expat/xmlparse.o: No space left on device
make[2]: *** [Makefile:1682: Modules/expat/xmlparse.o] Error 1/usr/bin/ld.bfd: final link failed: No space left on devicecollect2: error: ld returned 1 exit statusmake[2]: *** [Makefile:3782: Modules/_random.cpython-316-aarch64-linux-gnu.so] Error 1/usr/bin/ld.bfd: final link failed: No space left on devicecollect2: error: ld returned 1 exit statusmake[2]: *** [Makefile:3776: Modules/_math_integer.cpython-316-aarch64-linux-gnu.so] Error 1/usr/bin/ld.bfd: final link failed: No space left on devicecollect2: error: ld returned 1 exit statusmake[2]: *** [Makefile:3774: Modules/_lsprof.cpython-316-aarch64-linux-gnu.so] Error 1
Assembler messages:
Fatal error: can't create Modules/socketmodule.o: No space left on device
make[2]: *** [Makefile:3877: Modules/socketmodule.o] Error 1/usr/bin/ld.bfd: final link failed: No space left on devicecollect2: error: ld returned 1 exit statusmake[2]: *** [Makefile:3767: Modules/_csv.cpython-316-aarch64-linux-gnu.so] Error 1
Assembler messages:
Fatal error: can't create Modules/_ctypes/_ctypes.o: No space left on device
make[2]: *** [Makefile:3888: Modules/_ctypes/_ctypes.o] Error 1
Assembler messages:
Fatal error: can't create Modules/expat/xmltok.o: No space left on device
make[2]: *** [Makefile:1688: Modules/expat/xmltok.o] Error 1/usr/bin/ld.bfd: final link failed: No space left on devicecollect2: error: ld returned 1 exit statusmake[2]: *** [Makefile:3763: Modules/array.cpython-316-aarch64-linux-gnu.so] Error 1
Assembler messages:
Fatal error: can't create Programs/_testembed.o: No space left on device
make[2]: *** [Makefile:2142: Programs/_testembed.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_ssl.o: No space left on device
make[2]: *** [Makefile:3908: Modules/_ssl.o] Error 1/usr/bin/ld.bfd: final link failed: No space left on devicecollect2: error: ld returned 1 exit statusmake[2]: *** [Makefile:3778: Modules/_pickle.cpython-316-aarch64-linux-gnu.so] Error 1/usr/bin/ld.bfd: final link failed: No space left on devicecollect2: error: ld returned 1 exit statusmake[2]: *** [Makefile:3771: Modules/_json.cpython-316-aarch64-linux-gnu.so] Error 1
Assembler messages:
Fatal error: can't create Modules/_sre/sre.o: No space left on device
make[2]: *** [Makefile:4061: Modules/_sre/sre.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_testclinic.o: No space left on device
make[2]: *** [Makefile:4011: Modules/_testclinic.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_decimal/_decimal.o: No space left on device
make[2]: *** [Makefile:3812: Modules/_decimal/_decimal.o] Error 1/usr/bin/ld.bfd: final link failed: No space left on devicecollect2: error: ld returned 1 exit statusmake[2]: *** [Makefile:3795: Modules/_remote_debugging.cpython-316-aarch64-linux-gnu.so] Error 1
Assembler messages:
Fatal error: can't create Modules/_cursesmodule.o: No space left on device
make[2]: *** [Makefile:3894: Modules/_cursesmodule.o] Error 1
Assembler messages:
Fatal error: can't create Objects/unicodeobject.o: No space left on device
make[2]: *** [Makefile:3471: Objects/unicodeobject.o] Error 1
Assembler messages:
Fatal error: can't create Python/Python-ast.o: No space left on device
make[2]: *** [Makefile:3471: Python/Python-ast.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_testlimitedcapi/unicode.o: No space left on device
make[2]: *** [Makefile:4001: Modules/_testlimitedcapi/unicode.o] Error 1
Assembler messages:
Fatal error: can't create Python/ceval.o: No space left on device
make[2]: *** [Makefile:3481: Python/ceval.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_testinternalcapi/interpreter.o: No space left on device
make[2]: *** [Makefile:3930: Modules/_testinternalcapi/interpreter.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_ctypes/_ctypes_test.o: No space left on device
make[2]: *** [Makefile:4021: Modules/_ctypes/_ctypes_test.o] Error 1make[1]: *** [Makefile:1038: profile-gen-stamp] Error 2make: *** [Makefile:1050: profile-run-stamp] Error 2
Summary of the results of the build (if available):
Click to see traceback logs
Note: switching to '846acf18ca5ed8e5805a5d7d89d76217a77e9828'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 846acf18ca5e gh-162115: Add tooling to process site packages in an Apple Xcode project. (#162194)
Switched to and reset branch 'main'
In function ‘bytearray_resize_storage’,
inlined from ‘bytearray_resize_unchecked’ at Objects/bytearrayobject.c:333:9,
inlined from ‘bytearray_resize_lock_held’ at Objects/bytearrayobject.c:366:12,
inlined from ‘bytearray_append_impl’ at Objects/bytearrayobject.c:2223:9,
inlined from ‘bytearray_append’ at Objects/clinic/bytearrayobject.c.h:1413:20:
Objects/bytearrayobject.c:259:13: warning: ‘memmove’ specified bound 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
259 | memmove(self->ob_bytes + moved, old_start + moved, remaining);
|^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Assembler messages:
Fatal error: can't create Modules/getpath_noop.o: No space left on device
make: *** [Makefile:3471: Modules/getpath_noop.o] Error 1make: *** Waiting for unfinished jobs....
Assembler messages:
Fatal error: can't create Modules/pwdmodule.o: No space left on device
make: *** [Makefile:4089: Modules/pwdmodule.o] Error 1
Assembler messages:
Fatal error: can't create Modules/config_bootstrap.o: No space left on device
make: *** [Makefile:3471: Modules/config_bootstrap.o] Error 1
Assembler messages:
Fatal error: can't create Modules/symtablemodule.o: No space left on device
Assembler messages:
Fatal error: can't create Programs/_freeze_module.o: No space left on device
make: *** [Makefile:4087: Modules/symtablemodule.o] Error 1make: *** [Makefile:3471: Programs/_freeze_module.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_stat.o: No space left on device
make: *** [Makefile:4085: Modules/_stat.o] Error 1/tmp/cc5tKdGk.s: Assembler messages:/tmp/cc5tKdGk.s: Fatal error: can't write 3927 bytes to section .gnu.debuglto_.debug_str of Objects/bytesobject.o: 'No space left on device'/tmp/cc5tKdGk.s: Fatal error: Objects/bytesobject.o: No such file or directorymake: *** [Makefile:3471: Objects/bytesobject.o] Error 1
Assembler messages:
Fatal error: can't create Modules/timemodule.o: No space left on device
make: *** [Makefile:4067: Modules/timemodule.o] Error 1
Assembler messages:
Fatal error: can't create Objects/longobject.o: No space left on device
make: *** [Makefile:3471: Objects/longobject.o] Error 1
Assembler messages:
Fatal error: can't create Python/symtable.o: No space left on device
make: *** [Makefile:3471: Python/symtable.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_localemodule.o: No space left on device
make: *** [Makefile:4079: Modules/_localemodule.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_opcode.o: No space left on device
make: *** [Makefile:4081: Modules/_opcode.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_threadmodule.o: No space left on device
make: *** [Makefile:4065: Modules/_threadmodule.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_io/bufferedio.o: No space left on device
make: *** [Makefile:4055: Modules/_io/bufferedio.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_collectionsmodule.o: No space left on device
make: *** [Makefile:4047: Modules/_collectionsmodule.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_asynciomodule.o: No space left on device
make: *** [Makefile:4029: Modules/_asynciomodule.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_functoolsmodule.o: No space left on device
make: *** [Makefile:4077: Modules/_functoolsmodule.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_abc.o: No space left on device
make: *** [Makefile:4075: Modules/_abc.o] Error 1
Assembler messages:
Fatal error: can't create Python/dtoa.o: No space left on device
make: *** [Makefile:3478: Python/dtoa.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_operator.o: No space left on device
make: *** [Makefile:4083: Modules/_operator.o] Error 1
Assembler messages:
Fatal error: can't create Parser/parser.o: No space left on device
make: *** [Makefile:3471: Parser/parser.o] Error 1
Assembler messages:
Fatal error: can't create Python/codegen.o: No space left on device
make: *** [Makefile:3471: Python/codegen.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_io/textio.o: No space left on device
make: *** [Makefile:4056: Modules/_io/textio.o] Error 1
Assembler messages:
Fatal error: can't create Modules/itertoolsmodule.o: No space left on device
make: *** [Makefile:4059: Modules/itertoolsmodule.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_datetimemodule.o: No space left on device
make: *** [Makefile:4043: Modules/_datetimemodule.o] Error 1
Assembler messages:
Fatal error: can't create Objects/obmalloc.o: No space left on device
make: *** [Makefile:3471: Objects/obmalloc.o] Error 1
Assembler messages:
Fatal error: can't create Modules/posixmodule.o: No space left on device
make: *** [Makefile:4035: Modules/posixmodule.o] Error 1
Assembler messages:
Fatal error: can't create Objects/typeobject.o: No space left on device
make: *** [Makefile:3471: Objects/typeobject.o] Error 1
Assembler messages:
Fatal error: can't create Python/Python-ast.o: No space left on device
make: *** [Makefile:3471: Python/Python-ast.o] Error 1
Assembler messages:
Fatal error: can't create Modules/_sre/sre.o: No space left on device
make: *** [Makefile:4061: Modules/_sre/sre.o] Error 1
Assembler messages:
Fatal error: can't create Python/ceval.o: No space left on device
make: *** [Makefile:3481: Python/ceval.o] Error 1
Assembler messages:
Fatal error: can't create Objects/unicodeobject.o: No space left on device
make: *** [Makefile:3471: Objects/unicodeobject.o] Error 1find: ‘build’: No such file or directoryfind: ‘build’: No such file or directoryfind: ‘build’: No such file or directoryfind: ‘build’: No such file or directorymake: [Makefile:3565: clean-retain-profile] Error 1 (ignored)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Corrects the initial configuration of the Python environment in the iOS testbed:
PyConfig.module_search_pathrather than dynamically appending tosite.pathin the running interpretersite-packagesfolder, rather than manually appending theapp_packagesfolder onto the site path in the running interpreterThis ensures that all the user-supplied code is on the Python path at the time the interpreter configuration completes. This matters because the start-time configuration is what persists into sub-interpreters; without these changes, code in
appandapp_packagescan't be found in a sub-interpreter without reproducing the path modifications.It's also a lot simpler, and a lot closer to the "standard desktop" experience in terms of interpreter configuration.
To facilitate the
site-packageshandling, a newinstall_site_packagesmethod has been added to the framework utility script. This new script means we can now easily document how to handle a site-packages folder, rather than needing somewhat nebulous descriptions of how to configure a third-party packages folder.This is all backwards compatible - the historical behaviour was to treat
app_packagesas a folder that needs post-processing; any code that uses the old setup will continue to work. Projects that opt into using theinstall_site_packagesscript will have better site-related behaviour.This PR also takes the opportunity to factor out the shell script parts of the Xcode project into a standalone shell script file. Defining the script inline works, but it can be difficult to debug due to the need for double escaping.
Marked for backport to 3.14 and 3.15 because the testbed project is used by cibuildwheel (and others), and subinterpreter tests fail without these changes.