]> git.donarmstrong.com Git - debian-ctte.git/blob - 914897_merged_usr/ballot.md
914897: Rephrase the ballot
[debian-ctte.git] / 914897_merged_usr / ballot.md
1 # #914897: tech-ctte: Should debootstrap disable merged `/usr` by default?
2
3 ## What is "merged `/usr`"
4
5 "Merged `/usr`" describes a possible future standard directories scheme in which the `/{bin,sbin,lib*}/` directories have been made superfluous through replacing them by symlinks to their `/usr` equivalents (`/usr/{bin,sbin,lib*}`).
6 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:
7
8 * 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. Booting hosts through that intermediate state is not systematically tested in Debian anymore.
9 * another use-case is to share system files from `/usr` between hosts (over a network link) or containers (locally) which use different data or configuration. Having all software under `/usr` (instead of spread between `/` and `/usr`) makes the centralized update and the sharing easier.
10 * the packaging infrastructure to install files outside of `/usr` (e.g. installing libs under `/lib` instead of `/usr/lib`) is not standard and represents technical debt.
11 * 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;
12 * allowing shipment of identically-named libraries or binaries in different paths can confuse common understanding of paths precedence.
13
14 [0]: https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/
15 [1]: https://wiki.debian.org/UsrMerge
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 * it is possible for distributions to converge towards having all system files in `/usr` in finite time instead of shortcutting this migration with `/{bin,sbin,lib*}/` → `/usr/{bin,sbin,lib*}/` symlinks.
22
23 The compatibility symbolic links `/lib` → `/usr/lib` and `/lib64` → `/usr/lib64` are required by the various CPUs' platform ABIs (for example i386 requires `/lib/ld-linux.so.2` to resolve to glibc's `ld.so`, and amd64 requires `/lib64/ld-linux-x86-64.so.2`) so there are no plans to remove them altogether. Similarly, removing `/bin` is not under consideration because it would break the assumption that `/bin/sh` exists, and removing `/sbin` would break the assumption that `/sbin/fsck.*` and `/sbin/mount.*` exist.
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 main 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 It is also possible to merge `/usr` in other ways, for example with `debootstrap --merged-usr` or by bootstrapping into a chroot that already contains the necessary symlinks.
35
36 [2]: https://tracker.debian.org/pkg/usrmerge
37
38 ## Issues from "merged `/usr`"
39
40 Since the default change in debootstrap 1.0.102, some issues have arisen.
41 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).
42 Some such differences can actually render the built packages unuseable on non-"merged `/usr`" systems.
43 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.
44 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.
45
46 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.
47 At this point, the two variants have to be supported, at least as installation targets of Debian packages.
48
49 Two initiatives are worth mentioning at this point:
50 * [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`;
51 * 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.
52
53 ## The long-term desireable situation
54
55 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.
56
57 These are the six possible situations at the time of bullseye (buster + 1):
58
59 * `none`: "merged `/usr`" has been reverted
60 * `empty`: "merged `/usr`" has been reverted, `/usr` is empty (but the mandatory files)
61 * `weak`: both directory schemes are allowed, packages only built on classical hosts
62 * `middle`: both directory schemes are allowed, packages can be built anywhere
63 * `hard`: both directory schemes are allowed, packages only built on "merged `/usr`" hosts
64 * `all`: only "merged `/usr`" directory schemes are allowed, packages only built on "merged `/usr`" hosts
65
66 It can be summarized by the following table:
67
68 ```
69 |          |     Host types that are allowed       | Are merged `/usr` |     Official packages are built on    | Packages built on … can break on the other |
70 | Codename | classical hosts | merged `/usr` hosts | symlinks allowed  | classical hosts | merged `/usr` hosts |   classical hosts   |  merged `/usr` hosts |
71 |----------|-----------------|---------------------|-------------------|—----------------|---------------------|---------------------|----------------------|
72 |     none |       yes       |          no         |         no        |       yes       |          no         |         yes         |          yes         |
73 |    empty |       yes       |          no         |         no        |       yes       |          no         |         yes         |           no         |
74 |     weak |       yes       |         yes         |        yes        |       yes       |          no         |          no         |          yes         |
75 |   middle |       yes       |         yes         |        yes        |       yes       |         yes         |          no         |           no         |
76 |     hard |       yes       |         yes         |        yes        |        no       |         yes         |          no         |           no         |
77 |      all |       no        |         yes         |        yes        |        no       |         yes         |         yes         |           no         |
78 ```
79
80 The current state of buster is `weak`.
81
82 === DRAFT Resolution ===
83
84 The Technical Committee resolves to decline to override the debootstrap maintainers.
85
86 Furthermore, using its §6.1.5 "Offering advice" power, the Technical Committee considers that:
87
88 * A: The desireable solution at the time of bullseye is `weak`; both directory schemes should be allowed, but packages should only be built on hosts with classical directory schemes (or chroots).
89
90 * B: The desireable solution at the time of bullseye is `hard`; both directory schemes should be allowed, and packages can be built on hosts with either classical or "merged-`/usr`" directory schemes.
91
92 * FD: Further Discussion
93
94 === End DRAFT Resolution ===