Skip to content

Say which files block an upgrade the conflict recovery won't clear - #13538

Open
stevederico wants to merge 2 commits into
omacom:quattrofrom
stevederico:fix/update-conflict-explain
Open

stevederico wants to merge 2 commits into
omacom:quattrofrom
stevederico:fix/update-conflict-explain

Conversation

@stevederico

@stevederico stevederico commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

When pacman reports file conflicts the update can't clear by itself, omarchy update ends on "Something went wrong" with no clue, and every later update fails the same way. This says which files are in the way and what to do. Refs #13290

Before: omarchy-update-system-pkgs-when-conflicted exits 1 without a word when a conflicting file is owned by another package or blamed on a non-Omarchy package.
After: it lists those files, says it only moves files no package owns that omarchy, omarchy-dev, omarchy-settings or omarchy-settings-dev installs, and that it moves nothing until all qualify. Files it would move itself are left off the list and counted. Non-conflict failures (a failed download) print nothing extra.

How I tested

  • bash test/shell.d/update-file-conflict-test.sh passes (20 ok) and fails with the fix reverted. update-package-conflict-test.sh passes
  • Ran the script by hand on a fake pacman report blaming /usr/bin/bash (owned by bash): it printed the list and the advice and exited 1, moving nothing

When pacman reports conflicting files the recovery does not clear -- owned
by another package, or blamed on a package that isn't Omarchy's -- it
exited 1 without a word. The update ended on the generic failure, and every
later update failed the same way with no hint of the cause (omacom#13290: owe
files left behind by an interrupted install).

List the conflicting files, say why they were left alone, and what to do.
What the recovery is willing to move is unchanged.

Refs omacom#13290
@llstrk

llstrk commented Sep 29, 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 new explanation gives a reason that does not fit every file it lists.

Reason does not fit every listed file

