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
haskell-stack: Fix building from source, add Apple Silicon support #95032
Conversation
91e0343
to
f852194
Compare
99f5a2f
to
333a180
Compare
For those who want to use this patch right now: brew install simnalamburt/x/haskell-stack Reference |
333a180
to
3d19d2f
Compare
@carlocab I'd really, really appreciate if you could merge this PR. At this point, Well, as the PR author mentioned, there is Stack provides their own installation method (distribution of binary executables) but they haven't released the version 2.7.4 that supports the Apple Silicon arch. Users will have to wait indefinitely. Besides, regardless of Stack's own release policy, As you pointed out, the patch size (in terms of bytes) is pretty big, but what it does is actually small and simple: Freeze the versions of dependency packages in the build process. Hopefully Stack will solve the "dependency version problem when building with cabal" issue, at which point we can probably ditch this patch. Furthermore, since this is in the I think this serves as a really nice stopgap for Apple Silicon users right now. Please merge this. I beg you. |
Generally brew just ships what upstream ships and almost everywhere in our documentation we tell people not to patch things in brew (but to fix it upstream). If upstream doesn't feel comfortable releasing this patch yet I'm not sure if we should. |
- Fixed building from source. Due to recent update of aeson-2.0.0.0, stack can no longer be built with cabal-install. So I patched stack to freeze cabal dependencies using stackage 17.15 LTS. - Add Apple Silicon support. HEAD version of stack has already been patched to support Apple Silicon. However, the next release containing that patch hasn't release yet. So I manually patched stack v2.7.3 to support Apple Silicon. - Add llvm@12 as a dependency only on ARM All ghc versions before 9.2.1 requires LLVM Code Generator as a backend on ARM. Fixes Homebrew#94796 Reference: commercialhaskell/stack#5562 commercialhaskell/stack#5677
3d19d2f
to
9680993
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@carlocab Since I wrote this PR, I’m willing to help you if this PR caused any issue with bottling haskell-stack or others. |
|
I just checked 87ec35b. Thanks! Can you rebuild the “arm64_big_sur” image too? The existing arm64_big_sur binary does not work properly without this PR. It will enable other haskell-stack dependents’ arm64_big_sur builds too! |
Can you explain the problem with the |
WIth existing binary: brew install haskell-stack
cd any-stack-project # navigate into any stack project
stack setup Will fail with This issue was fixed by commercialhaskell/stack#5562. This is the reason why I patched haskell-stack with e3910ed#diff-7262ae90068953c6fc17eb4ec7deac3a69c7edf2ed4e32edc4ce2e4dc00d73dfR22-R31. |
Actually this is what @xtendo-org meant by " |
We should've bumped the |
Got it! |
With existing arm64_big_sur bottle, brew install haskell-stack cd any-stack-project # navigate into any stack project stack setup Will fail with following error message: I don't know how to install GHC for (OSX,AArch64), please install manually.. This issue was fixed by Homebrew#95032 but the revision was not bumped. I hereby bump the revision to rebuild arm64_big_sur bottle. Reference: Homebrew#95032 (comment)
With existing arm64_big_sur bottle, brew install haskell-stack cd any-stack-project # navigate into any stack project stack setup Will fail with following error message: I don't know how to install GHC for (OSX,AArch64), please install manually.. This issue was fixed by #95032 but the revision was not bumped. I hereby bump the revision to rebuild arm64_big_sur bottle. Reference: #95032 (comment) Closes #95668. Signed-off-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
Fixed building from source.
Due to recent update of aeson-2.0.0.0, stack can no longer be built with cabal-install. So I patched stack to freeze cabal dependencies using stackage 17.15 LTS.
Add Apple Silicon support.
HEAD version of stack has already been patched to support Apple Silicon. However, the next release containing that patch hasn't release yet. So I manually patched stack v2.7.3 to support Apple Silicon.
Add llvm@12 as a dependency only on ARM
All ghc versions before 9.2.1 requires LLVM Code Generator as a backend on ARM.
Fixes #94796
References:
stack setup
installs GHC for aarch64 on M1 Macs commercialhaskell/stack#5562cabal build
by freezing cabal dependencies commercialhaskell/stack#5677Checklists:
brew install --build-from-source --formula ./haskell-stack.rb
brew test ./haskell-stack.rb
brew audit --strict haskell-stack
brew install --build-from-source --HEAD --formula ./haskell-stack.rb