Standalone installer downloads x86_64-only macOS binary and fails on Apple Silicon without Rosetta

Aperta
#11,318 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
44/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
macos, node.js, typescript
Ambito
cli, devtools

Direzione di ricerca

The report identifies the standalone installer and its existing-install probe, but does not name their source files or tests. Start by locating the script that downloads https://firebase.tools/bin/macos/<version> and checking how it detects the host architecture and handles failed execution. Done means Apple Silicon without Rosetta gets a usable binary or an actionable failure before an existing binary is overwritten; add coverage for that case.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

firepit reproducible type: bug
[REQUIRED] Environment info

firebase-tools: 15.34.0 (installer reports this as the latest npm version and downloads https://firebase.tools/bin/macos/v15.34.0)

Platform: macOS 27.0.1 (build 26A434), Apple M1 Pro (arm64)

Rosetta 2 is not installed:

$ arch -x86_64 /usr/bin/true
arch: posix_spawnp: /usr/bin/true: Bad CPU type in executable

firebase --version is unavailable because the installer fails before the downloaded binary can run.

[REQUIRED] Test case

On an Apple Silicon Mac without Rosetta 2:

curl -sL https://firebase.tools | bash
[REQUIRED] Steps to reproduce
  1. Use an arm64 Mac where Rosetta 2 is not installed.
  2. Run curl -sL https://firebase.tools | bash (or curl -sL https://firebase.tools | upgrade=true bash to repair).
  3. Observe that the installer replaces /usr/local/bin/firebase and then fails to execute it.
[REQUIRED] Expected behavior

The installer should either install a binary that runs on the host architecture, or fail with an actionable message (for example, install Rosetta or use npm install -g firebase-tools) before overwriting an existing firebase binary.

[REQUIRED] Actual behavior
$ curl -sL https://firebase.tools | upgrade=true bash
-- Checking for existing firebase-tools...
bash: line 177: /usr/local/bin/firebase: Bad CPU type in executable
-- Your machine has a corrupted firebase-tools binary, attempting upgrade...
-- Checking your machine type...
-- Downloading binary from https://firebase.tools/bin/macos/v15.34.0
######################################################################## 100.0%
-- Setting permissions on binary... /usr/local/bin/firebase
bash: line 287: /usr/local/bin/firebase: Bad CPU type in executable
Something went wrong, firebase has not been installed.
Please file a bug with your system information on Github.
https://github.com/firebase/firebase-tools/
-- All done!

After the failed install, /usr/local/bin/firebase is left in place and still unusable:

$ file /usr/local/bin/firebase
/usr/local/bin/firebase: Mach-O 64-bit executable x86_64

The downloaded release asset is also x86_64-only:

$ curl -sL -r 0-4095 https://firebase.tools/bin/macos/v15.34.0 | file -
Mach-O 64-bit executable x86_64

The v15.34.0 release only publishes a single macOS asset, firebase-tools-macos, so there is no arm64 alternative.

Root cause

The install script detects only the OS (uname -s → macos) and never checks the CPU architecture (uname -m) or Rosetta availability. The macOS standalone binary is x86_64-only, so it cannot run on Apple Silicon without Rosetta. The existing-install probe then reports the binary as "corrupted" even though it is a valid x86_64 executable, and the upgrade path overwrites the existing install with the same non-runnable binary.

The failure message does not mention Rosetta or npm install -g firebase-tools, making this difficult to diagnose.

This appears to be the same underlying issue as the closed reports https://github.com/firebase/firebase-tools/issues/9511 and https://github.com/firebase/firebase-tools/issues/10333, which were closed after installing Rosetta. The problem still reproduces with the latest release on systems where Rosetta is intentionally absent.

Suggested fixes
  • Publish a universal or arm64 macOS standalone binary, and select it in the installer based on uname -m.
  • If no arm64 binary is available, detect Apple Silicon without Rosetta and exit with an actionable message rather than downloading and overwriting the existing binary.
  • At minimum, update the failure output/docs to mention the Rosetta requirement (softwareupdate --install-rosetta --agree-to-license) and the npm fallback.
Workarounds
  • Install Rosetta 2, then rerun the installer.
  • Install via npm instead: npm install -g firebase-tools
Lingua principale
TypeScript
Stelle
4.5k
Fork
1.3k
Merge medio
3g 1h
PR unite (30g)
98

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di firebase/firebase-tools

Tutte le issue di firebase/firebase-tools

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.