A mixed report (an omarchy-settings-dev leftover beside another package's owned file) lists both, though the first was left only because of the all-or-nothing rule on line 113. Impact: people are asked to move by hand a file the recovery takes once the other conflict is gone. An omarchy-nvim file gets the same "one of Omarchy's own packages" reason, but line 106 takes only four packages.

Suggested change: List only paths not in leftovers, name the four packages, and say nothing moves until every conflict qualifies.

Reproducer (A fails at fdd8851; B shows the omarchy-nvim output)

Reproducer: the reason printed does not fit every file listed

Reviewed head: fdd8851

A. Mixed report: the Omarchy leftover the recovery would move is listed for the person

Append to test/shell.d/update-file-conflict-test.sh (uses its own helpers):

# Mixed report: the Omarchy leftover would be cleared by the recovery once the
# other conflict is gone, so only the other package's file needs a person.
fresh_work
echo "ours" >"$stray"
write_raw_report \
  "omarchy-settings-dev: $stray exists in filesystem" \
  "some-package: $work/theirs exists in filesystem (owned by other-package)"
if run_update >"$test_tmp/out" 2>"$test_tmp/err"; then
  fail "an upgrade with an unhealable conflict reports success"
fi
grep -qxF "  some-package: $work/theirs exists in filesystem (owned by other-package)" "$test_tmp/err" ||
  fail "the conflict that needs a person is not named" "$(<"$test_tmp/err")"
! grep -qxF "  omarchy-settings-dev: $stray exists in filesystem" "$test_tmp/err" ||
  fail "a file the recovery would clear itself is listed as needing a person" "$(<"$test_tmp/err")"
pass "a mixed report names only the conflicts the recovery would not clear"

Actual output at fdd8851 (exit 1; the 19 existing checks pass first):

error: failed to commit transaction (conflicting files)
omarchy-settings-dev: <tmp>/work/omarchy-fcitx5.service exists in filesystem
some-package: <tmp>/work/theirs exists in filesystem (owned by other-package)
[33m
These files are in the way of the upgrade:[0m
  omarchy-settings-dev: <tmp>/work/omarchy-fcitx5.service exists in filesystem
  some-package: <tmp>/work/theirs exists in filesystem (owned by other-package)

omarchy update only moves files no package owns that one of Omarchy's own
packages is installing. Check where these came from, move aside any that
nothing else needs, then run omarchy update again.
not ok - a file the recovery would clear itself is listed as needing a person

The first listed file is exactly what the printed rule says Omarchy moves. It was left only because of the all-or-nothing rule (lines 111-113), which the message does not mention.

B. An Omarchy package outside the recovery's list

Append instead:

# An unowned file blamed on an Omarchy package outside the recovery's list
# (omarchy-nvim is in install/omarchy-base.packages). Prints what the person sees.
fresh_work
echo "stray" >"$stray"
write_report omarchy-nvim "$stray"
if run_update >"$test_tmp/out" 2>"$test_tmp/err"; then
  fail "a conflict the recovery does not take reports success"
fi
sed 's/^/# /' "$test_tmp/err"
pass "printed what an omarchy-nvim conflict shows"

Actual output at fdd8851 (exit 0):

# error: failed to commit transaction (conflicting files)
# omarchy-nvim: <tmp>/work/omarchy-fcitx5.service exists in filesystem
# [33m
# These files are in the way of the upgrade:[0m
#   omarchy-nvim: <tmp>/work/omarchy-fcitx5.service exists in filesystem
# 
# omarchy update only moves files no package owns that one of Omarchy's own
# packages is installing. Check where these came from, move aside any that
# nothing else needs, then run omarchy update again.
ok - printed what an omarchy-nvim conflict shows

The recovery only takes omarchy, omarchy-dev, omarchy-settings and omarchy-settings-dev (the regex on line 106), but the message says "one of Omarchy's own packages".

(<tmp> replaces the test's mktemp -d directory; [33m/[0m are the escape sequences the handler prints.)

Optional test improvement: the file-name check passes without the list

Optional test improvement: the caller already prints pacman's report, so the grep at test line 150 matches pacman's own line and still passes with line 91 (the list) deleted. This is test-only; production behaviour is unaffected. Matching the handler's indented line with grep -qxF " some-other-pkg: $stray exists in filesystem" makes the check fail when the list is removed.

Reproducer (passes at fdd8851 with the list deleted):

Reproducer: the new "names the file in the way" check passes without the file list

Reviewed head: fdd8851

Steps

From a checkout of the PR head, delete the one line in leave_for_person that prints the files (line 91, grep ' exists in filesystem' "$errors" | sed 's/^/ /' >&2), then run the PR's test file:

sed -i '91d' bin/omarchy-update-system-pkgs-when-conflicted
bash test/shell.d/update-file-conflict-test.sh

Actual output

All 19 checks pass (exit 0), including:

ok - a conflict from a non-Omarchy package is left for a human
ok - a conflict left for a human names the file and why it was left
ok - a failure that is not a file conflict gets no conflict explanation

Why

omarchy-update-system-pkgs runs cat "$errors" >&2 before it execs the handler, so $test_tmp/err already holds pacman's own some-other-pkg: $stray exists in filesystem line whether or not the handler lists anything. The head test run against the unchanged merge-base handler shows the same thing: that grep passes, and the run stops only at the second new check:

ok - a conflict from a non-Omarchy package is left for a human
error: failed to commit transaction (conflicting files)
some-other-pkg: <tmp>/work/omarchy-fcitx5.service exists in filesystem
not ok - a conflict left for a human says why it was not cleared

(<tmp> replaces the test's mktemp -d directory.)

Suggested check

The handler indents the lines it lists and the caller's copy is not indented, so matching the whole indented line pins the new list:

grep -qxF "  some-other-pkg: $stray exists in filesystem" "$test_tmp/err" ||
  fail "a conflict left for a human names the file in the way" "$(<"$test_tmp/err")"

With line 91 deleted this fails:

ok - a conflict from a non-Omarchy package is left for a human
error: failed to commit transaction (conflicting files)
some-other-pkg: <tmp>/work/omarchy-fcitx5.service exists in filesystem
[33m
These files are in the way of the upgrade:[0m

omarchy update only moves files no package owns that one of Omarchy's own
packages is installing. Check where these came from, move aside any that
nothing else needs, then run omarchy update again.
not ok - a conflict left for a human names the file in the way

At fdd8851 unchanged it passes (all 19 checks, exit 0).

Details

Verified (sandboxed shell tests with stubbed pacman and sudo):

Related open PRs (textual conflicts in the handler):

Optional notes:

  • Pacman's third file-conflict form, <path> exists in both '<a>' and '<b>', is not listed. Next to Omarchy leftovers only, line 113 does not count it, so they are moved, the retry fails, they are put back and the new message never prints (this move-and-retry is pre-existing). Counting both forms on line 113 and in the list would skip that move and name every blocking file.
  • For (owned by …) lines, one clause saying the owning package has to be updated or removed would give the person a path forward.

Review information

Test scope: Source and sandboxed shell tests with stubbed pacman, at fdd8851; no real pacman transaction.

AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.

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

When one conflict needed a hand and another was a leftover the recovery
could take, the explanation listed both, so people were asked to move a
file the recovery takes once the rest are gone. It also said "one of
Omarchy's own packages" while only four are handled.

List only the files left for the person, name the four packages, say
nothing moves until every file qualifies, and say how many the recovery
will take itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants