Skip to content

Fix python site-packages dir - #4413

Open
NTULINUX wants to merge 1 commit into
LinuxCNC:2.9from
NTULINUX:generic-sitepy
Open

Fix python site-packages dir#4413
NTULINUX wants to merge 1 commit into
LinuxCNC:2.9from
NTULINUX:generic-sitepy

Conversation

@NTULINUX

Copy link
Copy Markdown
Contributor

2.9 backport

@grandixximo

Copy link
Copy Markdown
Contributor

CI failure on package-arch (bullseye) is real. Bullseye has python3.9: no deb_system (added in 3.10), no rpm_prefix (Fedora-only), and sysconfig.get_default_scheme() does not exist before 3.10, so the new line raises AttributeError and SITEPY comes out empty. Verified in a bullseye container. Empty SITEPY drops the python tree into $(DESTDIR) root, usr/lib/python3 in debian/linuxcnc.install.in matches nothing, package build fails. Master never hit this; it no longer builds bullseye.

get_default_scheme() is the wrong fallback anyway: it yields site-packages, but Debian pythons without deb_system only import from dist-packages. Suggested fix, works on 3.9+:

SITEPY=`$PYTHON -c "import sysconfig; s=sysconfig.get_scheme_names(); print(next((sysconfig.get_path('platlib', m) for m in ('deb_system', 'rpm_prefix') if m in s), '/usr/lib/python3/dist-packages'))"`

Suggested-by: Luca Toniolo <luca@aitalmac.com>
Signed-off-by: Alec Ari <neotheuser@ymail.com>
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.

2 participants