Until now COSMIC was the exception in the image. The desktop components and pop-launcher were built
by cargo on the build host and copied in by the Desktop post-build, outside Buildroot's download,
hash and rebuild tracking, against the host's toolchain. They are now one package,
package/cosmic, cross-built with Buildroot's rustc against the staging sysroot in a single cargo
target dir. One package rather than one per component matters: libcosmic, iced and wgpu compile
once for the whole set instead of 25 times. Its sources are GitHub archives at pinned commits with
sha256 hashes, and the package version is a digest of the component list, the libcosmic pin, the
locks and the COSMIC patches, so changing any of them rebuilds it. A clean run took about 43 minutes
of wall time, roughly 5 hours of CPU, per Desktop edition. Two things still build with host tools:
our own libcosmic apps, and libclang for bindgen.
The security half is about who decides what gets compiled. build-cosmic.sh had been running
without --locked, and when the libcosmic pin didn't take it ran cargo generate-lockfile, which
re-resolves the entire dependency graph to whatever crates.io served that morning, running every
crate's build script on the build host. cosmic-idle's lock had drifted exactly that way: 21 crates
and 165 versions its upstream lock doesn't name. Now the 25 locks the current binaries were built
from are committed in the repo, every cargo build passes --locked, and --relock COMPONENT is the
only path that resolves, writing the lock and printing what changed for review. A changed checksum
or a removed crate stops the build before anything compiles. An OSV query over the 2,054 crate
versions in those locks found no malicious-crate advisory and 104 vulnerability advisories across 76
versions, all of them in upstream's own locks. That's the inventory to watch, and it's now a known
list rather than a guess.
Same thinking, other end: the nightly's patch lane used to build and publish whatever patch an NVD
reference URL served, from any host, any scheme. It now fetches over https, only from hosts listed
in fix-repos.toml for that package, only the exact commit NVD named, and attests each patch's
sha256.