Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save i-am-the-slime/5c23ede12bb56984c93c53592e5c8204 to your computer and use it in GitHub Desktop.
Save i-am-the-slime/5c23ede12bb56984c93c53592e5c8204 to your computer and use it in GitHub Desktop.
How to build an Apple Silicon version of the PureScript compiler

How to build an Apple Silicon version of the PureScript compiler

Updates:

2022-07-01

Add prebuilt binary for 0.15.4

2022-06-24

I changed ghc to be installed with ghcup and ghc version to 9.2.3 to match PS 0.15.3 added the RELEASE flag.

Install ghc

brew install ghcup
ghcup install ghc 9.2.3

Install llvm

brew install llvm

Get opt and llc on your $PATH

sudo ln -s /opt/homebrew/Cellar/llvm/13.0.0_1/bin/opt ~/.local/bin/opt
sudo ln -s /opt/homebrew/Cellar/llvm/13.0.0_1/bin/llc ~/.local/bin/llc

Clone purescript

git clone https://github.com/purescript/purescript.git

Changes to stack.yaml

system-ghc: true
compiler: ghc-9.2.3
compiler-check: match-exact

Install the compiler!

stack install --flag=purescript:RELEASE

Tweak PureScript extension settings in VSCode

Add NPM path: Disable

This file has been truncated, but you can view the full file.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

@i-am-the-slime
Copy link
Author

@purefunctor

I get this:

Failed to build language-javascript-0.7.0.0. The failure occurred during the
configure step.
Build log (
/Users/mark/.cabal/logs/ghc-9.2.3/lngg-jvscrpt-0.7.0.0-93afcc6e.log ):
Configuring library for language-javascript-0.7.0.0..
Warning: Packages using 'cabal-version: >= 1.10' and before 'cabal-version:
3.4' must specify the 'default-language' field for each component (e.g.
Haskell98 or Haskell2010). If a component uses different languages in
different modules then list the other ones in the 'other-languages' field.
cabal-3.6.2.0: The program 'happy' version >=1.19 is required but the version
of /Users/mark/.cabal/store/ghc-9.2.3/hppy-1.20.0-000be3eb/bin/happy could not
be determined.

cabal: Failed to build language-javascript-0.7.0.0 (which is required by
exe:purs from purescript-0.15.4). See the build log above for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment