FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

lib/python3: Upgrade from 3.10.11 to 3.13.14 by RaduAndreiTudorica · Pull Request #25 · unikraft/lib-python3 · GitHub

lib/python3: Upgrade from 3.10.11 to 3.13.14 - #25

Open
RaduAndreiTudorica wants to merge 1 commit into
unikraft:stagingfrom
RaduAndreiTudorica:update-python3-3.13.14
Open

lib/python3: Upgrade from 3.10.11 to 3.13.14#25
RaduAndreiTudorica wants to merge 1 commit into
unikraft:stagingfrom
RaduAndreiTudorica:update-python3-3.13.14

Conversation

Copy link
Copy Markdown

Description of Changes

Upgrades the Python port from 3.10.11 to 3.13.14, the latest maintenance
release of the 3.13 series.

Four of the five patches no longer applied and were rewritten or dropped;
a new one works around a Py_ARRAY_LENGTH use in a static initializer.
Upstream reorganized a number of sources (the tokenizer was split across
Parser/lexer/ and Parser/tokenizer/, the SHA modules were unified,
_sre.c moved into its own directory) and introduced others, including
the new lock and GC implementations and the HACL* hashing sources.

The build also needed a rule to generate the frozen module headers, which
CPython produces during its own build but which the Unikraft build never
triggered, plus a few include paths and defines.

Two pre-existing inconsistencies were fixed along the way: Library.uk
declared 3.7.4 while the port built 3.10.11, and _sysconfigdata.py had
been generated by a 3.7 build.

Tested on qemu/x86_64 with catalog-core/python3-hello: the unikernel
builds, boots and runs hello.py.

Note on checkpatch: the remaining warnings come from the contents of the
.patch files (the original authors' Signed-off-by lines and unified
diff context lines), from the generated _sysconfigdata.py, and from
following the existing style of modules_config.c.

Related Work

Depends on unikraft/unikraft#1877: CPython 3.13 reads _SC_CLK_TCK
during posix module initialization and aborts if it isn't available, so
the interpreter does not start without that fix.

PR Checklist

  • Read the contribution guidelines...
  • Tested your changes against relevant architectures and platforms;
  • Ran the checkpatch.uk on your commit series before opening this PR;
  • Updated relevant documentation.

Bump Python from 3.10.11 to 3.13.14, the latest maintenance release of
the 3.13 series.

Patches:
- Drop patch 0000 (undefine HAVE_FORK/HAVE_EXECVE): the macros no longer
  come from posixmodule.c in 3.13 and the port's own pyconfig.h already
  disables both
- Rewrite patch 0001 (asyncio): 3.13 imports os upstream, only io needs
  to be added
- Rewrite patches 0002 and 0003 (library install): Makefile.pre.in was
  restructured, the compileall invocations were consolidated and the
  libinstall target now depends on all rather than build_all
- Add patch 0005: faulthandler.c uses Py_ARRAY_LENGTH in a static
  initializer, which does not compile as the macro expands to a comma
  expression under C11

Sources:
- Update paths for files reorganized upstream: Parser/tokenizer.c was
  split across Parser/lexer/ and Parser/tokenizer/, Modules/_sre.c moved
  to Modules/_sre/sre.c, the sha256 and sha512 modules were unified into
  sha2module.c, and _sha3/sha3module.c moved to Modules/
- Add the sources introduced in 3.13, including the new lock and garbage
  collection implementations, the split compiler pipeline, and the HACL*
  hashing sources
- Remove sources deleted upstream and the test-only modules

Build configuration:
- Add a UK_PREPARE rule to generate the frozen module headers, which
  CPython produces during its own build
- Add the source root, compiler and HACL* include paths, and define
  PLATLIBDIR for getpath
- Remove the configure-generated pyconfig.h so the port's own header is
  used
- Define HAVE_NETDB_H and HAVE_GETHOSTBYNAME: Unikraft builds with
  -U __linux__, which makes socketmodule.c undefine HAVE_GETHOSTBYNAME_R
  and leave sock_decode_hostname out while it is still referenced

Housekeeping:
- Regenerate _sysconfigdata.py, which was generated for 3.7
- Sync Library.uk, which declared 3.7.4

Tested on qemu/x86_64 with catalog-core/python3-hello: the unikernel
builds, boots and runs hello.py.

Signed-off-by: Radu Andrei Tudorica <raduandreitudorica3@gmail.com>
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL