localstack / localstack-cli

The LocalStack CLI packaged using pyinstaller

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

arm64 binary executables are x86_64 executables

efrench-novi opened this issue · comments

I used brew to install localstack-cli on my macbook pro M2

❯ brew install localstack-cli
==> Fetching localstack/tap/localstack-cli
==> Downloading https://github.com/localstack/localstack-cli/releases/download/v2.1.0/localstack-cli-2.1.0-darwin-arm64.tar.gz
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/466586578/30d4cce0-2321-4f13-b0f4-811f0c74baf2?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230630%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230630T232510Z&X-Amz-Expires=300&X-Amz-Signatu
######################################################################################################################################################################################################################################################### 100.0%
==> Installing localstack-cli from localstack/tap
🍺  /opt/homebrew/Cellar/localstack-cli/64: 88 files, 30.8MB, built in 1 second
==> Running `brew cleanup localstack-cli`...

You can see it correctly downloaded https://github.com/localstack/localstack-cli/releases/download/v2.1.0/localstack-cli-2.1.0-darwin-arm64.tar.gz.
However, when I try to run the executable I get the following error

❯ localstack
zsh: bad CPU type in executable: localstack

When I use file to determine the file type I get:

❯ file `which localstack`
/opt/homebrew/bin/localstack: Mach-O 64-bit executable x86_64

I tried to download the executables directly from https://github.com/localstack/localstack-cli/releases/tag/v2.1.0
and get the exact same results for both arm64 archives:

https://github.com/localstack/localstack-cli/releases/download/v2.1.0/localstack-cli-2.1.0-darwin-arm64-onefile.tar.gz
https://github.com/localstack/localstack-cli/releases/download/v2.1.0/localstack-cli-2.1.0-darwin-arm64.tar.gz

Hi @efrench-novi!
Thanks for your report. And yes, that's correct, the two binaries are currently the same. This is a workaround because we don't have access to native Apple Silicon Runners to create the native binaries.

  • Here's the section in the build pipeline which copies the AMD64 binaries as ARM64:
    # TODO remove this section once we have native darwin arm64 builds
    # This step is currently necessary for the homebrew action to pick up the MacOS AMD64 package for MacOS ARM64 / M1
    # GitHub Roadmap: https://github.com/github/roadmap/issues/528
    - name: (Intermediate) Use Darwin AMD64 for Darwin ARM64
    run: |
    cp ./builds/${{github.event.repository.name}}-${{needs.build.outputs.cli_version}}-darwin-amd64/* ./builds/${{github.event.repository.name}}-${{needs.build.outputs.cli_version}}-darwin-amd64/${{github.event.repository.name}}-${{needs.build.outputs.cli_version}}-darwin-arm64.tar.gz
    cp ./builds/${{github.event.repository.name}}-${{needs.build.outputs.cli_version}}-darwin-amd64-onefile/* ./builds/${{github.event.repository.name}}-${{needs.build.outputs.cli_version}}-darwin-amd64-onefile/${{github.event.repository.name}}-${{needs.build.outputs.cli_version}}-darwin-arm64-onefile.tar.gz
  • Here's the GitHub Roadmap issue to launch a public beta of M1 GitHub runners in Q4:
    github/roadmap#528

In our tests, it looked like MacOS automatically uses Rosetta when it comes to an x86_64 binary.
Do you have Rosetta 2 installed on your machine? We might have to add this to the installation instructions for as long as we don't have a GitHub runner...

I do not have e rosetta installed, intentionally. It causes other issues. Looks like I'll have to wait until you have binaries available to brew install. I'll just do a python install until that is available.

Okay, thanks! I'll keep this issue open to help you keep track of the status here.

With the latest release version 2.3.2, we are now using the brand new Apple M1 GitHub runners to create M1 native binaries! 📦
Please let us know if you experience any issues, I'll close this one for now.