Open tpgxyz opened 5 years ago
I don't think we should do this at all. But if we want to do something like this, I'd rather do sysroot-style instead.
That is:
/usr/<target>/{sbin,bin,lib,lib32,lib64,libexec}
/usr/host
-> /usr/<target>
/usr/host-secondary
-> /usr/<secondary-target>
(e.g. multiarch i686-openmandriva-linux-gnu
on x86_64-openmandriva-linux-gnu
)/usr/bin
-> /usr/host/bin
/usr/sbin
-> /usr/host/sbin
/usr/lib
-> /usr/host/lib
/usr/lib32
-> /usr/host-secondary/lib32
/usr/lib64
-> /usr/host/lib64
/usr/libexec
-> /usr/host/libexec
But doing this (or the Debian-style multiarch layout) will require changes to RPM to handle these kinds of co-installation capabilities... I'd previously explored this in the past and was working on a PR to rpm to handle elfdeps properly in this situation, which needs to be finished: https://github.com/rpm-software-management/rpm/pull/360
I'd actually like to see us at least empty out /usr/lib
and move 32-bit libraries to /usr/lib32
, but I don't know what the compatibility issues will be in doing so.
@tpgxyz @berolinux Note that any change will require us to implement OpenMandrivaAssociation/OpenMandrivaAssociation.github.io#12 first, because there are many things that need to be fixed as part of any variant of this, and OpenMandrivaAssociation/OpenMandrivaAssociation.github.io#12 will make this much easier.
Also note that Debian-style multi-arch breaks binary compatibility for 32-bit libraries, because you can't symlink /usr/lib/i686-linux-gnu
to /usr/lib
. So that whole thing just breaks.
Again, in general, I think we should not do this.
I agree that a sysroot-ish setup is better, because we can symlink /usr/i686-linux-gnu/lib to /usr/lib.
I think we should do this -- or alternatively find a better way to achieve the same (one need: Install x86_64 and i686 binary libraries on arm boxes so with qemu-binfmt set up, stuff like steam and wine can run -- probably too slow for a lot of things, but an impressive demo and possibly a good solution for someone who has that one binary-only Windows application without lots of CPU needs (let's say a bookkeeping app) thing holding back the switch to an Arm Linux box).
I currently don't see any better way of doing it.
I think if we shipped Mock configs for OpenMandriva, we could do some creative things using mock
to set up secure environments that emulate x86 systems.
As mock supports using qemu-user-static
for emulating foreign environments, combining that with nspawn would allow for pretty secure environments that "look" like the target environment. That's a lot less likely to be brittle, and you can have the advantage of cheaply respawning them. We can do creative things using Btrfs or thinp LVM to reduce the amount of space taken up by each spawned instance running programs.
This would also give us native packaged stuff + containerization/sandboxing, which IMO is better for those weird Windows apps anyway. Who really wants to trust them to execute freely?
Another idea: podman can run foreign architecture OCI ("Docker") containers when qemu-user-static
is installed and configured correctly (in the same way that Mock can). So we can leverage toolbox with some cleverness to make foreign arch stuff work pretty well smoothly and quickly.
This would require us to start publishing multi-arch container images to a registry that supports this properly, like Quay.io.
Change the filesystem layout for multilib. Some distributions have started going for stuff like /usr/x86_64-linux-gnu/lib instead of /usr/lib64, /usr/i686-linux-gnu/lib instead of /usr/lib etc., and that's a really good idea because it allows installing compat libraries for more than just one 64bit and one 32bit architecture. This is useful especially now that qemu binfmt-misc stuff is working well and transparently launches stuff built for other architectures (think wine on ARM being able to run x86 Windows binaries because it has access to qemu and i686/x86_64 libraries). With the current lib64/lib FS layout, e.g. a user on aarch64 may want to install an x86_64 libjpeg to please whatever binary-only application and an i686 libjpeg to please wine -- but they can't go to /usr/lib64 (where aarch64 stuff lives) nor /usr/lib (where armv7hnl stuff lives). We don't have to break compatibility with anything to do this -- /usr/lib64 and /usr/lib could be symlinks to the native 64 and 32 bit arches, so stuff hardcoding /usr/lib64 or /usr/lib would still find what it's looking for and install to the right place.