Skip to content

Make the install entries work where the repo package is missing - #11691

Open
therk wants to merge 1 commit into
omacom:quattrofrom
therk:pkg-available-guard
Open

therk wants to merge 1 commit into
omacom:quattrofrom
therk:pkg-available-guard

Conversation

@therk

@therk therk commented Sep 13, 2026 •

Copy link
Copy Markdown

The Install submenus offer their entries on every machine, but Omarchy's own repositories publish x86_64 only and Arch Linux ARM does not build everything extra does. Each entry carries a disabled: guard, which dims software already installed — nothing asks whether it can be installed at all.

On aarch64 those entries run omarchy-pkg-add against a name pacman cannot resolve: a terminal opens, pacman reports the target as missing, and the entry is still sitting there to pick again. From /var/log/pacman.log — none of these is followed by a transaction:

[PACMAN] Running 'pacman -S --noconfirm --needed lmstudio-bin'
[PACMAN] Running 'pacman -S --noconfirm --needed ollama'
[PACMAN] Running 'pacman -S --noconfirm --needed ghostty'

omarchy-pkg-available asks the sync databases the same question omarchy-pkg-add will put to pacman, so a when: guard drops an entry only where the install could not have worked.

Ghostty and LM Studio have nothing to fall back to on aarch64 — lmstudio-bin is arch=('x86_64'), and ghostty has no -bin package while ghostty-nightly-bin is arch=(x86_64). Both are hidden there and untouched everywhere else. The other three terminals are guarded the same way and stay visible wherever their package resolves.

Ollama does have a fallback: ollama-bin is arch=('x86_64' 'aarch64'), packages upstream's official ollama-linux-arm64 release, and provides=("ollama"). The entry stays and the install reaches for it when the repo has nothing, which moves the GPU selection out of the menu action into omarchy-install-ai-ollama, beside the other AI installers.

disabled: is untouched throughout, so installed software still reads as installed rather than disappearing from the list it was installed from.

Scope

Only entries whose installer is pacman-only and whose package lives in a repository are guarded. The AUR-backed entries (brave-bin, zen-browser-bin, cursor-bin, visual-studio-code-bin, nordvpn-bin, once-bin, …) are deliberately left alone: pacman -Si never resolves an AUR package, so guarding those would hide them on x86_64 too.

That leaves an open question I can't answer from an aarch64 machine: if the [omarchy] repo republishes those *-bin packages for x86_64, they'd be guardable as well. My omarchy.db is an empty 381-byte file because there's no aarch64 content, so someone on x86_64 would need to confirm before extending it.

test/cli passes, including all executable bins have slim self-documenting metadata, and omarchy install ai ollama routes alongside the other AI installers.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ALLhsWEVznJX5Js4CM59ZV

@therk
therk force-pushed the pkg-available-guard branch from 6f47089 to 6dba7e7 Compare September 13, 2026 14:23
@therk therk changed the title Hide install entries whose packages aren't in the repositories Make the AI install entries work where the repo package is missing Sep 13, 2026
The Install submenus offer their entries on every machine, but Omarchy's
repositories publish x86_64 only and Arch Linux ARM does not build
everything extra does. The entries carry a disabled: guard, which dims
software already installed; nothing asks whether it can be installed at
all. On aarch64 those entries run omarchy-pkg-add against a name pacman
cannot resolve: a terminal opens, pacman reports the target as missing,
and the entry is still there to pick again. From pacman.log, none of
these is followed by a transaction:

  Running 'pacman -S --noconfirm --needed lmstudio-bin'
  Running 'pacman -S --noconfirm --needed ollama'
  Running 'pacman -S --noconfirm --needed ghostty'

omarchy-pkg-available asks the sync databases the same question
omarchy-pkg-add will put to pacman, so a when: guard drops an entry only
where the install could not have worked.

Ghostty and LM Studio have nothing to fall back to on aarch64 --
lmstudio-bin is arch=x86_64, and ghostty has no -bin package and a
nightly that is x86_64 only -- so they are hidden there and untouched
everywhere else. The other three terminals are guarded the same way and
stay visible wherever their package resolves.

Ollama does have a fallback. ollama-bin packages upstream's official
linux-arm64 release and provides ollama, so the entry stays and the
install reaches for it when the repo has nothing. That moves the GPU
selection out of the menu action and into omarchy-install-ai-ollama,
beside the other AI installers.

Only entries whose installer is pacman-only and whose package lives in a
repository are guarded. The AUR-backed entries are left alone: pacman
-Si never resolves an AUR package, so guarding those would hide them on
x86_64 too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALLhsWEVznJX5Js4CM59ZV
@therk
therk force-pushed the pkg-available-guard branch from 6dba7e7 to 0d0ec35 Compare September 13, 2026 15:28
@therk therk changed the title Make the AI install entries work where the repo package is missing Make the install entries work where the repo package is missing Sep 13, 2026
@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: Remove > AI > Ollama leaves the fallback's ollama-bin installed but deletes the models and reports success.

Removing Ollama leaves ollama-bin installed

omarchy-pkg-present ollama matches ollama-bin through provides, so Remove offers Ollama, but omarchy-remove-ai-ollama drops only exact names such as ollama-cuda. It still deletes /var/lib/ollama and ~/.ollama and reports success.

Suggested change: add ollama-bin and its split -bin variants to that drop list, with a case in remove-ai-test.sh.

Reproducer (fails at 0d0ec35)

Reproducer: Remove > AI > Ollama cannot uninstall the ollama-bin the new fallback installs

omarchy-install-ai-ollama installs AUR ollama-bin (which provides=("ollama")) when no repo package resolves. The Remove row's guard omarchy-pkg-present ollama resolves through that provide, so the row is offered, but omarchy-remove-ai-ollama only drops the exact names ollama ollama-cuda ollama-rocm ollama-vulkan, and omarchy-pkg-drop matches exact pacman -Qq names.

The script below uses the real pacman against a throwaway local database holding only ollama-bin, and a sudo stub that only logs, so nothing on the system is touched. Save it as remove-ollama-bin.sh and run it from a checkout of the PR head 0d0ec3507cbd10c6585cc6cf363e4661113b1cba with ROOT=$PWD bash remove-ollama-bin.sh.

#!/bin/bash
# Remove > AI > Ollama after the AUR fallback installed ollama-bin.
# Uses the real pacman against a throwaway local database (no system access)
# and a sudo stub that only logs. Run from an omarchy checkout: ROOT=$PWD.
set -euo pipefail
ROOT=${ROOT:-$PWD}
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT

mkdir -p "$tmp/db/local/ollama-bin-0.35.0-1" "$tmp/db/sync" "$tmp/gnupg" "$tmp/bin" "$tmp/home/.ollama"
echo 9 >"$tmp/db/local/ALPM_DB_VERSION"
printf '%%NAME%%\nollama-bin\n\n%%VERSION%%\n0.35.0-1\n\n%%PROVIDES%%\nollama\n\n' >"$tmp/db/local/ollama-bin-0.35.0-1/desc"
: >"$tmp/db/local/ollama-bin-0.35.0-1/files"
printf '[options]\nDBPath = %s/db/\nGPGDir = %s/gnupg\nSigLevel = Never\n' "$tmp" "$tmp" >"$tmp/pacman.conf"

printf '#!/bin/bash\nexec /usr/bin/pacman --config %s/pacman.conf "$@"\n' "$tmp" >"$tmp/bin/pacman"
printf '#!/bin/bash\necho "sudo $*" >>"%s/sudo.log"\n' "$tmp" >"$tmp/bin/sudo"
chmod +x "$tmp/bin/pacman" "$tmp/bin/sudo"
: >"$tmp/sudo.log"

export PATH="$tmp/bin:$ROOT/bin:$PATH" HOME="$tmp/home"

echo "installed: $(pacman -Qq | tr '\n' ' ')"
if omarchy-pkg-present ollama; then
  echo "Remove > AI > Ollama is offered (when: omarchy-pkg-present ollama succeeds)"
fi
omarchy-remove-ai-ollama
echo "privileged calls:"
sed 's/^/  /' "$tmp/sudo.log"
echo "installed after: $(pacman -Qq | tr '\n' ' ')"
if grep -q -- '-Rns' "$tmp/sudo.log"; then
  echo "PASS: the package was removed"
else
  echo "FAIL: nothing was uninstalled; ollama-bin is still installed"
  exit 1
fi

Actual output at the PR head (stdout; exit status 1):

installed: ollama-bin 
Remove > AI > Ollama is offered (when: omarchy-pkg-present ollama succeeds)

Ollama and its models have been removed.
privileged calls:
  sudo systemctl disable --now ollama.service
  sudo rm -rf /var/lib/ollama
installed after: ollama-bin 
FAIL: nothing was uninstalled; ollama-bin is still installed

The same output was produced on the PR merged onto quattro 8b4eae6 (its omarchy-pkg-drop also matches exact names). Deleting /var/lib/ollama while ollama-bin stays installed also removes a directory that package owns.

test/shell.d/menu-test.sh now fails

It asserts install.service.chromium-account is the only Install row with when:, the docs/menu.md Guards convention. The five new guards break it, so ./test/shell fails at this head.

Suggested change: update the test and docs/menu.md to allow an availability when: on Install rows.

Reproducer (fails at 0d0ec35)

Reproducer: test/shell.d/menu-test.sh fails at the PR head

The repository's own menu test already covers this. From a checkout of the PR head 0d0ec3507cbd10c6585cc6cf363e4661113b1cba (needs node):

bash test/shell.d/menu-test.sh; echo "exit $?"

Actual output (last stdout line, then stderr):

ok - menu removes Crush from Install > AI
expected: ["install.service.chromium-account"]
actual:   ["install.service.chromium-account","install.terminal.alacritty","install.terminal.foot","install.terminal.ghostty","install.terminal.kitty","install.ai.lm-studio"]
not ok - menu never hides an Install row because the software is already there
exit 1

The same file passes at the merge base 692c02c and at quattro 8b4eae6. The assertion is test/shell.d/menu-test.sh lines 269-279 at the head; docs/menu.md (Guards) states the convention it enforces ("Install rows should therefore carry disabled: with the presence check, not when: ... menu-test.sh enforces the Install side of this convention").

More findings

An installed Ghostty or LM Studio can vanish from Install

A false when: hides a row before disabled: is read. A terminal installed from a package no sync database carries (for example AUR ghostty-git on Arch Linux ARM) now disappears instead of reading as installed.

Suggested change: guard as omarchy-pkg-present X || omarchy-pkg-available X.

Reproducer (fails at 0d0ec35):

Reproducer: an installed terminal disappears from Install when no sync database carries its package

MenuModel.isVisible hides a row whenever its when: answered false, before disabled: is consulted (shell/plugins/menu/MenuModel.js lines 255-257 at the head). With the new when: omarchy-pkg-available ghostty, a machine where Ghostty is installed from a package no sync database carries loses the row, instead of keeping it dimmed and marked as installed. ghostty-git (AUR, arch=(x86_64 aarch64 i686), provides=ghostty) on Arch Linux ARM, which has no ghostty package, is one such case.

The script uses the real pacman against throwaway databases (local: ghostty-git providing ghostty; sync: only foot), the shipped menu's own guard script and isVisible. Save it as installed-row-hidden.sh and run it from a checkout with ROOT=$PWD bash installed-row-hidden.sh (needs node).

#!/bin/bash
# Install > Terminal > Ghostty on a machine where Ghostty is installed from a
# package no sync database carries (ghostty-git, which provides ghostty, is
# built for aarch64). Real pacman against throwaway databases; the shipped
# menu's own guard script and visibility logic decide the row.
# Run from an omarchy checkout: ROOT=$PWD (needs node).
set -euo pipefail
ROOT=${ROOT:-$PWD}
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT

mkdir -p "$tmp/db/local/ghostty-git-1.3.1-1" "$tmp/db/sync" "$tmp/gnupg" "$tmp/bin" "$tmp/repo/foot-1.0-1"
echo 9 >"$tmp/db/local/ALPM_DB_VERSION"
printf '%%NAME%%\nghostty-git\n\n%%VERSION%%\n1.3.1-1\n\n%%PROVIDES%%\nghostty\n\n' >"$tmp/db/local/ghostty-git-1.3.1-1/desc"
: >"$tmp/db/local/ghostty-git-1.3.1-1/files"
printf '%%FILENAME%%\nfoot-1.0-1-aarch64.pkg.tar.zst\n\n%%NAME%%\nfoot\n\n%%VERSION%%\n1.0-1\n\n%%ARCH%%\naarch64\n\n' >"$tmp/repo/foot-1.0-1/desc"
(cd "$tmp/repo" && tar -czf "$tmp/db/sync/extra.db" *)
printf '[options]\nDBPath = %s/db/\nGPGDir = %s/gnupg\nSigLevel = Never\n[extra]\nServer = file:///nonexistent\n' "$tmp" "$tmp" >"$tmp/pacman.conf"
printf '#!/bin/bash\nexec /usr/bin/pacman --config %s/pacman.conf "$@"\n' "$tmp" >"$tmp/bin/pacman"
chmod +x "$tmp/bin/pacman"
export PATH="$tmp/bin:$ROOT/bin:$PATH"

