Skip to content

Patch/upgrade - Remove x86 upgrade script, make the Mac upgrade script default for the system, fix readme - #291

Closed
tayowrld wants to merge 4 commits into
omacom:quattrofrom
tayowrld:patch/upgrade
Closed

tayowrld wants to merge 4 commits into
omacom:quattrofrom
tayowrld:patch/upgrade

Conversation

@tayowrld

Copy link
Copy Markdown

Why:

  • The project doesn't need to contain x86 upgrade script
  • Users might run the x86 one instead of the mac one, even despite the caution in docs

What does this PR do:

  • Removes and replaces omarchy-upgrade-to-quattro with omarchy-upgrade-to-quattro-mac
  • Changes docs by correcting cautions and steps

@scottjones

Copy link
Copy Markdown
Collaborator

You are right about the problem — shipping upstream's x86 upgrade on a Mac-only fork is a live footgun, and a warning in docs clearly is not enough. I would like to solve it a different way, for a reason the diff does not show.

Owning upstream's filename costs a permanent merge conflict. bin/omarchy-upgrade-to-quattro has 48 commits upstream, four of them in the last three weeks:

2026-08-25  Write browser theme colour through a passwordless helper
2026-08-24  Stop world-writable browser policy directories
2026-08-24  Don't put the user in the docker group (#8056)
2026-08-13  Free the Copy URL shortcut from ghost extension registrations

Replacing that file's contents makes every one of those a conflict on quattro, forever. This fork already lost three merged PRs to a bad merge resolution last week, so adding guaranteed conflicts to that path is the trade I would rather not take.

A shim gets the same result for one hunk. Nine lines at the top of upstream's script, leaving the rest untouched:

# Apple Silicon: this is upstream's x86 upgrade, which rewrites the mirrorlist
# to x86_64 mirrors and breaks pacman for the whole system. Hand off to the Mac
# upgrade instead of running, whichever name the user reached for.
if [[ $(uname -m) == aarch64 ]]; then
  if command -v omarchy-upgrade-to-quattro-mac >/dev/null; then
    exec omarchy-upgrade-to-quattro-mac "$@"
  fi

  echo "This is the x86 upgrade and would break pacman on Apple Silicon." >&2
  echo "Run the Mac upgrade instead:" >&2
  echo "  curl -fsSL https://raw.githubusercontent.com/omarchy-mac/omarchy-mac/quattro/bin/omarchy-upgrade-to-quattro-mac | bash" >&2
  exit 1
fi

Tested both paths on an M2 Max:

  • Mac script on PATH (the normal case — the package installs /usr/bin/omarchy-upgrade-to-quattro-mac): it execs it with arguments intact, so --yes --ref quattro survive. Typing the wrong command now does the right thing instead of breaking pacman.
  • Mac script absent (piping the raw file into bash on a bare 3.x box): exits 1 with the curl one-liner, and the x86 body never runs.

No renames, so no docs or tests to chase, and upstream's file keeps merging except for one hunk at the very top that upstream rarely touches.

For the record, the current branch also needs mechanical fixes if you would rather keep the rename: test/shell.d/upgrade-to-quattro-mac-test.sh fails (awk: cannot open .../bin/omarchy-upgrade-to-quattro-mac), aarch64-packages-test.sh fails for the same reason, and the renamed script still prints omarchy-upgrade-to-quattro-mac in its own Usage: line and curl one-liner. Also worth knowing #262 modifies the file this deletes, so whichever lands second conflicts.

Happy to open the shim as a small PR crediting you, or you can fold it into this branch — your call. #292 is unaffected and I will look at it separately.

@tayowrld

Copy link
Copy Markdown
Author

@scottjones, Thanks for the review, I'll end my work the suggested way, It's a great move. I'll be able to do the patch in a few hours, 'll try not to forget

@tayowrld

Copy link
Copy Markdown
Author

@scottjones updated the branch with your suggestion. If I get it right, I don't need to change anything else

