Skip to content

fix(installer): switch Linux Lemonade install from .deb to PPA - #910

Merged
itomek merged 1 commit into
mainfrom
815-linux-gaia-init-downloads-nonexistent-lemonade-deb-v1001
Apr 27, 2026
Merged

itomek merged 1 commit into
mainfrom
815-linux-gaia-init-downloads-nonexistent-lemonade-deb-v1001

Conversation

@itomek

@itomek itomek commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

Lemonade dropped its .deb GitHub release asset in v10.0.1 and switched to ppa:lemonade-team/stable. GAIA's installer kept synthesising a URL that 404s, breaking gaia init on Linux for every release ≥ 10.0.1 (currently pinned at 10.2.0).

Changes

  • PPA install path (_install_via_ppa): add-apt-repository ppa:lemonade-team/stable → apt-get update (warn-only on failure) → apt-get install lemonade-server. Reports the real installed version from check_installation() rather than the pinned target.
  • Hang prevention: sudo pre-flight (sudo -n true) when running non-interactively so gaia init --yes fails fast with an actionable error instead of hanging for 2 minutes. stdin=subprocess.DEVNULL on every subprocess call.
  • install() signature: installer_path is now Optional[Path] = None. The exists() gate moved inside the Windows branch so Linux dispatch is no longer short-circuited.
  • Callers updated: init_command._install_lemonade and gaia install --lemonade skip download_installer() on Linux and pass installer_path=None.
  • Tests: 9 new TestInstallViaPpa tests (sudo pre-flight, env var, distro gate, missing binary, real version, dispatch), TestUpgradeLemonadeOnLinux, split TestLegacyFallback into Linux/Windows variants. 71 tests total, all passing.
  • Docs: Updated docs/cpp/setup.mdx and docs/plans/setup-wizard.mdx to replace .deb instructions with the PPA flow.

Test plan

  • python -m pytest tests/unit/test_init_command.py — 71 passed
  • python util/lint.py --all — all checks passed
  • Manual: gaia init --yes on Ubuntu 24.04+ installs Lemonade and lemonade-server --version works (no Linux hardware in CI — flagged in PR for maintainer verification)
  • Windows behavior unchanged: install() without a valid MSI path still returns InstallResult(success=False, error="Installer not found: ...")

Closes #815

The .deb GitHub release asset was dropped in Lemonade v10.0.1. Replace
the download-and-install path with ppa:lemonade-team/stable on Linux:
add-apt-repository, apt-get update (warn-only on failure), apt-get install
lemonade-server. Version reported is the real installed version from
check_installation(), not the pinned target.

- install() now accepts installer_path=None (Linux ignores it)
- _install_via_ppa: sudo pre-flight when non-interactive, stdin=DEVNULL
  everywhere to avoid TTY hangs, clear error for missing add-apt-repository
- Callers (init_command, cli.py) skip download_installer() on Linux
- Tests: 9 new TestInstallViaPpa tests, split TestLegacyFallback into
  Linux/Windows variants, delete stale test_get_download_url_linux
- Docs: update cpp/setup.mdx and plans/setup-wizard.mdx to PPA instructions

Fixes #815
@itomek
itomek requested a review from kovtcharov-amd as a code owner April 27, 2026 15:33
@itomek itomek linked an issue Apr 27, 2026 that may be closed by this pull request
5 tasks
@github-actions github-actions Bot added documentation Documentation changes cli CLI changes tests Test changes labels Apr 27, 2026
@kovtcharov

Copy link
Copy Markdown
Contributor

FYI, I had this fixed here but seems your changes are more comprehensive so I'll close mine.

#801

@itomek

itomek commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator Author

Manual verification — Ubuntu 24.04 (t-nx-strx-halo)

Tested on Ubuntu 24.04.4 LTS, passwordless sudo, starting from snap-installed lemonade removed.

Fresh PPA install:

$ gaia install --lemonade --yes --silent
Adding Lemonade PPA and installing lemonade-server...
✅ Installed Lemonade Server v10.2.0

$ which lemonade-server && lemonade-server --version
/usr/bin/lemonade-server
lemonade-server version 10.2.0

Idempotent re-run:

$ gaia install --lemonade --yes --silent
✅ Lemonade Server v10.2.0 is already installed (>= v10.2.0)

gaia init recognizes PPA install:

Step 1/5: Checking Lemonade Server installation...
   ✓ Lemonade Server found: v10.2.0
   ✓ Version is compatible

AC1 ✅ AC2 ✅ AC5 (Windows regression) covered by unit tests ✅

