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
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