Repository navigation
Prevent persistent shell cache failures during upgrades - #16880
cobrakoral wants to merge 4 commits into
Conversation
Synchronize an atomic replacement between Qt's source and checksum reads. Verify that fresh processes accept stale bytecode, then exercise launcher recovery, repeated starts, cache-write prevention, and retained settings. This regression fails against the unchanged launcher.
Scope QML_DISABLE_DISK_CACHE to the supervised shell process so stale runtime units are ignored and replacements cannot poison new cache entries. Preserve existing caches and user settings. This is a workaround for Qt's separate compilation and checksum reads.
[Medium impact] The PR appears safe to merge; both previous findings are addressed and no new actionable issues were found. SummaryThe launcher disables runtime QML disk caching for Quickshell while preserving existing caches and settings.
|
Do not depend on directory enumeration order when inspecting compiled units. Retain the matching cache path for the preservation assertion.
Remove QML_DISABLE_DISK_CACHE with Quickshell's per-child environment override. Reuse that boundary for shared launch helpers, direct application launches, and URL handlers while preserving notification URL validation. Exercise real detached children, literal arguments, unrelated environment values, and the unchanged shell cache protection.
|
I reviewed this PR alongside #16818 to assess whether the two changes overlap, conflict, or should be integrated together. My recommendation is to keep both PRs independent and merge this one first, followed by #16818. The two changes address different failure modes within the same broader shell restart and upgrade problem: #16880 addresses cache coherence. It prevents the launched Quickshell process from reading or writing runtime QML disk caches, avoiding the demonstrated case where stale compiled bytecode survives restarts despite the source tree being correct. #16818 addresses startup observability and readiness. It distinguishes a responsive root IPC handler from successfully loaded first-party components, preventing restart success from being reported when required plugins have failed. Neither change replaces the other. Disabling the disk cache does not guarantee that every plugin is valid or successfully instantiated, while improved readiness reporting does not prevent persistent cache corruption. The current diffs do not modify overlapping files, and there is no direct code dependency between the implementations. Keeping them separate also makes their individual behavior, tradeoffs, and regression coverage easier to review. I recommend merging #16880 first because it addresses the reproduced persistent failure and introduces the more significant runtime tradeoff: losing the benefits of warm QML disk caching. We can then evaluate #16818's readiness contract on top of that behavior. Combined integration validation should remain focused on the actual interaction between these changes: Verify that a previously poisoned cache cannot prevent successful component loading, IPC registration, and startupStatus=ready after a restart. Confirm that repeated restarts neither consume nor recreate the affected runtime cache entries. Verify that external applications launched through the shell do not inherit QML_DISABLE_DISK_CACHE, including command, argv, and URL launch paths. Perform one real Hyprland session restart to verify that the startup readiness deadline remains sufficient without warm QML disk caching. The existing isolated regression fixtures already cover much of this behavior. I do not think a full duplicate test suite or a combined PR is necessary. Finally, I would retain the distinction between a demonstrated workaround and an upstream Qt fix. The controlled reproduction establishes a genuine cache-coherence failure, but it does not prove the reporter's exact historical upgrade sequence. Restoring runtime disk caching should require separate evidence that the underlying coherence issue has been resolved. Conclusion: This PR and #16818 are complementary, independently reviewable improvements. I support merging #16880 first, followed by #16818 after focused combined integration validation. |
|
Reviewed at 7be4899 by Claude Opus 5.5, with a second opinion from Codex Medium and muse-wonder (via pi, thinking high). The fix works. Most of the diff isn't needed for it, and whether to give up the disk cache is the maintainer's call. What was run, on a disposable Omarchy VM with qt6-declarative 6.12.0 and quickshell 0.3.2.r7.g2b4501a, with the shell running from this branch:
Findings. Both reviewers raised these, and I checked each against the source:
Related. #16900 pauses plugin loads during package transactions. Once its hooks are installed, it also closes the window this race needs on later upgrades. It doesn't bypass caches already poisoned on users' machines, and this PR does. #16818 is about restart readiness and doesn't overlap. #16126 also covers the transient mid-upgrade failure, which this PR doesn't address, so I haven't marked it as closing that issue. Nothing was pushed to your branch. This is labelled |
|
Rechecked unchanged head Codex High reviewed the diff and merge result. Opus 5.5 High agreed, from the supplied current-base launcher and conflict hunk, that this leaves the November 3 scope decision unchanged; independence is not guaranteed. No code or tests ran in this pass, and the earlier worker results do not verify integration with the current base. The This awaits the maintainer's decision on the shell's disk-cache policy and the scope raised in the previous review. After that decision, the branch needs its conflict resolved and fresh worker verification. Nothing was pushed. |
Runtime QML caches can preserve stale plugin bytecode across shell restarts after source replacement. Disable runtime disk-cache reads and writes for the Quickshell process started by
omarchy-launch-shell. Existing caches and settings are preserved; the policy is scoped to that shell process.Reproduction and diagnosis
With Quickshell
0.3.2.r7.g2b4501a-1and Qt6.12.0, a controlled file replacement reproducesShellIpc is not a typein two fresh processes despite a complete replacement tree. Root IPC responds while the representative plugin target is absent; a fresh-cache control succeeds.Qt reads the source for compilation and reopens it for its checksum when saving the compiled unit. Replacement between those reads can associate old bytecode with the new source's checksum. The regression synchronizes that replacement with a test-only preload shim and verifies the saved checksum; it does not modify cache files.
Change and coverage
The launcher bypasses existing poisoned runtime caches and prevents new runtime cache writes. Shared launch helpers, direct app launches, and URL handlers remove the variable with Quickshell's per-child environment override. Notification URL validation remains intact.
The regression identifies the intended compiled unit by its source checksum among multiple real caches. Real detached children verify that command, argv, direct, and URL launches exclude the cache policy while retaining other environment values and literal arguments; the shell's protection remains active.
The regression fails on base
83f04009at launcher recovery and passes with the correction. It exercises real Quickshell component instantiation and external plugin IPC, repeated recovery, replacement during loading, restart after repair, and preservation of existing caches and settings. Existing supervisor tests also pass.The aggregate CLI suite passes. The shell run reports three failures out of 404 files:
update-lockandupdate-stay-awake-securityalso fail individually on the unchanged baseline;preinstallspasses individually on both trees, leaving its parallel-run cause unestablished. The final URL-routing extension was checked with focused tests after the aggregate run. Graphical tests were skipped without a usable compositor.QML lint passes for the changed utilities, clipboard, Dropbox, Tailscale, and notification components. Network-panel lint did not complete; a bounded baseline comparison also timed out.
Scope and tradeoff
This is an Omarchy workaround for a demonstrated Qt cache-coherence race. The type-removal fixture does not establish the reporter's exact historical upgrade sequence. Full Dock/Elsewhen desktop validation and startup-performance measurements remain outstanding. Warm runtime compilation-cache benefits are lost; transient errors in a running engine during replacement and incompatible plugins remain outside this change.
#6751's main-watcher protection remains intact. #13006 coordinates third-party Git plugin updates. #16818 independently improves restart readiness. quickshell-mirror/quickshell#1049 changes VFS/import paths and disk-cache behavior; restoring disk caching requires a verified coherent source/checksum path.
Refs #16126.