Skip to content

Say which package blocked an upgrade on a dependency - #11692

Open
therk wants to merge 1 commit into
omacom:quattrofrom
therk:update-dependency-failure-report
Open

therk wants to merge 1 commit into
omacom:quattrofrom
therk:update-dependency-failure-report

Conversation

@therk

@therk therk commented Sep 13, 2026

Copy link
Copy Markdown

omarchy-update-system-pkgs-when-conflicted recognises conflicting files and conflicting packages. A dependency it cannot satisfy falls through both and reaches the bare exit 1 at the end, so omarchy-update prints only:

Something went wrong during the update!
Please review the output above carefully, correct the error, and retry the update.

and the user is left to reconstruct what happened from a transcript that has already scrolled.

A held package is the usual cause. On the machine I hit this on, IgnorePkg keeps hyprland at the version built against libaquamarine.so=13 while aquamarine moves to 0.15.0 and provides 14:

:: installing aquamarine (0.15.0-2) breaks dependency 'libaquamarine.so=13-64' required by hyprland
error: failed to prepare transaction (could not satisfy dependencies)

pacman refuses the whole transaction rather than the one package, so every later omarchy update stops in the same place with the same unhelpful message.

Nothing about this is healable or worth retrying, so it goes back to whoever started the update, the same way a package conflict already does.

One wrinkle worth flagging: pacman puts only the verdict on stderr, and the lines naming what broke on stdout — which omarchy-update-system-pkgs deliberately leaves uncaptured so upgrade progress stays on the terminal. Verified:

stdout: :: installing aquamarine (0.15.0-2) breaks dependency ...
stderr: error: failed to prepare transaction (could not satisfy dependencies)

So the branch asks the resolver again (-p, and no -y since the databases the upgrade synced are still fresh) purely to recover those lines for the report.

Two cases added to test/shell.d/update-file-conflict-test.sh, covering the message and the fact that the branch neither retries the transaction nor moves any file aside. Both fail without the change; the whole suite and test/cli pass with it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ALLhsWEVznJX5Js4CM59ZV

The conflict handler recognises conflicting files and conflicting
packages. A dependency it cannot satisfy falls through both and reaches
the bare exit 1 at the end, so omarchy-update prints only "Something
went wrong during the update!" and the user is left to work out what
happened from a transcript that has already scrolled.

A held package is the usual cause: IgnorePkg keeps hyprland at the
version built against libaquamarine.so=13 while aquamarine moves to 14,
and pacman then refuses the whole transaction rather than the one
package, so every later update stops in the same place.

Nothing about that is healable or worth retrying, so it goes back to
whoever started the update the same way a package conflict does. Pacman
puts only the verdict on stderr and the lines naming what broke on
stdout, which the upgrade deliberately leaves uncaptured to keep its
progress on the terminal, so the resolver is asked again for them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALLhsWEVznJX5Js4CM59ZV
@llstrk

llstrk commented Oct 1, 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 branch blames an IgnorePkg hold for every unsatisfiable dependency, held or not.

IgnorePkg advice printed with no hold

