Skip to content

Commit 1d18464

Browse files
authored
Merge pull request ruby#187 from Shopify/m1doc
Add some docs around development on M1s
2 parents b5d2b06 + 1ec3925 commit 1d18464

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

yjit/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,41 @@ No.
4242

4343
[rust-install]: https://www.rust-lang.org/tools/install
4444
[editor-tools]: https://www.rust-lang.org/tools
45+
46+
## Running YJIT on M1
47+
48+
It is possible to run YJIT on an M1 via Rosetta. You can find the most basic
49+
instructions below, but there are a few caveats listed further down.
50+
51+
First, install Rosetta:
52+
53+
```
54+
$ softwareupdate --install-rosetta
55+
```
56+
57+
Now any command can be run with Rosetta via the `arch` command line tool.
58+
59+
Then you can start your shell in an x86 environment:
60+
61+
```
62+
$ arch -x86_64 zsh
63+
```
64+
65+
You can double check your current architecture via the `arch` command:
66+
67+
```
68+
$ arch -x86_64 zsh
69+
aaron@tc-lan-adapter ~ % arch
70+
i386
71+
aaron@tc-lan-adapter ~ %
72+
```
73+
74+
While in your i386 shell, install Cargo and Homebrew, then hack away!
75+
76+
## M1 Caveats
77+
78+
1. You must install a version of Homebrew for each architecture
79+
2. Cargo will install in $HOME/.cargo by default, and I don't know a good way to change architectures after install
80+
3. `dev` won't work if you have i386 Homebrew installed on an M1
81+
82+
If you use Fish shell you can [read this link](https://tenderlovemaking.com/2022/01/07/homebrew-rosetta-and-ruby.html) for information on making the dev environment easier.

0 commit comments

Comments
 (0)