Skip to content

Skip Elsewhen migration on unpackaged Omarchy installs - #12532

Closed
paulogeyer wants to merge 1 commit into
omacom:quattrofrom
paulogeyer:fix/12531-elsewhen-wsl-skip
Closed

paulogeyer wants to merge 1 commit into
omacom:quattrofrom
paulogeyer:fix/12531-elsewhen-wsl-skip

Conversation

@paulogeyer

Copy link
Copy Markdown
Contributor

Summary

Migration 1789581661 always runs omarchy-pkg-add elsewhen. On WSL/dev checkouts there is no omarchy pacman package (/usr/share/omarchy is a symlink into the checkout). Because elsewhen Depends: omarchy, pacman resolves the packaged desktop and conflicts with that symlink, aborting omarchy update. The migration marker is never written, so every later update fails the same way.

Guard: if pacman -Q omarchy fails, skip the migration cleanly (exit 0).

Fixes #12531

Test plan

  • Harness: unpackaged install mocks — stock migration fails on pkg-add; patched skips with exit 0 (prs/12531-elsewhen-wsl-migration/smoke-test.sh)
  • WSL install: omarchy update after this migration no longer wedges on elsewhen

Migration 1789581661 always runs omarchy-pkg-add elsewhen. On WSL/dev
checkouts there is no omarchy pacman package, and elsewhen Depends: omarchy,
so pacman tries to install the packaged desktop and conflicts with the
checkout symlink at /usr/share/omarchy. The migration fails, no marker is
written, and every later omarchy update re-fails.

If pacman -Q omarchy fails, exit 0 instead of installing the package.

Fixes omacom#12531
@llstrk

llstrk commented Sep 25, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Outcome: The guard is correct against the base this PR was written on. However, the migration it edits no longer exists on current quattro, and the replacement migration still installs Elsewhen without a guard. To cover the #12531 failure, the guard needs to move to the replacement file.

Verified (from source, with pacman 7.1.0 source and public Omarchy package recipes):

  • pacman -Q omarchy succeeds when omarchy or a package that provides it is installed. This is the same check pacman uses to decide whether Elsewhen's omarchy dependency is already met. Packaged installs, omarchy-dev installs (which declare provides=('omarchy')) and omarchy dev link checkouts (which keep the package) still run the migration. Only installs with no omarchy provider skip it.
  • exit 0 ends only the migration's own process. bin/omarchy-migrate then writes the migration marker, so later updates no longer retry the failing install.
  • The elsewhen package recipe declares depends=(omarchy python quickshell). This is consistent with the dependency resolution described in Migration 1789581661 (elsewhen) breaks omarchy update on WSL installs: pulls the omarchy package and conflicts with the checkout symlink #12531.

The edited migration was renamed on quattro, and the replacement is unguarded

Upstream commit 73b4fc0 (2026-09-22) renamed migrations/1789581661.sh to migrations/1790042972.sh so that the migration runs again on every machine. omarchy-migrate records completion by filename. The quattro version of test/shell.d/elsewhen-default-migration-test.sh asserts that an old 1789581661.sh marker does not satisfy the new file. Line 3 of 1790042972.sh still calls omarchy-pkg-add elsewhen with no guard. GitHub currently reports this PR as conflicting, which matches an edit to a file that was deleted upstream.

Unpackaged install (derived from source, not executed)

update at PR head   1789581661.sh: pacman -Q omarchy fails -> skip, exit 0 -> marker written
update to quattro   1789581661.sh: no longer shipped, its marker is not consulted
                    1790042972.sh: no marker -> omarchy-pkg-add elsewhen
                      -> pacman resolves the omarchy dependency
                      -> file conflict under /usr/share/omarchy -> exit 1
                      -> no marker -> every later update fails again (as in #12531)

Impact: On current quattro, unpackaged installs would hit the #12531 failure again. That includes installs that already skipped the old migration and installs that used the issue's marker workaround.

Suggested change: Rebase onto quattro, drop the edit to the deleted 1789581661.sh, and place the guard at the top of migrations/1790042972.sh, before omarchy-pkg-add elsewhen.

Optional test improvement: test/shell.d/elsewhen-default-migration-test.sh stubs omarchy-pkg-add and omarchy-shell but not pacman. With the guard in place, the test therefore queries the host's package database.

  • On a host without the omarchy package, the migration exits 0 before the stubbed install, so the first case (package failure stops the migration) fails.
  • On a packaged host, the test passes but never runs the skip branch.

A pacman stub, as in kernel-headers-migration-test.sh, with one installed and one not-installed case, would make the result independent of the host and cover the skip. After the rebase, this change belongs in the quattro version of the test, which is also missing the stub.

Optional: The new code comment says WSL/dev checkouts have no omarchy package. omarchy dev link checkouts keep the package and pass the guard. Wording such as "installs that run Omarchy from a checkout without the omarchy package (for example WSL setups)" would avoid implying that dev-link checkouts are skipped.


Review information

Test scope: Source review of head cc4c4e7, its base 60663fa and the quattro tip c3e67f5, plus pacman 7.1.0 source and public Omarchy package recipes and metadata. No tests, migrations or pacman commands were executed. The WSL failure was not reproduced. The conflict outcome is inferred from GitHub's merge state and the file history; no rebase was performed.

AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for tracking this down, @paulogeyer. Against the base it was written on, the guard is correct and proportionate: pacman -Q omarchy fails only where nothing provides omarchy, and an exit 0 lets omarchy-migrate record the migration as done, so the update stops wedging.

quattro no longer has the bug, though. 73b4fc0 renamed migrations/1789581661.sh to migrations/1790042972.sh, and e7218e3 (#13429) then moved Elsewhen into the shell tree as omarchy.elsewhen. The replacement migration now only rescans plugins and puts the widget on the bar, and migrations/1790528634.sh removes the old elsewhen package rather than installing it. On quattro, no migration, install script or bin/ command installs elsewhen, so the dependency conflict in #12531 can no longer happen during an update. That is why GitHub shows this branch as conflicting: it edits a file that no longer exists. Moving the guard onto 1790042972.sh would not prevent any conflict, and it would stop unpackaged installs from getting the widget on the bar.

What was checked: the diff, the history of both migrations on quattro, bin/omarchy-migrate and bin/omarchy-pkg-drop, all read from source. No tests were run. The code this fixes is gone from quattro, so a worker run would only test a deleted file. Codex Medium reviewed the same question as a second opinion and agreed (independence is not guaranteed). It also found the point above about the bar placement.

This now waits on the maintainer, and the recommendation is to close it as already fixed on quattro by #13429.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thank you for this, @paulogeyer. quattro already fixes this (#13429), so it is closed as superseded.

Closed at the maintainer's request. The review comment above has the details; it was done by Claude Opus 5.5 with Codex Medium as a second opinion, whose agreement is not independent.

@omarchybot omarchybot closed this Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migration 1789581661 (elsewhen) breaks omarchy update on WSL installs: pulls the omarchy package and conflicts with the checkout symlink

3 participants