Files
komorebi/tools/kde-closure-check
T
LGUG2Z 170952596f refactor(repo): delete the shim packages
komorebic-linux, komorebi-client-linux, komorebic-macos, komorebi-client-macos and
komorebi-bar-macos were #[path] includes of the unified komorebic, komorebi-client and
komorebi-bar modules, kept only so the old package names kept building. The unified
packages are the only ones now, so the five directories and their workspace members are
gone (Cargo.lock loses their dependency entries).

Things that named the old packages follow: the clarify entries of the two per-tree
deny.toml files, tools/fast-check, tools/mac-check.sh and tools/kde-closure-check (it now
walks komorebic and komorebi-client), and the doc comment of komorebic/src/main.rs.
komorebi-for-kde/nix/root-crates.json gains komorebic, komorebi-client and
crates/komorebi-version, because those are root crates the KDE build depends on now.
komorebi-for-mac/komorebi/src/pan.rs read its transcripts from the deleted
komorebic/fixtures; they are byte-identical to the root komorebic/fixtures, so the three
paths point there.

Not touched here (done in the flake and justfile revisions of this stack): the nix
flakes and justfiles of the trees, which still name the removed packages, and docs/dev.

Verified: Windows cargo clippy --locked --all-targets -D warnings (default members) passes;
KDE cargo test -p komorebi -p komorebic -p komorebi-client -p komorebi-linux passes; macOS
cargo check --target aarch64-apple-darwin (fake CC) of komorebi, komorebi-macos, komorebic,
komorebi-client, komorebi-bar passes; tools/kde-closure-check passes. The nix flakes were
not run.
2026-11-05 15:03:27 -08:00

27 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# Fails if the crates outside komorebi-for-kde that the KDE packages depend on differ from the list the KDE
# source filter uses (komorebi-for-kde/nix/root-crates.json).
# Usage: tools/kde-closure-check [REPO_ROOT] (default: the repository this script is in)
# Works for the merged workspace (one root Cargo.toml) and for the old KDE workspace.
set -euo pipefail
root=$(cd "${1:-$(dirname "$0")/..}" && pwd)
[ -d "$root/komorebi-for-kde" ] || root=$(cd "$root/.." && pwd)
want=$(jq -r '.[]' "$root/komorebi-for-kde/nix/root-crates.json" | sort)
if [ -f "$root/komorebi-for-kde/Cargo.toml" ]; then
have=$(cd "$root/komorebi-for-kde" && nice -n 19 cargo metadata --offline --format-version 1 \
| jq -r --arg r "$root/" '.packages[] | select(.source == null) | .manifest_path
| select(startswith($r) and (startswith($r + "komorebi-for-kde/") | not))
| ltrimstr($r) | sub("/Cargo.toml$"; "")' | sort)
else
# merged workspace: the closure of the KDE packages on a Linux target
have=$(cd "$root" && for p in komorebi-linux komorebic komorebi-client komorebi-hotkeys; do
nice -n 19 cargo tree --offline --locked -p "$p" --target x86_64-unknown-linux-gnu --prefix none -e normal,build,dev 2>/dev/null
done | grep -o "($root/[^)]*)" | tr -d '()' | sed "s#^$root/##" | grep -v '^komorebi-for-kde' | sort -u)
fi
if [ "$want" != "$have" ]; then
echo "KDE source filter and cargo closure differ" >&2
diff <(echo "$want") <(echo "$have") | sed 's/^</ only in root-crates.json:/; s/^>/ only in cargo closure: /' >&2
exit 1
fi
echo "ok: $(echo "$want" | wc -l) root crates match the KDE cargo closure"