]> git.donarmstrong.com Git - debian-ctte.git/blob - 914897_merged_usr/ballot.md
4ce32e2213cbec85c2302ab8f5dce4548f5ba23a
[debian-ctte.git] / 914897_merged_usr / ballot.md
1 # #914897: tech-ctte: Should debootstrap disable merged `/usr` by default?
2
3 === DRAFT Resolution ===
4
5 ## What is "merged `/usr`"
6
7 "Merged `/usr`" describes a possible future standard directories scheme in which the `/{bin,sbin,lib}/` directories have been made superfluous, either through replacing them by symlinks to their `/usr` equivalents (/usr/{bin,sbin,lib}) or by removing them entirely.
8 The motivation to get Debian systems to converge towards such a scheme is vastly documented elsewhere ([FDO's TheCaseForTheUsrMerge][0], [wiki.d.o UsrMerge][1]) but can be summarized as the following points:
9
10 * having separate `/` and `/usr` filesystems has been useful in the past for booting without initramfs onto a minimal root filesystem that carried just enough to mount the `/usr` filesystem later in the boot process. Given the evolution of physical hosts' capabilities, initramfs'es have been default in Debian (and elsewhere) for a long time, and most systems no longer have an intermediate state during boot in which they have only `/`, but not `/usr`, mounted.
11 * another use-case is to be able to share an identical `/usr` over a network link; hence booting an initramfs, mounting a local `/`, then mounting `/usr` over the network. It seems that an initramfs with everything needed to mount a filesystem over a network link directly actually has a smaller footprint.
12 * booting with `/` only is not systematically tested in Debian anymore;
13 * the packaging infrastructure to install files outside of `/usr` is not standard and represents technical debt:
14 * given its status as remnant "folklore", the distinction between what _needs_ to be shipped in `/` and what can stay in `/usr` is often interpreted arbitrarily;
15 * allowing shipment of identically-named libraries or binaries in different paths can confuse common understanding of paths precedence.
16
17 The arguments against moving the base directories' scheme towards "merged `/usr`" are as follows:
18
19 * there's no gain in disrupting something that is not inherently broken;
20 * `/{bin,sbin,lib}/` → `/usr/{bin,sbin,lib}/` symlinks create confusing views of the system (`/bin/cat` and `/usr/bin/cat` are the same file), and dpkg doesn't support this situation cleanly [#134758](https://bugs.debian.org/134758).
21
22 [0]: https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/
23 [1]: https://wiki.debian.org/UsrMerge
24
25 ## "merged `/usr`" in Debian
26
27 In Debian buster, the current testing suite, "merged `/usr`" is only considered for implementation with symlinks (there are no proposals for simply dropping `/{bin,sbin,lib}`) and is implemented in two distinct ways:
28
29 * existing hosts can be made to have a "merged `/usr`" by installing the [usrmerge][2] package;
30 * new hosts get the `/{bin,sbin,lib}/`→ `/usr/{bin,sbin,lib}/` symlinks by default when using debootstrap >= 1.0.102.
31
32 The usrmerge package contains a `/usr/lib/convert-usrmerge` perl executable that runs in `postinst`, that will move the contents of `/{bin,sbin,lib}/` and replace these directories with symlinks when empty.
33
34 [2]: https://tracker.debian.org/pkg/usrmerge
35
36 ## Issues from "merged `/usr`"
37
38 Since the default change in debootstrap 1.0.102, some issues have arisen.
39 Due to the fact that some buster/sid hosts have the "merged `/usr`" symlinks in place, it has been observed that some binary packages carried some traces of these differences (notably official packages built on Debian buildd hosts which had been resetup).
40 Some such differences can actually render the built packages unuseable on non-"merged `/usr`" systems.
41 For example, if `cat` is detected at build-time in `/usr/bin/cat` (where coreutils ships `/bin/cat`), a binary hardcoding that path will try to use `/usr/bin/cat` after installation, but that path doesn't exist in non-"merged `/usr`" systems.
42 In order to mitigate this, debootstrap has been modified to let its "buildd" variant be non-"merged `/usr`", the Debian buildds have been resetup and the affected packages rebuilt.
43
44 The lesson here is that with the existance of (any of) the usrmerge and the debootstrap default change, "merged `/usr`" Debian systems exist already, and that packages built on hosts with such directory schemes can _potentially_ be broken on non-"merged `/usr`" systems.
45 At this point, the two variants have to be supported, at least as installation targets of Debian packages.
46
47 Two initiatives are worth mentioning at this point:
48 * [a patch][https://lists.debian.org/20181202212535.GC11687@gaara.hadrons.org] has been proposed for dpkg-buildpackage to mark packages built on "merged `/usr`" hosts with a `Build-Tainted-By: merged-usr-via-symlinks`;
49 * the reproducible builds team has added a "merged `/usr`" variation to their setup, and have then [tagged][https://tests.reproducible-builds.org/debian/issues/unstable/paths_vary_due_to_usrmerge_issue.html] the Debian packages from unstable which had differences due to "merged `/usr`". It seems that ~61 packages were affected by differing builds; 32 from these have been fixed in unstable already.
50
51 ## The long-term desireable situation
52
53 Various valid long-term desireable situations coexist, and while discussing immediate countermeasures, it is useful to keep the long-term outcome that those are most likely to produce.
54
55 These are three possible situations for the fleet of bullseye (buster + 1) hosts:
56
57 * `none`: "merged `/usr`" has been reverted; no bullseye hosts have `/{bin,sbin,lib}/`→ `/usr/{bin,sbin,lib}/` symlinks; only `cat` only exists at `/bin/cat`;
58 * `weak`: bullseye hosts can have any of "merged `/usr`" or "classical" directory schemes; official packages are only built on "classical" directory schemes; packages built on "merged `/usr`" are allowed to break on "classical" directory schemes.
59 * `hard`: bullseye hosts can have any of "merged `/usr`" or "classical" directory schemes; official packages are built on either "merged `/usr`" or "classical" directory schemes; packages built on either are forbidden to break on either directory schemes.
60 * `all`: bullseyes hosts all have "merged `/usr`"; official packages are built on "merged `/usr`"; packages built on "classical" directory schemes are allowed to break on "classical" directory schemes.
61
62 ## Immediate actions
63
64 Given that hosts with different top-level directory schemes already exist; there are various ways forward that would allow for Debian to converge to a desireable situation:
65
66 * Flag-day to get all hosts on "merged `/usr`", through a base-files version; probably in buster+1 (bullseye)
67 * Disallow "merged `/usr`", let users who ran `usrmerge` on their own
68 * Let Debian converge to a situation where non-"merged `/usr`" Debian hosts are equivalent to symlinked "merged `/usr`" hosts; do this through upgrading all packages shipping files outside of /usr (but exceptions) to stop doing this. Could be achieved by setting policy for buster+1 (should) and buster+2 (must), or maybe even shorter. This would make the symlink "shortcut" migration redundant.
69 * Support both "merged `/usr`" and non-"merged `/usr`" systems forever: this implies that our packaging tools need to either support countering effects of "merged `/usr`" (e.g. through manipulating PATH for builds to detect files only in their .deb paths) or identifying tainted packages, and letting installing users decide (warn or error out at install time).
70
71 Given the tests from the reproducible builds' initiative, it does not seem impossible to enforce that official Debian packages support being built on either "merged `/usr`" or non-"merged `/usr`" systems; however, due to Debian being upstream to many other distributions, and due to `.deb` packages (which often don't go through the same level of checking and policing as official Debian's) being built by Independent Software Vendors (ISVs), our users will probably face similar problems to what we have described.
72
73 It's bizarre to have official buildds be non-"merged `/usr`" while user hosts will converge to be more and more "merged `/usr`".
74
75 ## For buster
76
77 Anyway:
78     Recommend tainting binary packages built on "merged-`/usr`" hosts, and warning at install time.
79     Recommend tackling "merged-`/usr`" properly over bullseye (buster+1)
80
81 Option A:
82     Override debootstrap maintainers; let new hosts be identical to buildds, non-"merged-`/usr`".
83
84 Option B:
85     Do not override debootstrap maintainers
86     Encourage finding ways quickly to reconcile buildds' setups with user setups.
87
88
89 === End DRAFT Resolution ===
90