Skip to content

Conversation

@jwbron
Copy link

@jwbron jwbron commented Oct 20, 2025

Summary:

Adds comprehensive support for Fedora-based distributions (including Asahi Fedora Remix) and ARM64 architecture on Linux, enabling Khan Academy developers to use setup scripts on Fedora systems and Apple Silicon running Asahi Linux.

Changes

Core Infrastructure (shared-functions.sh)

  • Added detect_linux_distro() - Detects Ubuntu/Debian vs Fedora (supports derivatives via ID_LIKE)
  • Added get_arch() - Normalizes architecture names (arm64/aarch64 → aarch64)
  • Added pkg_install(), pkg_update() - Package manager abstraction (apt-get vs dnf)
  • Added map_package_name() - Maps package names between distributions
  • Added is_mac(), is_linux(), is_arm() - Platform detection helpers

Linux Setup (linux-setup.sh)

  • Java: Uses java-11-openjdk-devel, auto-sets default via alternatives
  • Go: Uses Fedora's native packages (no PPA needed)
  • Node.js: Handles version conflicts, installs NodeSource 20.x, auto-removes Fedora nodejs
  • Repositories: NodeSource for Node 20.x, Chrome for x86_64 only (Chromium on ARM64)
  • Packages: Complete Ubuntu→Fedora mappings (e.g., libfreetype6-devfreetype-devel)
  • Watchman: Builds from source with Fedora dependencies, graceful fallback on failure
  • PostgreSQL: Uses systemctl, fixes SELinux context, handles permission checks with sudo
  • Fastly: Downloads ARM64 RPMs for aarch64
  • Services: Uses chronyd instead of ntp, systemctl instead of service
  • Optional packages: Uses --skip-unavailable for packages not on all architectures

Google Cloud SDK (setup-gcloud.sh)

  • Fixed ARM64 detection: macOS ARM uses Rosetta (x86_64), Linux ARM uses native (arm)
  • Auth check moved after installation, checks both regular auth AND application-default credentials

Main Setup (setup.sh)

  • Fixed pnpm installation to use sudo corepack enable on Linux
  • Updated to use new helper functions

Known Limitations

  • Chrome not available for ARM64 Linux (uses Chromium instead)
  • Some optional packages may be unavailable on certain Fedora versions (handled gracefully)

Issue: INFRA-XXXX

Test plan:

  • Tested on Asahi Fedora Remix 41 (aarch64) on Apple M1 (ran make install then git pr to open this pr)
  • Backward compatible with Ubuntu/Debian and macOS - todo: validate this

@jwbron jwbron self-assigned this Oct 20, 2025
jwbron and others added 3 commits January 27, 2026 00:47
- Install Go directly from golang.org on Fedora to ensure version 1.25
  (Fedora repos only have 1.23.x)
- Update openjdk package mapping from 11 to 21

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@jwbron jwbron force-pushed the asahi-fedora-support branch from 7c1384f to a6c432a Compare January 27, 2026 08:51
- Document PostgreSQL pg_hba.conf security implications (trust for all
  local users is intentionally permissive for dev convenience)
- Extract Fastly CLI version to a variable to reduce duplication
- Fix Go tarball cleanup on extraction failure
- Add error handling for watchman git checkout
- Save/restore SSH_ASKPASS variables in setup.sh instead of just unsetting
- Remove unused map_package_name function from shared-functions.sh

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants