Commit Graph
3 Commits
Author SHA1 Message Date
gitops 8ff1e72d3e test: follow the autostart template off its author's home directory, and let CI compile
The template it parses stopped naming /home/dingo, so the two assertions that
named it had to move with it: the bar is now an `sh -c` invocation rather than a
bare waybar, and the wallpaper path is $HOME. The wallpaper assertion keeps the
surrounding double quotes in the expected string deliberately -- dropping them
is what would split the path at a space in someone's home directory, which is
the failure the test exists to catch.

Adds a ratchet: no line in the shipped autostart may contain "/home/". Both
lines carried an author's home directory right up until the repository was about
to be published, which is a bad moment to find out.

CI is fixed at the same time, because it could never have run these two tests.
They read ../config/autostart through include_str!, so the crate does not
compile its own test profile unless the parent repository is its parent
directory -- and a workflow checkout puts this repository at the workspace root,
alone. Confirmed by building a standalone export of HEAD:

    error: couldn't read `.../standalone/../config/autostart`: No such file
    error: could not compile `cosmic-session` (bin "cosmic-session" test)

So the job now checks the parent out first and this repository over the top of
where its submodule sits, which is the layout the working tree already has. The
coupling is worth keeping: the point of those tests is that the template this
session actually ships still parses to the commands it documents, and a copy
vendored in here to make the build self-contained would be a copy that goes
stale without anyone noticing.

The three dependency-install steps override working-directory back to the
workspace root, since they run before the checkout that creates the directory
the job otherwise defaults to, and a run step whose working-directory does not
exist fails before it runs anything.
2026-08-10 17:13:34 +07:00
gitops 03cd10c0d9 ci: build on three distros, and assert the four dangerous files stay unwritten
Upstream ships no workflows here, so nothing is displaced; the file is named
hyprcosmic.yml anyway, to match the compositor fork where ci.yml is already
upstream's.

A lighter matrix than the compositor's, because this crate has no system
libraries to find -- what actually varies per distribution is the toolchain and
`just`. Rust comes from rustup for the same reason as in cosmic-comp: bookworm
ships rustc 1.63 against a crate that needs 1.93 and edition 2024. `just` comes
from the distribution on Fedora and Arch and from crates.io on Debian, which has
no such package until trixie.

The assertions are the reason this exists. Until recently `just install` wrote
/usr/bin/cosmic-session, cosmic.desktop, the systemd target and the mimeapps
list -- all files the distribution's own cosmic-session package owns. Anyone who
cloned this repository and ran the documented build command replaced their
working COSMIC session with this one, and had nothing left to log into when the
fork failed to start. The negative tests are the important half: it is the files
that must NOT appear that made the old recipe dangerous, and a `test ! -e` is
the only thing that will notice if one of them comes back.

The session scripts are checked off the matrix, on a bare runner. Shell does not
vary by distribution, and doing it there avoids naming the shellcheck package in
three package managers to check the same file three times. Both scripts are
parsed, because a syntax error in either is a black screen at login with nowhere
to print the reason. Only start-hyprcosmic is linted: start-cosmic is upstream's,
this fork no longer installs it, and its existing findings are not ours to
rewrite.
2026-08-10 16:54:38 +07:00
d 78d361446d Fork of pop-os/cosmic-session @ upstream 2026-08-10 08:00:21 +07:00