Skip to content

Install Zed from upstream when the repo has no zed package - #14324

Closed
AnPod wants to merge 3 commits into
omacom:quattrofrom
AnPod:fix/issue-12625
Closed

AnPod wants to merge 3 commits into
omacom:quattrofrom
AnPod:fix/issue-12625

Conversation

@AnPod

@AnPod AnPod commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #12625.

omarchy install editor zed runs omarchy-pkg-add zed omazed as one pacman transaction. On aarch64 the omarchy repo publishes omazed (arch=any) but no zed package, so pacman aborts the whole transaction and neither Zed nor omazed gets installed.

What changed

  • bin/omarchy-install-editor-zed: if pacman -Si zed resolves, keep the existing omarchy-pkg-add zed omazed transaction (x86_64 behaviour unchanged). Otherwise install omazed on its own and fall back to Zed's official installer (https://zed.dev/install.sh), which ships aarch64 Linux builds. omazed setup and the launch step are unchanged.
  • test/shell.d/zed-install-test.sh: new test covering both paths (repo package available vs. unavailable) with stubbed pacman, omarchy-pkg-add and curl.
  • test/shell.d/desktop-entry-launch-test.sh: stub pacman so the existing installer launch test keeps exercising the package path.

Testing

  • bash test/shell.d/zed-install-test.sh: 2 ok
  • bash test/shell.d/desktop-entry-launch-test.sh: all ok
  • bash -n and shellcheck on the changed script: clean

@greptile-apps

greptile-apps Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Changes editor installation logic for fallback scenarios.

The PR is not ready to merge because an x86_64 system without a resolvable zed package cannot use the new fallback.

Findings

  1. P1 Missing Zed blocks installation ▶

Summary

The PR adds an upstream Zed fallback when the repository lacks zed, expands installer tests, and adds Dell XPS 13 Panther Lake speaker-firmware installation and migration.

  • The fallback remains unreachable on x86_64 when zed is unavailable.
  • The previously reported Zed alias findings have resolved threads; the dangling-link case is now covered by the replacement and test.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Install Zed] --> B{x86_64 or pacman resolves zed?}
  B -->|Yes| C[Install zed and omazed together]
  B -->|No| D[Install omazed, then upstream Zed]
  C --> E[Apply theme and launch]
  D --> E
Loading

Reviews (3) · Last reviewed commit: "Always use the package on x86_64 and rep..." · Reviewed by Greptile

Comment thread bin/omarchy-install-editor-zed Resolved
Comment thread test/shell.d/zed-install-test.sh Resolved
Comment thread bin/omarchy-install-editor-zed Resolved
@jandrusk

jandrusk commented Oct 6, 2026

Copy link
Copy Markdown

Thanks for tackling #12625! Two things:

  1. Gate on architecture, not on pacman -Si zed. pacman -Si also fails when the sync DB is stale or missing, or the mirror is unreachable. When that happens on x86_64, this would quietly switch to running a remote installer instead of failing loudly. Something like:

    if [[ $(uname -m) == "x86_64" ]]; then
      omarchy-pkg-add zed omazed
    else
      omarchy-pkg-add omazed || exit 1
      ...
    fi

    (or omarchy-hw-x86-64, if that's the helper Install menu: gate eight x86_64-only rows on omarchy-hw-x86-64 #11025 introduces). Related: Install menu: gate eight x86_64-only rows on omarchy-hw-x86-64 #11025 takes the other approach and hides x86_64-only install rows on ARM, so it's worth deciding which way Zed should go.

  2. curl | sh from zed.dev installs an unpackaged, self-updating binary into ~/.local/bin, outside pacman. omarchy-install-dev-env does the same for uv, so there's precedent, but I'd leave the decision to maintainers versus shipping an aarch64 zed in the omarchy repo.

Small nit: ln -s zed "$HOME/.local/bin/zeditor" fails if a dangling zeditor link is left over from an earlier attempt. ln -sfn avoids that.

@TravonteD

TravonteD commented Oct 6, 2026 •

Copy link
Copy Markdown

An alternative solution to this is to package zed in the omarchy-pkgs repo for aarch64, so that there's no need to work around it.

Edit: Looks like the omarchy-mac guys also ran into this and added it https://github.com/omacom/omarchy-pkgs/blob/master/pkgbuilds/zed/PKGBUILD

AnPod and others added 3 commits October 7, 2026 07:26
On aarch64 the omarchy repo publishes omazed but no zed package, so the
single 'omarchy-pkg-add zed omazed' transaction aborted and neither got
installed. Keep the existing transaction when zed is available; otherwise
install omazed on its own and use Zed's official installer.

Fixes omacom#12625
Omarchy's default-editor flow launches zeditor, but zed.dev/install.sh
only installs ~/.local/bin/zed. Link zeditor to it when no zeditor is on
PATH, and make the test's mock installer create the zed CLI so the command
Omarchy runs is checked.
A failing pacman -Si (stale sync DB, unreachable mirror) no longer sends
x86_64 to the remote installer; only non-x86_64 without a zed package
falls back. ln -sfn replaces a broken zeditor entry left by an earlier
attempt.

echo "Installing Zed Editor..."
omarchy-pkg-add zed omazed
if [[ $(uname -m) == "x86_64" ]] || pacman -Si zed &>/dev/null; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Missing Zed blocks installation

If the configured repository has omazed but no zed package on x86_64, this condition skips the availability check and tries to install both packages in one transaction. That transaction fails, so neither package is installed and the upstream fallback never runs.

Suggested change
if [[ $(uname -m) == "x86_64" ]] || pacman -Si zed &>/dev/null; then
if pacman -Si zed &>/dev/null; then

@jandrusk

jandrusk commented Oct 7, 2026

Copy link
Copy Markdown

Thanks, re-checked: x86_64 now always uses the package, and the dangling zeditor link is handled with ln -sfn. LGTM.

On Greptile's P1: failing loudly on x86_64 when zed is missing is what I was going for, so I wouldn't switch back to pacman -Si. The upstream installer vs. shipping an aarch64 zed in omarchy-pkgs (which already seems to exist) is still the maintainers' call.

@jandrusk

jandrusk commented Oct 7, 2026

Copy link
Copy Markdown

Thanks, x86_64 now always goes through the package, and ln -sfn handles the dangling link. I'd ignore Greptile's suggestion to go back to pacman -Si zed there: zed is in extra on x86_64, and gating on pacman -Si brings back the stale-DB fallback to curl | sh.

Following up on @TravonteD's note: omacom/omarchy-pkgs has shipped an aarch64 zed vendor package since 09-24 (pkgbuilds/zed, now 1.22.0). If it's published in the aarch64 repo, omarchy-pkg-add zed omazed should just work on ARM, and the upstream-installer branch (with its unpackaged, self-updating binary in ~/.local/bin) wouldn't be needed. Could you check pacman -Si zed on an aarch64 install with current mirrors? If it resolves, this PR could shrink to nothing, or to closing #12625 once the package is live.

@omarchybot omarchybot added the bug Something isn't working label Oct 16, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for picking up #12625. The bug it describes was real when the issue was filed, but it has since been fixed in packaging, so this change should no longer be needed.

What closes it: omacom/omarchy-pkgs#612 (merged 2026-09-24) added an aarch64 zed package, repacked from Zed's official aarch64 release under the same name Arch uses on x86_64 (pkgbuilds/zed, now 1.24.2). Both ARM pacman templates on quattro, default/pacman/aarch64/pacman-edge.conf and default/pacman/aarch64-apple/pacman-edge.conf, read [omarchy] from https://pkgs.omarchy.org/edge/$arch, so on an ARM install with current package databases omarchy-pkg-add zed omazed resolves both packages and the existing script works unchanged. Omarchy's AGENTS.md (Platforms) asks for exactly this: a package missing on one platform is fixed by building it, and a per-platform workaround is the last resort.

With the package published, the new branch here runs only when the local sync database predates it, and then it does something worse than failing: it installs a self-updating Zed under ~/.local that pacman does not manage, and its user-level desktop entry keeps shadowing the packaged Zed after a later pacman -Syu and reinstall. That is the main reason not to keep the fallback as a safety net.

What was checked: the diff read against quattro at 8a787b6; the ARM pacman templates and the omarchy-pkgs zed recipe; and the full ./test/cli suite plus test/shell.d/zed-install-test.sh and test/shell.d/desktop-entry-launch-test.sh run on an x86_64 Omarchy worker at 56c46ed, all passing. The aarch64 path itself could not be run, since the workers are x86_64, and the package's presence on the live mirror was not re-checked from this machine. Codex Medium reviewed it as a second opinion and agreed the packaging makes it unnecessary (independence not guaranteed); on its own it found the desktop-entry shadowing above, and that the new test stubs omazed and setsid, so it would still pass with setup or launch removed.

This now waits on the maintainer, with a recommendation to close it alongside #12625 once an ARM install confirms the packaged Zed installs.

AnPod commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Closing, already fixed upstream via omacom/omarchy-pkgs#612.

@AnPod AnPod closed this Oct 23, 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.

omarchy install editor zed fails on aarch64: 'zed' package not found

4 participants