Skip to content

Commit

Permalink
Add workaround for Fedora's rpm_prefix distribution patch (#510)
Browse files Browse the repository at this point in the history
Similar to what Debian did when Ubuntu Jammy shipped, Fedora has patched
CPython to override the installation directory for Python packages,
presumably to avoid collision with the system-packaged Python modules.

Fedora's approach is slightly different, but can be patched around in a
similar way.
  • Loading branch information
cottsay committed Jun 19, 2022
1 parent 2aafd6f commit e65ae4d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions colcon_core/python_install_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,11 @@ def get_python_install_path(name, vars_=()):
if 'deb_system' in sysconfig.get_scheme_names() or \
'osx_framework_library' in sysconfig.get_scheme_names():
kwargs['scheme'] = 'posix_prefix'
# The presence of the rpm_prefix scheme indicates that posix_prefix
# has been patched to inject `local` into the installation locations.
# The rpm_prefix scheme is a backup of what posix_prefix was before it was
# patched.
elif 'rpm_prefix' in sysconfig.get_scheme_names():
kwargs['scheme'] = 'rpm_prefix'

return Path(sysconfig.get_path(name, **kwargs))

0 comments on commit e65ae4d

Please sign in to comment.