@itomek itomek self-assigned this Apr 27, 2026
@itomek
itomek added this pull request to the merge queue Apr 27, 2026
Merged via the queue into main with commit fb297ca Apr 27, 2026
29 of 30 checks passed
@itomek
itomek deleted the 815-linux-gaia-init-downloads-nonexistent-lemonade-deb-v1001 branch April 27, 2026 15:57
@github-actions github-actions Bot mentioned this pull request May 1, 2026
2 of 5 tasks
pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Jul 30, 2026
…rt (amd#2704)

GAIA builds a Lemonade installer URL that no longer exists: upstream
renamed the Linux `.deb` to carry a distro infix, so the
`lemonade-server_11.5.0_amd64.deb` we construct returns 404 (the real
asset is `lemonade-server_11.5.0-debian13_amd64.deb`). Nothing in the
CLI reaches that path today — Linux installs have gone through the PPA
since amd#910 — but it is public API with nothing verifying it, and the
same code had no macOS branch at all even though upstream ships a
`.pkg`, and no arm64 branch even though upstream ships an arm64 `.deb`.
After this, every URL GAIA can build resolves, macOS on Apple Silicon
installs via `installer -pkg` with the sudo requirement stated before
any prompt appears, and the next upstream rename surfaces as an error
naming the URL and the asset list instead of a 404 mid-download.

Verified against the live `v11.5.0` release:

| Platform | Arch | Asset | HTTP |
|---|---|---|---|
| linux | x86_64 | `lemonade-server_11.5.0_amd64.deb` *(before this PR)*
| **404** |
| linux | x86_64 | `lemonade-server_11.5.0-debian13_amd64.deb` | 200 |
| linux | aarch64 | `lemonade-server_11.5.0-debian13_arm64.deb` | 200 |
| darwin | arm64 | `Lemonade-11.5.0-Darwin.pkg` | 200 |
| windows | AMD64 | `lemonade.msi` | 200 |
| windows | AMD64 | `lemonade-server-minimal.msi` | 200 |

Intel Macs are rejected rather than served that `.pkg` — its payload
binaries are arm64-only (`lipo -archs /usr/local/bin/lemond` → `arm64`)
but it installs happily on Intel, so an unguarded install would exit 0
and only fail later at "Bad CPU type in executable".

## Not yet proven on hardware

The `-debian13` infix is still a hardcoded assumption, just a verified
one. Three claims here rest on asset resolution and mocked control flow,
not on a completed install:

- **No macOS install has ever been executed.** The `.pkg` URL resolves
and the `installer -pkg <path> -target /` argv is pinned by unit tests,
but nobody has run it to completion. First Mac install is unproven.
- **No Linux arm64 install has ever been executed.** The arm64 `.deb`
resolves; the PPA path that Linux actually uses is unchanged by this PR.
- **The macOS uninstall text is derived from the v11.5.0 `.pkg` BOMs**,
not from running the removal steps.

What *is* guarded: `tests/integration/test_lemonade_release_assets.py`
HEADs every URL this code can build and runs in CI as its own step in
`test_unit.yml` (triggered by `src/**`/`tests/**`, so a
`LEMONADE_VERSION` bump fires it). It skips with
`GAIA_SKIP_NETWORK_TESTS=1` or when offline, but **fails rather than
skips when `CI` is set**, so a network blip cannot pass silently.
Verified it catches a hypothetical future rename by pointing the builder
at `debian14`/`ubuntu2404` and at a renamed macOS asset — all three
raised with `definitive=True`.

## Test plan

- [ ] `pytest tests/unit/test_lemonade_download_urls.py -v` —
URL/filename shape for every supported (platform, arch) pair;
unsupported arch, Intel Mac, and unsupported OS each raise; a 404 writes
nothing to disk; a HEAD-rejecting proxy still falls through to a working
GET
- [ ] `pytest tests/unit/test_lemonade_macos_install.py -v` —
installer(8) argv, sudo prefixing, elevation warning ordering, Ctrl-C
cancel, exit-0-but-nothing-installed, timeout
- [ ] `pytest tests/integration/test_lemonade_release_assets.py -v` —
HEADs every constructed URL against the live release; the test that
would have caught the rename
- [ ] `pytest tests/unit/ -k "lemonade or installer"` — 440 passed (2
unrelated `test_hub_installer.py` failures reproduce on `main`; they
need `pip`/`uv` in the venv)
- [ ] `python util/lint.py --black --isort` and `python
util/check_doc_versions.py`
- [ ] On a real Apple Silicon Mac: `gaia init` end to end, confirm the
sudo warning appears *before* the password prompt and that
`lemonade-server` is usable afterwards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI changes documentation Documentation changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linux gaia init downloads nonexistent Lemonade .deb (v10.0.1+)

2 participants