ROOT="$ROOT" node -e '
  const fs = require("fs"), path = require("path"), { execFileSync } = require("child_process")
  const menu = require(path.join(process.env.ROOT, "shell/plugins/menu/MenuModel.js"))
  const items = menu.parseMenuJsonc(fs.readFileSync(path.join(process.env.ROOT, "default/omarchy/omarchy-menu.jsonc"), "utf8"))
  const row = items.find(item => item.id === "install.terminal.ghostty")
  console.log("when:     " + row.when)
  console.log("disabled: " + row.disabled)
  const out = execFileSync("bash", ["-c", menu.guardScript({ [row.id]: row })], { encoding: "utf8" })
  console.log(out.trim())
  const when = {}, disabled = {}
  for (const line of out.trim().split("\n")) {
    const [id, tag, value] = line.split(":")
    if (tag === "w") when[id] = value === "1"
    if (tag === "d") disabled[id] = value === "1"
  }
  const visible = menu.isVisible({ [row.id]: row }, [row.id], when, row)
  console.log("installed (disabled: succeeded): " + disabled[row.id])
  console.log("row visible: " + visible)
  if (disabled[row.id] && !visible) { console.log("FAIL: an installed terminal vanished from Install instead of reading as installed"); process.exit(1) }
'

Actual output at the PR head 0d0ec3507cbd10c6585cc6cf363e4661113b1cba (exit status 1; identical on the PR merged onto quattro 8b4eae6):

when:     omarchy-pkg-available ghostty
disabled: omarchy-pkg-present ghostty
install.terminal.ghostty:w:0
install.terminal.ghostty:d:1
installed (disabled: succeeded): true
row visible: false
FAIL: an installed terminal vanished from Install instead of reading as installed

Actual output at the merge base 692c02c (exit status 0):

when:     
disabled: omarchy-pkg-present ghostty
install.terminal.ghostty:d:1
installed (disabled: succeeded): true
row visible: true

With the row's guard changed to omarchy-pkg-present ghostty || omarchy-pkg-available ghostty (same harness, PR head), the guard reports install.terminal.ghostty:w:1 and the row stays visible and dimmed.

Each availability guard adds a pacman -Si fork to every menu open

The guard batch runs on every menu load and open. Presence checks are answered in-process from one pacman -Q snapshot, but each omarchy-pkg-available row forks the helper plus a pacman -Si that loads every sync database. On one x86_64 machine the five new guard lines took a median of 751 ms per batch, against 98 ms for the existing presence prelude and 158 ms for one pacman -Slq.

Suggested change: answer omarchy-pkg-available inside the guard helpers from one pacman -Sl snapshot, built only when a guard uses it (not implemented or measured here; #13362 has a cached pacman -Slq version of this helper).

Measurement:

Measurement: cost of the five when: omarchy-pkg-available ... guards in the menu's guard batch

Every when: in the menu runs in one bash batch on each (re)load and each open (Menu.qml evaluateGuards, called from openExistingMenu). Presence checks are answered in-process from one pacman -Q snapshot (MenuModel.js guardHelpers); omarchy-pkg-available is not, so each of the five new rows forks the helper, which runs a separate pacman -Si that loads every sync database.

Measured with the script below (run from a checkout of the PR head 0d0ec3507cbd10c6585cc6cf363e4661113b1cba; REVIEW_OUTPUT is any writable directory; needs node, pacman, pacman-conf, gawk; all pacman calls are read-only queries). It extracts the exact guard lines and prelude that MenuModel.guardScript generates for the shipped menu and times them 9 times each, alongside single pacman calls.

#!/bin/bash
# Cost of the PR's `when: omarchy-pkg-available ...` guards, measured with the
# real pacman reading this machine's sync databases (read-only; -Si takes no
# lock). usage: timing.sh <head-source-root> [rounds]
set -u
HEAD="$1"
ROUNDS="${2:-7}"
out="$REVIEW_OUTPUT/timing"
mkdir -p "$out"
ulimit -c 0
export PATH="$HEAD/bin:$PATH"
export OMARCHY_PATH="$HEAD"

pacman-conf --repo-list >"$out/repos.txt" 2>&1 || true
ls -l /var/lib/pacman/sync/ >"$out/syncdir.txt" 2>&1 || true
uname -m >"$out/arch.txt"

# The guard lines MenuModel generates for the head menu's pkg-available rows,
# and the existing prelude (one pacman -Qq/-Qi snapshot) for comparison.
OUT="$out" ROOT="$HEAD" node -e '
  const fs = require("fs"), path = require("path")
  const menu = require(path.join(process.env.ROOT, "shell/plugins/menu/MenuModel.js"))
  const items = menu.parseMenuJsonc(fs.readFileSync(path.join(process.env.ROOT, "default/omarchy/omarchy-menu.jsonc"), "utf8"))
  const sub = {}
  for (const it of items) if (it.when && it.when.includes("omarchy-pkg-available")) sub[it.id] = { id: it.id, when: it.when }
  const script = menu.guardScript(sub)
  const lines = script.split("\n").filter(l => l.startsWith("if { ")).join("\n") + "\n"
  const prelude = script.split("\n").filter(l => !l.startsWith("if { ")).join("\n") + "\n"
  fs.writeFileSync(path.join(process.env.OUT, "available-lines.sh"), lines)
  fs.writeFileSync(path.join(process.env.OUT, "prelude.sh"), prelude)
' 2>"$out/node.stderr"
echo "node exit: $?" >>"$out/node.stderr"

measure() {
  local name="$1" script="$2" i start end rc
  for ((i = 1; i <= ROUNDS; i++)); do
    start=$(date +%s%N)
    bash -c "$script" >"$out/$name.last.stdout" 2>"$out/$name.last.stderr"
    rc=$?
    end=$(date +%s%N)
    printf '%s\t%d\t%d\t%d\n' "$name" "$i" "$rc" $(( (end - start) / 1000000 )) >>"$out/timings.tsv"
  done
}

: >"$out/timings.tsv"
measure prelude_snapshot "$(<"$out/prelude.sh")"
measure five_pkg_available_guards "$(<"$out/available-lines.sh")"
measure one_pacman_Si_single 'pacman -Si alacritty'
measure one_pacman_Si_five 'pacman -Si alacritty foot ghostty kitty lmstudio-bin'
measure one_pacman_Slq 'pacman -Slq'

# medians (ms)
awk -F'\t' '{ v[$1] = v[$1] " " $4 } END { for (k in v) { n = split(v[k], a, " "); asort(a); printf "%s\tmedian_ms=%d\tmin_ms=%d\tmax_ms=%d\tn=%d\n", k, a[int((n + 1) / 2)], a[1], a[n], n } }' "$out/timings.tsv" | sort >"$out/summary.tsv"
cat "$out/available-lines.sh" "$out/summary.tsv" "$out/repos.txt" "$out/arch.txt"

Actual output on an x86_64 Omarchy machine (repositories core, extra, multilib, omarchy; extra.db 8.9 MB), with bash timing.sh "$PWD" 9:

if { omarchy-pkg-available alacritty; } >/dev/null 2>&1; then echo install.terminal.alacritty:w:1; else echo install.terminal.alacritty:w:0; fi
if { omarchy-pkg-available foot; } >/dev/null 2>&1; then echo install.terminal.foot:w:1; else echo install.terminal.foot:w:0; fi
if { omarchy-pkg-available ghostty; } >/dev/null 2>&1; then echo install.terminal.ghostty:w:1; else echo install.terminal.ghostty:w:0; fi
if { omarchy-pkg-available kitty; } >/dev/null 2>&1; then echo install.terminal.kitty:w:1; else echo install.terminal.kitty:w:0; fi
if { omarchy-pkg-available lmstudio-bin; } >/dev/null 2>&1; then echo install.ai.lm-studio:w:1; else echo install.ai.lm-studio:w:0; fi
five_pkg_available_guards	median_ms=751	min_ms=721	max_ms=799	n=9
one_pacman_Si_five	median_ms=158	min_ms=152	max_ms=162	n=9
one_pacman_Si_single	median_ms=149	min_ms=145	max_ms=152	n=9
one_pacman_Slq	median_ms=158	min_ms=146	max_ms=169	n=9
prelude_snapshot	median_ms=98	min_ms=93	max_ms=102	n=9
core
extra
multilib
omarchy
x86_64

Reading: the five generated guard lines take a median of about 0.75 s per batch, against about 0.1 s for the existing prelude that answers every presence row in the menu, and about 0.16 s for a single pacman -Slq (or a single pacman -Si over all five names). Each menu open shows the previous batch's answers until the new batch finishes, so this is added to how long a row can be stale, and to the CPU spent per open. Absolute numbers depend on the machine and on how many sync databases are configured.

omarchy-pkg-available --help reads as available

pacman -Si --help prints usage and exits 0, so omarchy-pkg-available --help returns true. Current quattro (b72d7e5, "Treat command operands as literal values") passes -- in omarchy-pkg-add, -aur-add, -present and -missing; this helper predates that. No shipped guard passes such a name.

Suggested change: use pacman -Si -- "$pkg" and add a case to command-operand-boundaries-test.sh.

Reproducer (last row; fails at 0d0ec35):

Reproducer: what omarchy-pkg-available answers versus what omarchy-pkg-add resolves

pacman -Si matches exact package names only (pacman src/pacman/sync.c, sync_info, a strcmp over each sync db's package cache). pacman -S, which omarchy-pkg-add runs, also resolves virtual provides, groups and version constraints (process_target / process_targname: alpm_find_dbs_satisfier, then the group fallback). For the five names this PR guards the two agree; the helper's comment and summary claim more than that. An option-shaped argument also reads as available because pacman -Si --help prints usage and exits 0 (current quattro passes -- in omarchy-pkg-add, -aur-add, -present and -missing after "Treat command operands as literal values").

The script uses the real pacman against a throwaway sync database (alacritty; gvim providing vim; ttf-a in group fontgroup) and touches nothing on the system. Save it as pkg-available-semantics.sh and run it from a checkout of the PR head with ROOT=$PWD bash pkg-available-semantics.sh.

#!/bin/bash
# What omarchy-pkg-available answers versus what `pacman -S` (omarchy-pkg-add)
# resolves, using the real pacman against a throwaway sync database.
# Run from an omarchy checkout: ROOT=$PWD.
set -uo pipefail
ROOT=${ROOT:-$PWD}
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT

mkdir -p "$tmp/db/local" "$tmp/db/sync" "$tmp/gnupg" "$tmp/bin" "$tmp/repo"
echo 9 >"$tmp/db/local/ALPM_DB_VERSION"
entry() { # name provides group
  mkdir -p "$tmp/repo/$1-1.0-1"
  {
    printf '%%FILENAME%%\n%s-1.0-1-any.pkg.tar.zst\n\n%%NAME%%\n%s\n\n%%VERSION%%\n1.0-1\n\n%%ARCH%%\nany\n\n' "$1" "$1"
    [[ -n $2 ]] && printf '%%PROVIDES%%\n%s\n\n' "$2"
    [[ -n $3 ]] && printf '%%GROUPS%%\n%s\n\n' "$3"
  } >"$tmp/repo/$1-1.0-1/desc"
}
entry alacritty "" ""
entry gvim "vim=9.2" ""
entry ttf-a "" fontgroup
(cd "$tmp/repo" && tar -czf "$tmp/db/sync/extra.db" *)
printf '[options]\nDBPath = %s/db/\nGPGDir = %s/gnupg\nSigLevel = Never\n[extra]\nServer = file:///nonexistent\n' "$tmp" "$tmp" >"$tmp/pacman.conf"
printf '#!/bin/bash\nexec /usr/bin/pacman --config %s/pacman.conf "$@"\n' "$tmp" >"$tmp/bin/pacman"
chmod +x "$tmp/bin/pacman"
export PATH="$tmp/bin:$ROOT/bin:$PATH"

printf '%-14s %-22s %s\n' target omarchy-pkg-available "pacman -S resolves to"
for target in alacritty vim fontgroup 'alacritty>=1' --help; do
  omarchy-pkg-available "$target" >/dev/null 2>&1 && avail=true || avail=false
  if [[ $target == -* ]]; then
    resolved="(not a package)"
  else
    resolved=$(pacman -Sp -dd --print-format '%n' -- "$target" 2>&1 | tr '\n' ' ')
  fi
  printf '%-14s %-22s %s\n' "$target" "$avail" "$resolved"
done

Actual output at the PR head 0d0ec3507cbd10c6585cc6cf363e4661113b1cba (identical on the PR merged onto quattro 8b4eae6):

target         omarchy-pkg-available  pacman -S resolves to
alacritty      true                   alacritty 
vim            false                  gvim 
fontgroup      false                  ttf-a 
alacritty>=1   false                  alacritty 
--help         true                   (not a package)

Real-world instance of the provides gap: on Arch Linux ARM aarch64 (mirror databases fetched 2026-10-01), linux-headers and libappindicator-gtk3 exist only as provides (linux-aarch64-headers, libappindicator), and both are installed by existing Install rows (Xbox Controllers, Dropbox). Neither row is guarded by this PR.

The success message suggests a command that fails until the service runs

omarchy-install-ai-ollama ends with "Pull a model with: ollama pull llama3.2". In ollama v0.35.0, pull first checks for a running server and on Linux exits with "could not connect to ollama server", and neither the script nor either package's install hooks enable ollama.service. Checked against source, not run.

Suggested change: mention sudo systemctl enable --now ollama in the message, or start the service in the script.

Details

Verified (installs, sudo and yay stubbed):

  • With real pacman 7.1.0 on synthetic databases: on x86_64 the installer picks ollama-cuda, ollama-rocm or ollama through pacman as before. On aarch64 with no repo ollama* it installs ollama-bin through yay. A failed install exits 1 before the success message.
  • All five guarded names resolve on an x86_64 machine's real databases (lmstudio-bin from [omarchy]), so nothing is hidden there. The fetched Arch Linux ARM aarch64 databases have no ghostty or lmstudio-bin and do have alacritty, foot and kitty, so there the guards hide Ghostty and LM Studio and keep the other three.
  • test/cli passes at the head, and omarchy install ai ollama and omarchy pkg available are listed by omarchy commands.
  • pacman -Si takes no database lock, so the guard does not wait on a running update.
  • The head merges onto current quattro without conflicts.

Tests: menu-test.sh runs under ./test/shell, not test/cli. In the sandbox, the only ./test/shell file that fails at the head but not at the merge base is menu-test.sh, and the same holds for the head merged onto quattro versus quattro. menu-guards-test.sh passes.

Related open PRs:

Notes on the PR text:

  • The helper comment says it asks "the same question omarchy-pkg-add will put to pacman". -Si matches exact names only, while -S also resolves provides, groups and version constraints (see the semantics reproducer above). The answers agree for the five guarded names.
  • "Omarchy's own repositories publish x86_64 only" is out of date: pkgs.omarchy.org serves an aarch64 omarchy.db for stable, rc and edge (fetched 2026-10-01). None of the guarded names is in it.
  • On the open question in the PR body: visual-studio-code-bin, cursor-bin, nordvpn-bin and once-bin are installed with omarchy-pkg-add (pacman), and all six named packages are in the x86_64 [omarchy] database, so pacman -Si resolves them on x86_64. brave-bin and zen-browser-bin install through yay, so an availability guard would hide them wherever no repository carries them even though the AUR could build them.
  • "minus the GPU variants": the ollama-bin package base also builds ollama-cuda12-bin, ollama-cuda13-bin and ollama-vulkan-bin for aarch64.

Review information

Test scope: Source and sandboxed tests at 0d0ec35 (real pacman, synthetic databases, stubbed installs); not run on aarch64.

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.

@jandrusk

Copy link
Copy Markdown

Nice ARM/out-of-tree package gate — omarchy-pkg-available looks like the right primitive. Two notes: (1) Ollama still chooses ollama-cuda from nvidia-smi presence (#10380 / #10472 territory); worth aligning with whatever lands there. (2) AUR ollama-bin fallback on aarch64 is intentional here — flagging so maintainers are happy with that path.

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.

5 participants