Skip to content

fix(installer): fall back to GitHub when packages are missing from native repos - #186

Closed
Elieser007 wants to merge 1 commit into
Gentleman-Programming:mainfrom
Elieser007:fix/installer-arch-github-fallback
Closed

Elieser007 wants to merge 1 commit into
Gentleman-Programming:mainfrom
Elieser007:fix/installer-arch-github-fallback

Conversation

@Elieser007

Copy link
Copy Markdown

Summary

  • Fixes the shell install steps (fish/zsh/nushell) on Arch/Fedora/Debian when a package is not available in the native package manager repositories.
  • The installer now checks per-package availability against the native manager (pacman -Si / dnf info / apt-cache show) before running the install transaction, which previously aborted entirely when a single package was unknown.
  • Packages the native manager cannot provide are installed from GitHub instead: carapace (binary from carapace-bin releases, verified against the official asset digest from the GitHub API — the same SHA256 the project publishes in its checksums.txt) and zsh-theme-powerlevel10k (cloned to /usr/share/powerlevel10k, a path the bundled .zshrc already sources).

Motivation

On vanilla Arch and Fedora, carapace is not in the official repositories, and zsh-theme-powerlevel10k is only present in some repositories (e.g. CachyOS). Running pacman -S --needed --noconfirm fish carapace zoxide atuin starship fails entirely with error: no se ha encontrado el paquete: carapace, aborting the whole shell install step.

The runtime availability check means distros that DO provide the packages (CachyOS provides zsh-theme-powerlevel10k) install them natively; others fall back to GitHub — no hardcoding per distro and no AUR helper dependency.

Changes

File Change
installer/internal/tui/installer.go Add GitHub field to platformPackages; per-package availability check (packageAvailableInRepo) with graceful degrade to the native manager; installNativeWithGitHubFallback; installCarapaceBinary (latest release resolved via GitHub API, verified against the official digest); installPowerlevel10k; tar.gz binary extraction helper.
installer/internal/tui/platform_packages_test.go Mocks now model the real system.Run contract; tests for missing→GitHub, CachyOS-style native p10k, infra degrade, apt quirks, missing-without-fallback error, and brew fallback.

Test Plan

  • go build ./... passes
  • go vet ./... passes
  • go test ./installer/... -skip 'Golden' passes (TestOSSelectGolden is a pre-existing environmental failure on Linux — the golden was generated on macOS; it fails on main without this change too)
  • End-to-end: carapace asset download + digest verification against the official GitHub API digest
  • Manual validation on real CachyOS: fish step installs carapace from GitHub and the zsh step installs zsh-theme-powerlevel10k natively from the cachyos repo; installer completes successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant