ciimage: fix pathological brokenness in Debian packaging of python

In this case, PEP 668 was created to allow a thing that Debian wanted,
which is for `pip install foobar` to not break the system python. This
despite the fact that the system python is fine, unless you use sudo pip
which is discouraged for separate reasons, and it is in fact quite
natural to install additional packages to the user site-packages.

It isn't even the job of the operating system to decide whether the user
site-packages is broken, whether the operating system gets the answer
correct or not -- it is the job of the operating system to decide
whether the operating system is broken, and that can be solved by e.g.
enforcing a shebang policy for distribution-packaged software, which
distros like Fedora do, and mandating not only that python shebangs do
not contain `/usr/bin/env`, but that they *do* contain -s.

Anyway, this entire kerfuffle is mostly just a bit of pointless
interactive churn, but it bites pretty hard for our use case, which is a
container image which is fortunately tested before deployment, so
instead of failing to deploy because of theoretical conflicts with the
base system (we specifically need base system integration...) we fail to
deploy because 5 minutes into pulling apt updates at the very beginning,
pip refuses point-blank to work. I especially do not know why it is the
job of the operating system to throw errors intended for interactive
users at people baking "appliance" containers who cannot "break" the
system python anyway.

Fix this by doing what Debian and Ubuntu should both have done from the
beginning, and opting containers out of this questionable feature
entirely.

Note that CI images may still not actually complete their build/test
cycle and be updated, because e.g. LLVM 16 issues tracked by #11642 or
glib ASAN issues tracked by #11754.
pull/11825/head
Eli Schwartz 2 years ago
parent f71ca2825c
commit 5c479d7a13
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 2
      ci/ciimage/common.sh

@ -39,9 +39,11 @@ dub_fetch() {
}
install_minimal_python_packages() {
rm -f /usr/lib/python3.*/EXTERNALLY-MANAGED
python3 -m pip install "${base_python_pkgs[@]}" $*
}
install_python_packages() {
rm -f /usr/lib/python3.*/EXTERNALLY-MANAGED
python3 -m pip install "${base_python_pkgs[@]}" "${python_pkgs[@]}" $*
}

Loading…
Cancel
Save