Skip to content

Commit 69d3ddd

Browse files
itamaroclaude
andauthored
relocatable.py configure: pass --enable-relocatable (#50)
CPython is gaining an --enable-relocatable configure option (python/cpython#162185) for build changes that help an installation survive a move but aren't right for every build. So far it makes the installed pkg-config files take their prefix from their own location, which is what the developer.pkg-config check needs. A CPython without the option warns about it and carries on. Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
1 parent 856cf28 commit 69d3ddd

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Some stdlib extension modules need third-party libraries that macOS doesn't prov
4545

4646
`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.
4747

48-
`configure` uses a placeholder `--prefix`. `gather` runs CPython's top-level `make install ENSUREPIP=no` into a staging `DESTDIR` and moves the installed prefix into place, so the gathered tree contains everything a normal install provides (such as `build-details.json` and the unversioned `python3` links). The tree still has the placeholder in it, so it isn't tied to a location and can be packed up as is.
48+
`configure` uses a placeholder `--prefix` and passes `--enable-relocatable`, CPython's opt-in for build changes that help an installation survive a move but aren't right for every build. So far it makes the installed pkg-config files take their prefix from their own location. A CPython without the option warns about it and carries on. `gather` runs CPython's top-level `make install ENSUREPIP=no` into a staging `DESTDIR` and moves the installed prefix into place, so the gathered tree contains everything a normal install provides (such as `build-details.json` and the unversioned `python3` links). The tree still has the placeholder in it, so it isn't tied to a location and can be packed up as is.
4949

5050
Replacing the placeholder is a separate step, done at install time. Once the tree is where it will live, run `fixup.py` on it with any Python 3.12+ other than the one in the tree:
5151

‎relocatable.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ def run_configure(
251251
configure,
252252
f"--prefix={placeholder_prefix()}",
253253
"--without-static-libpython",
254+
"--enable-relocatable",
254255
]
255256
env = None
256257
if deps_dir is not None:

0 commit comments

Comments
 (0)