@scottjones

Copy link
Copy Markdown
Collaborator

This is much better — 15 lines instead of 2600, upstream's file keeps its name and content, and the permanent merge-conflict tax is gone. Tests pass here (upgrade-to-quattro-mac-test.sh, install-mac-test.sh, ./test/cli clean), and the two things that look alarming in that file (a second set -euo pipefail, a second #!/bin/bash) are heredoc contents that quattro already has.

One correction to the framing, which changes what is left to do. quattro already refuses on Apple Silicon — line 121, predating this PR:

[[ $(uname -m) != "aarch64" ]] || fail "This is the upstream x86 upgrade. On Apple Silicon run omarchy-upgrade-to-quattro-mac."

So the footgun was not live: running it on a Mac already stopped with a clear message. What this PR adds is delegation — the command now does the right thing instead of failing. A real improvement, just a smaller one than "users might run the x86 one and break pacman", and it leaves two loose ends.

1. Two guards now, one unreachable. With the shim at the top, control never reaches line 136 on aarch64 — it has either execd or exited. Worth deleting that line and folding its comment into the shim, so one place decides whether the answer is "hand off" or "refuse". Right now the file says both.

2. The docs removal goes too far. Deleting the warning is right — it says "never run this", which is no longer true — but going silent loses the explanation, and someone on an older checkout still has the version that refuses rather than hands off. Something like:

- **Either command works on a Mac.** `omarchy-upgrade-to-quattro` is the
  upstream x86 upgrade, which would repoint pacman at x86_64 mirrors that do
  not serve aarch64. On Apple Silicon it hands off to
  `omarchy-upgrade-to-quattro-mac` instead of running, so either name is fine.
  An older checkout refuses rather than handing off — update first.

With those two, I am happy to merge this.

@tayowrld

Copy link
Copy Markdown
Author

@scottjones done

@scottjones

Copy link
Copy Markdown
Collaborator

Thanks for taking the shim route — this is much cheaper to carry than owning upstream's filename.

One placement problem, and it is my fault for handing you the snippet without saying where it goes: the guard sits above the # omarchy:summary= block, and the metadata parser only reads the first comment block. So the summary is now the first line of the guard comment:

$ bin/omarchy commands --check
Missing metadata summary: omarchy-upgrade-to-quattro
Command metadata check failed (1 issues)

$ bin/omarchy upgrade --help
  omarchy upgrade to quattro    Apple Silicon: this is upstream's x86 upgrade, which rewrites the mirrorlist

Moving the guard to just below # omarchy:requires-sudo=true, before any other code, fixes both — verified here:

Command metadata check passed (453 commands)
  omarchy upgrade to quattro [--yes] [--reboot] [--dev] [--channel stable|rc|edge] [--user USER]
      Upgrade a legacy Omarchy install to the package-backed Omarchy quattro layout.

The guard itself behaves correctly: with omarchy-upgrade-to-quattro-mac on PATH it execs it with arguments intact, and without it exits 1 with the curl line rather than running the x86 body. ./test/cli is clean.

Worth knowing the metadata trap in general — the CLI suite even has a case named "metadata-looking comments after script body are ignored", so anything executable before that block silently costs the command its description.

@malik-na

malik-na commented Sep 9, 2026

Copy link
Copy Markdown
Member

Please rebase onto current quattro and reduce this to the ARM guard and handoff. The whole-file formatting churn obscures the functional change and creates avoidable conflicts in a critical upgrade script.

@wesleygrimes wesleygrimes added the close Close this. Duplicate, superseded, wrong repo, or cannot live on omarchy mainline. label Sep 12, 2026
@malik-na malik-na added the US label Sep 20, 2026
@malik-na

Copy link
Copy Markdown
Member

Closing in favor of upstream merge.

@malik-na malik-na closed this Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

close Close this. Duplicate, superseded, wrong repo, or cannot live on omarchy mainline. US

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants