Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: provide prebuilt binaries for aarch64-apple-darwin #142

Open
EverlastingBugstopper opened this issue Jun 16, 2022 · 2 comments
Open

Comments

@EverlastingBugstopper
Copy link
Contributor

EverlastingBugstopper commented Jun 16, 2022

Situation

Developers want to run rover compiled for the ARM architecture which runs on their new Mac computers with Apple processors. Rover downloads pre-built supergraph binaries that are built from source code in this repository. We currently provide pre-built binaries for architectures x86_64-apple-darwin, x86_64-pc-windows-msvc, and x86_64-unknown-linux-gnu. Our next releases (2.0.6 and 0.36.2) will also have support for the aarch64-unknown-linux-gnu architecture.

Problem

We're blocked on support for aarch64-apple-darwin for a few reasons:

  1. CircleCI can only run workflows on MacOS with an x86_64 processor
  2. You can cross-compile for aarch64-apple-darwin on an x86_64 machine, but v8 will still generate snapshots (bytecode) in x86_64. This means that running supergraph compose on an M1 when it was compiled on Intel will fail miserably.

Resolution for now

Only deliver prebuilt aarch64-unknown-linux-gnu binaries, and forgo native ARM support for Macs processors. Many other tools at the moment do not provide binaries for this architecture because Apple makes it incredibly hard to support. This should be fine! M1 users can run x86_64-apple-darwin binaries because of Apple's emulation software Rosetta. This should work by default with no configuration because we sign our binaries. Running in Docker will also work because we provide pre-built binaries for aarch64-unknown-linux-gnu.

Long term resolutions

There are a few paths forward here:

  1. If Circle (or Apple) start renting out CI servers that run on Apple's processors, we'll use that to provide these binaries.
  2. If Federation gets oxidized (see: rewritten in 🦀 Rust), this shouldn't be a problem anymore since we won't need to build and embed v8 snapshots into these plugin binaries - we'll just cross compile from x86_64 macs and it will Just Work
  3. For unsupported architectures, we could enable Rover's installer script to clone Rover and run cargo build (this would be a slow installation but maybe better than nothing)
  4. We decide that x86_64 emulation is good enough and never build for aarch64-apple-darwin
@EverlastingBugstopper
Copy link
Contributor Author

EverlastingBugstopper commented Apr 18, 2023

this is no longer blocked because circle has ARM machines we can run now. building for arm is not prioritized at the moment though.

@EverlastingBugstopper EverlastingBugstopper changed the title blocked: cannot cross compile for aarch64-apple-darwin chore: provide prebuilt binaries for aarch64-apple-darwin Apr 18, 2023
@EverlastingBugstopper
Copy link
Contributor Author

CircleCI is deprecating x86 machines, we need to

  1. start producting aarch64-apple-darwin binaries
  2. ensure those binaries work on Intel machines using Rosetta in the reverse direction
  3. if it works, start downloading only aarch64-apple-darwin binaries regardless of architecture. installers should be version aware, i.e. before 2.5.5 download x86, after 2.5.5 download aarch64

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

No branches or pull requests

1 participant