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
Commit 38ef21a
Browse filesBrowse the repository at this point in the historyBrowse files
Build stdlib dependencies with relocatable.py deps (#40)
On macOS without third-party dependencies installed, CPython omits `_ssl`, `_hashlib`, `_lzma`, `_zstd` and `_decimal`, leaving gaps in the relocatability checks.
This adds `relocatable.py deps` to download, verify and build static OpenSSL, XZ, zstd and mpdecimal libraries, and `configure --deps-dir` to build CPython against them:
```sh
../prebuilt-cpython/relocatable.py deps
../prebuilt-cpython/relocatable.py configure --deps-dir deps
```
Dependencies are installed under `deps/install`; already-built versions are reused. Sources come from tags of python/cpython-source-deps, as in the Windows build.
Tested on macOS 14 arm64 against CPython `main`: all five modules build and link only against `libSystem`. All `stdlib.*` checks run, extension coverage increases from 57 to 62 modules, and the existing failures are unchanged.
OpenSSL still embeds paths under `deps/install` for configuration, certificates and provider modules. Detecting those dependencies after relocation remains follow-up work.
Copy file name to clipboardExpand all lines: README.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,15 @@ It's broken up into subcommands to configure, make, gather, and test a relocatab
36
36
37
37
The defaults will result in builddir/ containing the build and dist/ containing the files that comprise a relocatable build.
38
38
39
+
Some stdlib extension modules need third-party libraries that macOS doesn't provide, so without a package manager, `_ssl`, `_hashlib`, `_lzma`, `_zstd` and `_decimal` aren't built. To build those libraries (OpenSSL, XZ, zstd and mpdecimal) from source, run `deps` first and pass its directory to `configure`:
`deps` downloads each source archive from [cpython-source-deps](https://github.com/python/cpython-source-deps), checks it, and installs only static libraries into deps/install, so the extension modules don't link against anything outside the installation. OpenSSL still has compiled-in paths for its configuration and modules under deps/install. Use `--deps-dir DIR` to put them somewhere else.
47
+
39
48
The key thing to note is which patching approach to specify with `relocatable.py gather`. There are:
40
49
41
50
-`--patch` which rewrites all found paths of the placeholder `--prefix` argument to the target install directory (which defaults to dist/); this is meant to follow the approach used by conda.
0 commit comments