owlry 2.0: single-binary rewrite #6
Reference in New Issue
Block a user
Delete Branch "v2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
owlry 2.0 — single-binary rewrite
Collapses the workspace from 5 crates and 15 AUR packages into one binary and one PKGBUILD. Removes the entire C-ABI plugin loader that produced the issue #5 failure mode, folds every shipped provider into compiled-in feature-gated modules, and reshapes the CLI around subcommands.
Closes #5.
Full decision log + per-task commit trail:
docs/RESTRUCTURE-V2.md.What goes away
owlry-core/,owlry-plugin-api/,owlry-lua/,owlry-rune/all deleted. Singlecrates/owlry/./usr/lib/owlry/plugins/*.sodiscovery, no moreAPI_VERSIONmismatch silently disabling every plugin (the bug class behind #5)..soruntimes (44 MB + 118 MB combined) gone. User-scripting returns in a later 2.x release via embeddedmluaand a Lua-driven config (Phase 3 in the plan).What's new / changed
Breaking changes (2.0)
Deferred (back in a later 2.x)
Testing
Acceptance checklist
See `docs/RESTRUCTURE-V2.md` section 9 for the full Phase 1 acceptance log. All items ✅.
Post-merge
- D15: rename systemd unit owlryd.{service,socket} -> owlry.{...} - D16: defer submenu protocol redesign to Phase 5 - D17: keep daemon (cold-start cost justifies it) - D18: TOML reader hard cut at 3.0.0 - D19: Lua sandbox: fs read + process spawn; no network default - D20: widgets (weather, media, pomodoro) on hold; excluded from Phase 1 - D21: hot-reload init.lua on save (Phase 3) Phase 1 plugin conversion shrinks from 11 -> 8 plugins (widgets dropped).Per D13 in the v2 plan: 'sys' collides mentally with 'systemd'. The power & session provider becomes 'power' everywhere. Pre-v2 names ('sys', 'system', badge_sys) remain accepted as serde aliases so existing user configs keep parsing. Also fixes a pre-existing bug: filter.rs mapped :sys/:system/:power prefixes to the type_id 'system', but the provider exposed itself as Plugin('sys'). The two never matched, so prefix filtering on this provider was a no-op. Now everything (filter table, ProviderType FromStr, provider's own provider_type, config key) agrees on 'power'. Files renamed: providers/system.rs -> providers/power.rs Struct renamed: SystemProvider -> PowerProvider type_id: 'sys' -> 'power' Item IDs: 'sys:shutdown' -> 'power:shutdown' (frecency for the 7 power items resets after upgrade — acceptable for a v2 break) Config key: providers.system -> providers.power (alias 'system', 'sys') Theme color: colors.badge_sys -> colors.badge_power (alias 'badge_sys'). theme.rs emits both --owlry-badge-power and --owlry-badge-sys so existing stylesheets keep rendering. UI provider_meta: 'system' arm becomes 'power' | 'system' ProviderType::FromStr: 'power', 'sys', 'system' all -> Plugin('power') (and 'uuctl', 'systemd' -> Plugin('uuctl') as parallel hygiene) Tests added (TDD): - provider_type_from_str_maps_power_aliases - provider_type_from_str_maps_systemd_aliases - providers_config_accepts_power_key - providers_config_accepts_pre_v2_system_alias - theme_colors_accepts_pre_v2_badge_sys_alias - all_item_ids_use_power_prefix (in power.rs) 239 tests pass (up from 234) with --features full. Task #8 complete.Adds a one-shot override before XDG_RUNTIME_DIR resolution so smoke tests (and side-by-side daemon instances during dev) can run without disturbing a production daemon listening on the default socket. - OWLRY_SOCKET=/tmp/foo.sock owlry -d - OWLRY_SOCKET=/tmp/foo.sock owlry providers Test added (owlry_socket_env_overrides_xdg_runtime) verifying the env var takes precedence and restoring the previous value so it doesn't leak across other tests in the module. Used to verify Phase 1 live behavior across all 13 provider entry points — each returned expected results, including uuctl resolving to real systemd unit names ('dbus' -> dbus-broker, at-spi-dbus-bus). Issue #5 confirmed fixed end-to-end.Stages everything needed for the AUR 2.0.0 republish, without pushing or publishing. The next checkpoint is a local makepkg test (task #2.5); push/publish actions wait for explicit go-ahead (task #2.6). aur/owlry/PKGBUILD: - pkgver 1.0.10 -> 2.0.0; pkgrel 1 - depends drops owlry-core (now folded into owlry) - optdepends cleaned: just cliphist, wl-clipboard, fd, mlocate — the external tools providers shell out to. No more 11 plugin packages. - build uses --features full (AUR ships everything compiled in; cargo install consumers still get the minimal default) - check runs cargo test --features full - package installs single binary + renamed systemd units + docs/themes - replaces/conflicts/provides cover 18 dropped packages: owlry-core, owlry-lua, owlry-rune, 11 owlry-plugin-* (including the deferred widgets per D20), 4 owlry-meta-* aur/owlry/owlry.install (new): - post_install message: how to start the daemon - post_upgrade from 1.x: announce the systemd unit rename and tell the user to disable old owlryd.service / enable new owlry.service. Includes a banner with the v2 breaking changes (widgets gone, plugins built in) - post_remove note: config stays systemd/: - owlryd.service -> owlry.service (per D15) - owlryd.socket -> owlry.socket crates/owlry/src/client.rs: - connect_or_start invokes 'systemctl --user start owlry.service' justfile: - install-local installs renamed units aur/owlry-{core,lua,rune}/: - Tracked files (PKGBUILD, .SRCINFO, .gitignore) removed from main repo - .gitignore entries added so the leftover local checkouts (still on disk with their AUR-remote .git dirs) don't keep showing as untracked - AUR remotes themselves unaffected; orphaning on aur.archlinux.org is a separate manual step aur/owlry/.SRCINFO regenerated via makepkg --printsrcinfo.User-facing docs that lagged behind the v2 rewrite. Replaces the 1.x package-mosaic narrative everywhere with the single-binary 2.0 reality. README.md (rewrite): - Highlights single binary + cargo-feature-gated providers - Drops the 11-plugin Available Packages table (single package now) - Drops Settings Editor section (config_editor was deleted) - Drops Plugin Management CLI section (entire 'owlry plugin ...' tree is gone; commands.rs handles doctor / providers / config / migrate) - New cargo features table (matches owlry/Cargo.toml [features]) - Build-from-source uses cargo build --release --features full - All owlryd refs -> owlry -d / owlry.service - Search prefixes table updated for sys->power rename - Architecture diagram redrawn for single binary - New 'Roadmap' subsection pointing at upcoming Lua config + widgets ROADMAP.md (revise): - Drops 'Plugin hot-reload' (compiled-in providers can't hot-reload) - Drops 'Plugin settings UI' (config_editor was the v1 equivalent; gone) - Drops 'Plugin marketplace' / Lua plugin install via CLI (the install surface itself was removed in v2; user extensions return via Phase 3 Lua config, not via a registry) - Drops 'Split monorepo' / 'Plugin API backwards compatibility' / 'Per-plugin config' — all resolved by the v2 collapse - Adds 'Lua-driven configuration' and 'Widget providers return' as the next-up bets - Notes Phase 5 hygiene items (file splits, submenu protocol redesign, double-spawn) so they're not lost CLAUDE.md (rewrite for v2): - Project shape diagram = single crate, single binary - Build commands use --features full - OWLRY_SOCKET env var documented (smoke-test enabler) - Naming-rules table covers the sys->power and owlryd->owlry transitions so future AI assistants don't reinvent the old vocabulary - Drops references to owlry-core, owlry-plugin-api, owlry-lua, owlry-rune - Drops plugin CLI documentation (subcommand tree is gone) aur/owlry/PKGBUILD: - replaces / conflicts / provides arrays grow from 18 -> 21 entries. - Adds three plugin packages I'd missed in the first pass: owlry-plugin-calculator (pre-v2 transitional stub, pkgrel -99) owlry-plugin-converter (same) owlry-plugin-system (same — distinct from owlry-plugin-systemd!) - Arrays now organised by reason (folded plugins / deferred widgets / Lua-replaced / pre-v2 stubs / meta-bundles) with inline comments. - .SRCINFO regenerated. Local rebuild verified: makepkg produces owlry-2.0.0-1-x86_64.pkg.tar.zst with 21 conflict= entries in .PKGINFO.Hand-written groff man page documenting the v2 CLI surface, environment variables, files, and examples. Sections: NAME / SYNOPSIS / DESCRIPTION OPTIONS -d, -m, --profile, -p, -h, -V COMMANDS daemon, dmenu, doctor, providers, config, migrate-config ENVIRONMENT XDG_RUNTIME_DIR, OWLRY_SOCKET, XDG_CONFIG_HOME, XDG_DATA_HOME, TERMINAL FILES config, themes, frecency, socket, docs, units EXAMPLES UI launch, daemon background, dmenu pipeline, doctor, side-by-side dev daemon via OWLRY_SOCKET SEE ALSO / BUGS / AUTHORS aur/owlry/PKGBUILD: install -Dm644 data/owlry.1 -> /usr/share/man/man1/owlry.1. makepkg auto-gzips to owlry.1.gz in the final package. Verified with groff -Tutf8 -man: no warnings or errors. Tested locally via makepkg; man page lands at /usr/share/man/man1/owlry.1.gz in the 2.7 MB .pkg.tar.zst.The chroot build of owlry-2.0.0 failed at link time with every sqlite3_* symbol undefined — libsqlite3-sys's build.rs was taking the 'build_linked' branch (which links to system libsqlite3) instead of 'build_bundled' (which compiles sqlite3.c statically). The host build worked only because /usr/lib/libsqlite3.so happens to be installed. The original Cargo.toml had: rusqlite = { version = "0.39", features = ["bundled"], optional = true } In theory this activates rusqlite/bundled which pulls libsqlite3-sys/bundled. In practice — apparently a Cargo resolver edge case with optional deps in edition 2024 — the bundled feature did not flow into the resolved feature graph in a clean chroot build. Fixed by declaring rusqlite without inline features and wiring the bundled flag explicitly in the bookmarks feature row: [dependencies] rusqlite = { version = "0.39", optional = true } [features] bookmarks = ["dep:rusqlite", "rusqlite/bundled"] Verified via 'cargo tree --features full -i libsqlite3-sys -e features': the libsqlite3-sys 'bundled' feature now traces back to owlry/full -> owlry/bookmarks -> rusqlite/bundled.makepkg in clean chroots defaults to OPTIONS+=(debug), which tries to split debug symbols into an owlry-debug subpackage. Cargo's release profile already strips the binary at compile time (strip = true in workspace Cargo.toml), so the debug split finds nothing and emits a benign-but-noisy 'No debugging symbols' warning followed by an empty owlry-debug-2.0.0-1-x86_64.pkg.tar.zst. Set options=('!debug') so makepkg skips debug splitting entirely. The released package is unchanged from the user's perspective; we just stop producing the empty subpackage and the namcap warning that came with it. Leaves the unrelated namcap warnings about transitively-satisfied deps (glib2, openssl, pango, glibc, libgcc) untouched — those are normal for Rust binaries pulled through GTK4 and don't need explicit listing in depends=. The 'checkpkg: target not found: owlry' warning will auto- resolve once 2.0.0 is published to AUR.