-
Notifications
You must be signed in to change notification settings - Fork 150
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
Update Apple M1/2 K build instructions #3726
Comments
Please let me know when this is done so I can add it to the changelog for #3706 |
First AttemptRe-running my process to make sure that everything works as expected. My starting point is not a totally clean machine, but I have wiped the entire Homebrew installation and removed the Stack cache at $ sw_vers
ProductName: macOS
ProductVersion: 13.4.1
BuildVersion: 22F82 Installed Homebrew with the official installer: $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
...
$ brew doctor
Your system is ready to brew. I then installed the dependencies listed in the documentation: $ brew install bison boost cmake flex fmt gcc gmp openjdk jemalloc libyaml llvm@15 make maven mpfr pkg-config python stack zlib z3
... And the relevant developer tooling (separate to build dependencies): $ brew install git direnv
... Next, I got a clean checkout of K: $ git clone [email protected]:runtimeverification/k.git --recursive --branch develop
...
$ cd k Set up the Homebrew paths using $ cp macos-envrc .envrc
...
$ direnv allow
... Then tried a build, which got me the Stack error that we work around already in the Homebrew build: $ mvn package -DskipTests
...
[exec] ld64.lld: error: unknown argument '--gc-sections'
[exec] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[exec] `gcc' failed in phase `Linker'. (Exit code: 1)
[exec]
[exec] Error: [S-6374]
[exec] While building simple Setup.hs (scroll up to its section to see the error) using:
... The fix is to ensure that $ cd haskell-backend/src/main/native/haskell-backend && stack setup && cd -
... This hack will need a bit of explanation and debugging help added to help people identify the error when things go wrong. Then, we get another error: ...
[exec] While executing the build plan, Stack encountered the error:
[exec]
[exec] [S-7011]
[exec] While building package secp256k1-haskell-0.6.1 (scroll up to its section to see the error)
[exec] using:
... which I believe to just be a missing dependency installable with Homebrew: $ brew install secp256k1
... This produces a successful build of K. Finally, I ran the integration tests: $ cd k-distribution/tests/regression-new
$ time gmake -kO -j8 2>&1 | tee ../test.out
... which pass, suggesting that this build of K works properly. Second AttemptAbbreviated console logs: $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
$ brew doctor
$ brew install bison boost cmake flex fmt gcc gmp openjdk jemalloc libyaml llvm@15 make maven mpfr pkg-config python stack zlib z3 git direnv secp256k1
$ git clone [email protected]:runtimeverification/k.git --recursive --branch develop
$ cd k
$ cd haskell-backend/src/main/native/haskell-backend && stack setup && cd -
$ cp macos-envrc .envrc
$ direnv allow
$ mvn package -DskipTests
$ cd k-distribution/tests/regression-new
$ time gmake -kO -j8 2>&1 | tee ../test.out These commands allow the build to go through; I will go ahead and document that accordingly. |
For a while, the canonical line was that the K source build doesn't work on these machines because of an issue with Stack - I have retried the process and was able to build K successfully from a clean source build. We should update the documentation to better reflect this, and remove the old sections explaining the workarounds needed to build K on these platforms.
The text was updated successfully, but these errors were encountered: