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

Add docs on how to build wasp from source on M1/M2 macs #1431

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion waspc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,32 @@ It can then also run that web app for you, deploy it (not yet but that is coming
### Setup
We use the [`cabal`](https://cabal.readthedocs.io/) command line tool to build
the project. The best way to install it is via
[ghcup](https://www.haskell.org/ghcup/). The `ghcup tui` terminal user interface
[ghcup](https://www.haskell.org/ghcup/) (if you're running an M1/M2 mac make sure to run it in rosetta).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what exactly do you have to run in rosetta -> ghcup, during installation, or cabal later when building the project, or both?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to install ghcup and then I suppose also run cabal with rosetta (installing ghcup in m1 mode and then trying to run it or cabal didn't work)


<details>
<summary>M1/M2 rosetta setup</summary>

1. Regular Shell: just run `arch -x86_64 zsh` in your terminal.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This uses rosetta for the current terminal session?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, without any permanent changes

2. IntelliJ: Preferences -> Tools -> Terminal -> Shell path -> `env /usr/bin/arch -x86_64 /bin/zsh --login`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we ok with doing this for all of the shells that IntelliJ runs? Because this will then be also used when you are not dealing with Haskell, right? Same question for vscode below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sets it per project (so only in this folder -> .idea is the config for it) and same for vscode (I suggested creating the .vscode/settings.json to make it local)

3. VSCode: add the following to your local `.vscode/settings.json` file

```json
{
"terminal.integrated.profiles.osx": {
"rosetta": {
"path": "/usr/bin/arch",
"args": ["-arch", "x86_64", "/bin/zsh"],
"overrideName": true
}
},
"terminal.integrated.defaultProfile.osx": "rosetta"
}
```

To check you can run `sysctl sysctl.proc_translated` and it should print out `sysctl.proc_translated: 1`
</details>

The `ghcup tui` terminal user interface
is a convenient way of installing and selecting versions of `cabal`, `hls` and
`ghc`.

Expand Down
Loading