aws/amazon-genomics-cli

Exec format error on Mac M1 with V1.6.0

Opened this issue · 3 comments

Describe the Bug

Installation of AGC on Mac M1 worked fine before the V1.6.0 release. After this release, a new arm-64 specific executable was added. So, when installing with the new release, it detects that the Mac M1 has an arm 64 architecture and procedes with the new executable. But the new executable gives exec format error, which I believe is an incompatibility between the architecture and the executable. On the other hand, if I use the agc executable (non arm-64) it works.

TL;DR
On a mac m1 the executable that works is the standard one, not the arm64 specific. But the new installer defaults to the arm64 one, causing exec format error.

Steps to Reproduce

Download AGC v1.6.0 and run:

unzip amazon-genomics-cli-<version>.zip
cd amazon-genomics-cli/ 
./install.sh

Additional Context

Operating System: MacOS Ventura Version 13.0
AGC Version: v1.6.0

The ARM binary is compiled on a system that is not a Mac and may therefore be linking to libs that are not present on a Mac? The question is which ones?

Have you attempted to compile from source on your M1?

Can you try running file agc on the binary that is installed by the install script and post the result here?

Thanks @markjschreiber, that sounds like the issue. I haven't yet compiled from source since the previous version is good enough for my use case, but should attempt soon.

Here are the results from file agc:
agc: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=z7vBGZeFuLQcq0TexFlY/pbnsylsk6ITqAzuFZvMR/RGbIvMboWdvJXL66OCP4/a5uca2MP1AqQv6rhAGpB, stripped

Turns out the x86_64 version is functional on my M1 mac (presumably via Rosetta). So to fix, as a workaround, simply rm $HOME/bin/agc and copy the agc executable (which is x86_64 compiled vesion) from the installation folder like cp ./amazon-genomics-cli/agc $HOME/bin/. After that, for me at least, doing agc --help works now.