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

Enhancement Request: Target Apple Silicon aka darwin_arm64 for builds as well #2109

Open
2 tasks done
flying-sausages opened this issue Dec 18, 2020 · 11 comments
Open
2 tasks done

Comments

@flying-sausages
Copy link

For new checks and feature suggestions

It would be nice to have builds for the Apple Silicon machines, seeing as there currently are builds for Intel MacBooks and also linux_arm

@tisba
Copy link

tisba commented Jan 30, 2021

Unfortunately I have no idea how to build shellcheck, but I'm happy to help testing something on Apple Silicon hardware, if this is helpful.

@tisba
Copy link

tisba commented Jan 30, 2021

Just found https://gitlab.haskell.org/ghc/ghc/-/issues/18664 so Haskell is not yet ready for M1/Apple Silicon 🤷‍♂️

@jansorg
Copy link
Contributor

jansorg commented Jun 11, 2021

According to https://www.haskell.org/ghc/blog/20210605-ghc-8.10.5-released.html there's now support for Apple M1 with GHC 8.10.5, but I may have misunderstood this.

@tisba
Copy link

tisba commented Jun 11, 2021

uh nice! not sure what version shellcheck is using, but this sounds promising! 🚀

@jansorg
Copy link
Contributor

jansorg commented Jun 11, 2021

I finally managed to build a working universal binary of ShellCheck 0.7.2 for macOS (at least I think so ;)
As I'm building this for BashSupport Pro, it's not easy to send this as a pull request.

Needed changes:

  • a new osxcross image. Currently liushuyu/osxcross:latest is used, which is darwin_10.12 iirc and there's no newer image on DockerHub. But at least XCode 11.1 is needed to build for arm64. I made a local osxcross image with XCode 12.5 (aka darwin_11.3). Sharing my image is probably problematic due to the bundled XCode assets.
  • a new builder in build/. With the osxcross XCode 12.5 data, I had to use this in the Dockerfile:
    ENV TARGET aarch64-apple-darwin20.4
    ENV TARGETNAME darwin_11.3.aarch64
    
  • In the builder I used https://downloads.haskell.org/~ghc/8.10.5/ghc-8.10.5-src.tar.xz as GHC source and https://downloads.haskell.org/~cabal/cabal-install-3.4.0.0/cabal-install-3.4.0.0-x86_64-ubuntu-16.04.tar.xz for the Cabal file
  • Alternatively it should be possible to update the current macOS builder to build both x64 and arm64 binaries and to output the universal binary of both (didn't try that)
  • I had weird issues with the signature. macOS seems to treat arm64 binaries more strictly. The strip of the binary in the macOS builder invalidates the ad-hoc signature of the arm64 binary. I had to sign and notarize the binary to make it run. Without it was immediately killed with a code signature error by the OS.
  • I'm not sure if it would be possible to distribute an unsigned ShellCheck binary for macOS arm64 - other may know more about it.

If anyone is interested, I could upload the universal binary here.

@bhrutledge
Copy link

Possibly related: shellcheck can now be installed natively on Apple Silicon via Homebrew.

#2162 (comment)

Homebrew/homebrew-core@112feba

@tisba
Copy link

tisba commented Jul 9, 2021

I think this issue can be closed, right?

@sjagoe
Copy link

sjagoe commented Oct 15, 2021

Could a darwin_amd64 binary be added to the release in github?

@koalaman
Copy link
Owner

darwin_amd64 is the same as the already available darwin.x86_64.

@sparrc
Copy link

sparrc commented Nov 15, 2021

I see that the homebrew recipe appears to be updated, could the darwin.arm64 version also be added to the released binaries at https://github.com/koalaman/shellcheck/releases?

thanks!

@koalaman
Copy link
Owner

koalaman commented Jun 9, 2022

@sparrc The Homebrew builds are great, but since they're not upstream builds and can't be (re-)produced by the ShellCheck build system, this is not the place for them.

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

7 participants