FS#54887 - [openssl] remove perl from dependency of the openssl package
Attached to Project:
Arch Linux
Opened by Damjan Georgievski (damjan) - Thursday, 20 July 2017, 11:29 GMT
Last edited by Antonio Rojas (arojas) - Saturday, 25 December 2021, 12:27 GMT
Opened by Damjan Georgievski (damjan) - Thursday, 20 July 2017, 11:29 GMT
Last edited by Antonio Rojas (arojas) - Saturday, 25 December 2021, 12:27 GMT
|
Details
the openssl package has a dependency on perl. this makes
even the smallest arch install (containers) needlessly
bloated with perl.
perl is required only for one script "/usr/bin/c_rehash", but c_rehash is not used in Arch (it probably has been used in the past for updating the trust store). The trust policy store nowdays is setup by update-ca-trust from the ca-certificates-utils package, which uses a tool from p11-kit. Also, upstream provides an "openssl rehash" subcommand which they claim is almost the same. a side note: Fedora packages c_rehash in a separate openssl-perl package, which is only required by 2 packages: burp-server and check-create-certificate (not required further). Debian depends on perl for debconf (otherwise c_rehash is in the openssl package, but not in libssl*) ps. new issue opened as suggested by Allan McRae |
This task depends upon
FS#14903, it came up that simply removing the perl dependency from openssl may break some of the >200 other packages which depend on it, if they happen to require Perl but don't directly depend on it. So, I grabbed these lists from the official repo.The following depend on openssl and not perl:
aircrack-ng, apache, archboot, argyllcms, axel, badvpn, bigloo, bind-tools, bip, bitcoin-tx, boinctui, borg, cgit, coreutils, couchdb, cowpatty, dsniff, dspam, easy-rsa, efitools, elinks, encfs, erlang, erlang-nox, erlang200, exim, fdm, fetchmail, fossil, freerdp, freetds, galera, gambas3-gb-openssl, gftp, gnustep-base, gsoap, gwenhywfar, haproxy, hostapd, httping, httrack, iperf3, ipmitool, iputils, keepalived, ldns, lib32-openssl, libarchive, libesmtp, libevent, libexosip2, libircclient, libmariadbclient, libmesode, libperconaserverclient, librabbitmq-c, libsasl, libshairport, libshout, libssh2, libstrophe, libtorrent, libvncserver, libwebsockets, lua-sec, lua51-sec, lua52-sec, lynx, medusa, mktorrent, monit, nghttp2, nginx, nginx-mainline, ngircd, nmap, ntp, open-isns, opendkim, openimageio, openntpd, opensips, openslp, openvswitch, opusfile, p3scan, pam_mount, parity, parrot, partimage, pixiewps, pkcs11-helper, podofo, postgresql-libs, powerdns, powerdns-recursor, prosody, proxytunnel, pulseaudio-zeroconf, pwsafe, pypy, pypy3, python, python-pyopenssl, python2, python2-pyopenssl, radare2, restbed, rkt, ruby, s-nail, sbsigntools, scrypt, shairport-sync, siege, slimjet, slowhttptest, slrn, socat, sofia-sip, ssmtp, stellarium, stunnel, tarantool, tarsnap, tcltls, tcpdump, tcpflow, testdisk, thc-ipv6, thrift, tinc, tnftp, uboot-tools, unshield, vde2, vpnc, w3m, webfs, wimlib, xmlsec, yara, zathura-pdf-mupdf
The following depend on openssl and one or more of the above (given), and not perl:
archboot (a lot of things), bind (bind-tools), curl (libssh2), dovecot (libmariadbclient, postgresql-libs), ejabberd (erlang-nox), esmtp (libesmtp), hydra (libmariadbclient, postgresql-libs), libasr (libevent), libvirt (libsasl, python2), mariadb-clients (libmariadbclient), mongodb (libsasl), mosquitto (libwebsockets), mutt (libsasl), nsd (libevent), ntop (libevent, python2), open-iscsi (open-isns), openssh (ldns), openvpn (pkcs11-helper), ostree (libarchive), poco (libmariadbclient), postfix (libmariadbclient, libsasl, postgresql-libs), postgresql-old-upgrade (postgresql-libs), pyrit (python2), python2-m2crypto (python2), ruby-eventmachine (ruby), sslsplit (libevent), swi-prolog (libarchive), testssl.sh (bind-tools, coreutils), tor (libevent), unbound (libevent), virtualbox (python2), x11vnc (libvncserver)
The following depend on openssl, depend on curl and/or libssh2, and don't depend on perl:
arch-audit, cower, dovecot, ettercap, ettercap-gtk, lastpass-cli, libcurl-compat, libgit2, libvirt, mupdf, strongswan, synergy, unrealircd, virtualbox
Even assuming that Ruby, Python, and their dependents don't use Perl, there's still >150 packages (not counting THEIR dependents) which need to be checked for Perl usage. Alternatively, in what I think is the safest move, annoy their maintainers by moving the perl dependency to each of them.
We need to fix the second one at distro level (by forbidding transient dependencies) before changing openssl deps is doable.
However, not that coreutils for instance is in your above list, and removing this package from a system seems a bad idea. So I’m afraid that your initial goal (avoiding perl) is unreachable.
are you saying that coreutils requires perl (not the package, but actually)?
looking through the /usr/bin/ files from coreutils, I can't see anything using perl as a script or linked to perl.
6473 packages which depend on openssl in one way or another, and
4204 which depend on perl in one way or another (not including via openssl)
There are 3540 packages that depend on openssl but do not otherwise have perl in their dependency tree, list is attached.
Of course this says nothing about whether a package assumes that pacman is installed...
I'm inclined to think, anyway, that assuming core works and we trial things in testing for a bit, this should be doable. In the meantime, I've discovered three packages that link to libperl.so and do not depend on it except through openssl:
irssi
=> /usr/bin/irssi
openldap
=> /usr/lib/slapd
postgresql-old-upgrade
=> /opt/pgsql-10/lib/hstore_plperl.so
=> /opt/pgsql-10/lib/plperl.so
if packages depend on openssl they shouldn't assume perl is installed as well. If they do, that can only be found & fixed by removing perl from the requirements of openssl
please fix this
1. https://github.com/openssl/openssl/pull/10123
(The actual check is dumb as a rock, and simply tries to see if the literal string '\bperl\b' exists with regular expression \b word boundaries.)
Now I'm running the following loop on dragon, which has a full package mirror:
for i in /srv/ftp/pool/*/*.pkg.tar.xz; do if ! bsdtar -xOf "$i" .PKGINFO | grep -qE '^(opt)?depend = .*perl.*'; then bin/detect-perl-in-package.sh "$i" && echo "$i: depends on perl"; fi; done
Let's see what happens. I *think* in theory this should tell us everything (plus false positives, sigh).
it will need to be further filtered...
EDIT: paste link updated to https://paste.xinu.at/PZ3QnT/
Some packages are marked as false positives (occasionally with details), others have recommended guidance, or notes on which files need perl (but it's not always clear if those files are important).
Once those are resolved, we should be able to safely assume everything that uses perl depends on it. At that point, openssl could drop its dep or move it to an optdepends.
- make Perl an optdepends "for the c_rehash script"
- replace the c_rehash script with a tiny shell script that invokes `openssl rehash "$@"`
The latter relies on the fact that openssl-rehash is an identical, modern built-in C implementation of c_rehash.pl
As for splitting the package I looked into what other distros like Fedora or Debian do. I tendo o lean towards a separate package instead of using optdepends as it is more explicit and you do not end up with partly invalid package.
Modern code depending on modern openssl versions should really just be sed'ing all invocations of 'c_rehash' to 'openssl rehash'. I've actually done it for one project (which is partly written in perl either way). I think an optdepends would be plenty fair here. We do it for lots of other scripts.
This change would either way break users, since they would be missing the program if they rely on it.