pacman gives the same verdict, often with the same :: line, without a hold: a repository that has not rebuilt a dependent yet (likely in #11086), a foreign package built on the old library, or a missing dependency. With real pacman 7.1 and no IgnorePkg, the handler still prints the hold text; when the held package is the dependency (a Qt pin as in #8438), it describes the reverse case. Impact: same exit status, but misleading advice, and "every system upgrade stops here" is untrue for repository lag.

Suggested change: print hold advice only when pacman-conf IgnorePkg/IgnoreGroup lists something, naming them and worded for either direction; else suggest rebuilding or removing a foreign package, or retrying after mirrors sync.

Reproducer (fails at 19454b8)

Reproducer: the IgnorePkg advice is printed when nothing is held

Reviewed head: 19454b84417b1adad09044a3512ac95b57862fba.

1. Test case in the PR's own test file

Append this case to test/shell.d/update-file-conflict-test.sh and run bash test/shell.d/update-file-conflict-test.sh. It gives the handler the same verdict and the same :: line as the PR's own case, but with no IgnorePkg or IgnoreGroup configured (a pacman-conf stub that lists nothing).

# pacman gives the same verdict, and the same "installing X breaks dependency"
# line, when nothing is held: a repository that has not rebuilt hyprland yet
# (issue #11086), or a foreign package built against the old library. With no
# IgnorePkg configured, the report must not tell the user to drop a hold.
cat >"$stub_bin/pacman-conf" <<'STUB'
#!/bin/bash
[[ $1 == IgnorePkg || $1 == IgnoreGroup ]] && exit 0
exit 1
STUB
chmod +x "$stub_bin/pacman-conf"
fresh_work
echo 0 >"$test_tmp/attempts"
echo "error: failed to prepare transaction (could not satisfy dependencies)" >"$test_tmp/report"
detail=":: installing aquamarine (0.15.0-2) breaks dependency 'libaquamarine.so=13-64' required by hyprland"
RESOLVE_DETAIL="$detail" run_update >"$test_tmp/out" 2>"$test_tmp/err" || true
if grep -q "held by IgnorePkg" "$test_tmp/err"; then
  cat "$test_tmp/err" >&2
  fail "an unsatisfiable dependency is blamed on an IgnorePkg hold that does not exist"
fi
pass "an unsatisfiable dependency with nothing held is not blamed on a hold"

Actual output at the reviewed head (last lines, colour codes stripped):

ok - a clean upgrade runs a single pacman transaction
error: failed to prepare transaction (could not satisfy dependencies)

A dependency this upgrade cannot satisfy stopped it:
:: installing aquamarine (0.15.0-2) breaks dependency 'libaquamarine.so=13-64' required by hyprland

A package held by IgnorePkg in /etc/pacman.conf still requires a version of
something this upgrade wants to replace. Either drop the hold so the two move
together, or hold the dependency at the version the held package was built
against. Until one of those happens, every system upgrade stops here.
not ok - an unsatisfiable dependency is blamed on an IgnorePkg hold that does not exist
test exit: 1

2. Real pacman, no hold configured

This script uses the real pacman (7.1) as an ordinary user against a throwaway root: no root, no network, and the system's package databases are not touched. The test pacman.conf has no IgnorePkg. The repository has a new aquamarine but has not rebuilt hyprland yet (the shape of issue #11086), and a foreign package was built against the old library. Run it as bash repro_no_hold.sh <omarchy checkout at the PR head>.

#!/bin/bash
# Reproducer for PR #11692: the dependency branch blames an IgnorePkg hold even
# when pacman.conf has no IgnorePkg at all.
#
# Usage: repro_no_hold.sh <omarchy checkout at the PR head>
# Needs only bash, python3 and pacman. Runs as an ordinary user against a
# throwaway pacman root (no root, no network, host databases untouched).
set -euo pipefail
omarchy=$1
lab=$(mktemp -d)
trap 'rm -rf "$lab"' EXIT
db=$lab/root/var/lib/pacman
mkdir -p "$db/local" "$db/sync" "$lab/bin" "$lab/root/cache" "$lab/root/gnupg" "$lab/root/hooks"
echo 9 >"$db/local/ALPM_DB_VERSION"

# Installed: hyprland built against libaquamarine.so=13, and a foreign (AUR)
# tool built against it too. No IgnorePkg anywhere.
local_pkg() { # name version depends/provides lines...
  mkdir -p "$db/local/$1-$2"
  printf '%%NAME%%\n%s\n\n%%VERSION%%\n%s\n\n%%ARCH%%\nany\n\n%s\n' "$1" "$2" "$3" >"$db/local/$1-$2/desc"
  printf '%%FILES%%\n\n' >"$db/local/$1-$2/files"
}
local_pkg hyprland 0.50.0-1 $'%DEPENDS%\nlibaquamarine.so=13-64'
local_pkg some-aur-tool 1.0-1 $'%DEPENDS%\nlibaquamarine.so=13-64'
local_pkg aquamarine 0.14.0-1 $'%PROVIDES%\nlibaquamarine.so=13-64'

# The repository has the new aquamarine but has not rebuilt hyprland yet
# (the shape of issue #11086, a fresh install with no hold).
python3 - "$db/sync/core.db" <<'PY'
import io, sys, tarfile
pkgs = {
    'hyprland-0.50.0-1': 'hyprland\n\n%VERSION%\n0.50.0-1\n\n%DEPENDS%\nlibaquamarine.so=13-64\n',
    'aquamarine-0.15.0-2': 'aquamarine\n\n%VERSION%\n0.15.0-2\n\n%PROVIDES%\nlibaquamarine.so=14-64\n',
}
with tarfile.open(sys.argv[1], 'w:gz') as tf:
    for d, body in pkgs.items():
        data = (f'%FILENAME%\n{d}-any.pkg.tar.zst\n\n%NAME%\n' + body +
                '\n%ARCH%\nany\n\n%CSIZE%\n1\n\n%ISIZE%\n1\n').encode()
        ti = tarfile.TarInfo(d); ti.type = tarfile.DIRTYPE; ti.mode = 0o755; tf.addfile(ti)
        ti = tarfile.TarInfo(d + '/desc'); ti.size = len(data); tf.addfile(ti, io.BytesIO(data))
PY

cat >"$lab/pacman.conf" <<EOF
[options]
RootDir = $lab/root
DBPath = $db/
CacheDir = $lab/root/cache/
LogFile = $lab/root/pacman.log
GPGDir = $lab/root/gnupg/
HookDir = $lab/root/hooks/
Architecture = auto
SigLevel = Never

[core]
Server = file://$lab/nowhere
EOF
printf '#!/bin/bash\nexec /usr/bin/pacman --config %q "$@"\n' "$lab/pacman.conf" >"$lab/bin/pacman"
chmod +x "$lab/bin/pacman"

echo "== IgnorePkg lines in the test pacman.conf:"
grep -c IgnorePkg "$lab/pacman.conf" || true

# The verdict pacman puts on stderr is what omarchy-update-system-pkgs saves.
report=$lab/report
PATH="$lab/bin:$PATH" LC_ALL=C pacman -Sup --print-format '%n' 2>"$report" >/dev/null || true
echo "== pacman stderr (the report the handler receives):"
cat "$report"

echo "== handler output at the PR head:"
set +e
PATH="$lab/bin:$omarchy/bin:$PATH" OMARCHY_UPDATE_CONFLICT=1 \
  bash "$omarchy/bin/omarchy-update-system-pkgs-when-conflicted" "$report" 2>&1 |
  sed 's/\x1b\[[0-9;]*m//g'
echo "== handler exit: ${PIPESTATUS[0]}"

Actual output at the reviewed head:

== IgnorePkg lines in the test pacman.conf:
0
== pacman stderr (the report the handler receives):
error: failed to prepare transaction (could not satisfy dependencies)
== handler output at the PR head:

A dependency this upgrade cannot satisfy stopped it:
:: installing aquamarine (0.15.0-2) breaks dependency 'libaquamarine.so=13-64' required by hyprland
:: installing aquamarine (0.15.0-2) breaks dependency 'libaquamarine.so=13-64' required by some-aur-tool

A package held by IgnorePkg in /etc/pacman.conf still requires a version of
something this upgrade wants to replace. Either drop the hold so the two move
together, or hold the dependency at the version the held package was built
against. Until one of those happens, every system upgrade stops here.
== handler exit: 1
Details

Verified:

  • The caller captures only stderr, and pacman prints the verdict on stderr and the :: lines on stdout (src/pacman/sync.c, util.c in pacman 7.1).
  • pacman -Sup as an ordinary user reprints the same :: lines, needs no root or lock, and leaves no db.lck.
  • The new branch cannot catch a conflict report (pacman fails with either conflicting or unsatisfied dependencies in one run), and it neither retries nor moves files.
  • The new tests pass at the head, and the first fails against the base handler.

Optional test improvement: the second new case passes against the base handler when run on its own, and removing both grep '^::' and 2>/dev/null from the re-run still passes the file. A stub that also prints an error: line on stderr and a non-:: line on stdout would pin the filter if the case also asserts that those lines do not reach the output.

Related open PRs: #13538, #13601 and #9285 each change the same spot in this handler and conflict textually with this PR (#9285 also in the test file). If #13538 lands first, this branch has to stay above its exists in filesystem ... || exit 1 line to stay reachable. #9070 (which currently conflicts with the quattro base branch) deletes this handler entirely.


Review information

Test scope: Source and sandbox tests at 19454b8, with real pacman 7.1 on a synthetic root; no real upgrade was run.

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.

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.

4 participants