# Making the default CPython build more relocatable

**URL:** <https://discuss.python.org/t/making-the-default-cpython-build-more-relocatable/109937>\
**Category:** Core Development\
**Created:** [November 8, 2026, 6:11am UTC](https://discuss.python.org/t/making-the-default-cpython-build-more-relocatable/109937 "2026-11-08T06:11:36Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![eschwartz](https://avatars.discourse-cdn.com/v4/letter/e/a9a28c/32.png) [@eschwartz](https://discuss.python.org/u/eschwartz)\
**Post date:** [November 9, 2026, 2:29am UTC](https://discuss.python.org/t/making-the-default-cpython-build-more-relocatable/109937/4 "2026-11-09T02:29:06Z")

</div>

> 1. Writing `prefix=${pcfiledir}/../..` instead of the absolute prefix in the installed `python-3.16.pc` and `python-3.16-embed.pc` ([draft impl](https://github.com/itamaro/cpython/pull/64)). Both pkg-config and pkgconf support `pcfiledir`, and this is how Conda and Homebrew ship their `.pc` files.
> 
> These changes are _visible_ to anyone who looks at the installed files, but nothing should break for users of the default build. We’d rather avoid adding a new dimension (relocatability on/off) to the already large CI and buildbots test matrix. A flag would also mean two layouts for consumers to deal with, and the relocatable one would be the less tested one.

I would like to caution that ${pcfiledir}/../../ for cases where it  
canonicalizes to /usr, is an actual issue. The `pkg-config` tool will  
get confused and stop deduplicating system directories, and you can get  
some fairly weird results.

e.g. Meson has a global option for this (it is automatically available  
for all packages that ship pkg-config files):

> **[Pkgconfig module - Built-in options](https://mesonbuild.com/Builtin-options.html#pkgconfig-module)**
>
> Meson provides two kinds of options: build options provided by the build files and built-in options that are either universal options, base options, compiler options.

Users can ask for a relocatable build (and perhaps you’d only test that  
mode in CI), but users who don’t need them and aren’t planning to  
relocate them, for example Linux distros packaging the software for  
installation into /usr, can still choose to get artifacts which play  
nice with installation into the system directories.

A flag to change the pkgconfig file does not necessarily imply a flag to  
change the way the interpreter is compiled and installed.

---

_[View the full topic](https://discuss.python.org/t/making-the-default-cpython-build-more-relocatable/109937)._
