Does Pants support M1 natively or is Rosetta neede...
# general
n
Does Pants support M1 natively or is Rosetta needed? Didn't find anything in the docs besides that arm isn't supported on Linux, but when I try to bootstrap Pants I get the following with both Python 3.9.5 and 3.8.10 - presumably because only x86_64 wheels are available on PyPI.
h
I believe it requires Rosetta, but @hundreds-father-404 and @ancient-vegetable-10556 have experience here
a
Hi @narrow-vegetable-37489! I had success getting Pants to run with Rosetta. I found the easiest way to manage it was to open up a shell in x86 emulation mode:
Copy code
% arch --x86_64 sh
% ./pants version
For what it’s worth, once you’re inside an x86 shell, you can reinstall homebrew, and it’ll automatically end up under a different prefix, which I found really useful for keeping my binaries separated
n
Alright, I'll give it a go. Thanks!
a
Let me know if you have any questions
b
@narrow-vegetable-37489 if you wouldn't mind, would you let us know how it goes regardless of outcome? It would be helpful to know this is working for a range of M1 users, and if not to be able to gather more info.
👍 1
n
Sure, will do!
👖 1
p
benchmark too lol
b
@narrow-vegetable-37489 how'd the experiment go with Rosetta? Is Pants running for you now on the M1?
n
I haven't tried yet to be honest. I've moved to another project and don't use Python/Pants on a daily basis anymore - but hopefully I'll get around to it soon enough :)
b
When you do, this might prove useful as well: https://pantsbuild.slack.com/archives/C0D7TNJHL/p1623442519077200
a
Note that the thread there is mostly around building pants so that I can contribute to the codebase, not necessarily using pants
👍 1
n
Right. Got it running on M1 now using Rosetta. Had some issues with pyenv that I'm not really sure what the root cause is (or maybe it's the intended behaviour). The project has a
.python-version
in the root to tell pyenv which Python version to use. Pants finds that interpreter just fine at
/Users/jyggen/.pyenv-amd64/shims/python3.8
, but when it tries to run the python code in
compute_sha256
it encounters the following issue:
Copy code
pyenv: python3.8: command not found

The `python3.8' command exists in these Python versions:
  3.8.8

Note: See 'pyenv help global' for tips on allowing both
      python2 and python3 to be found.
Running
/Users/jyggen/.pyenv-amd64/shims/python3.8
from the terminal manually worked just fine, and I managed to narrow it down to the error only occurring when standing in a folder anywhere outside the project - so I assume it's due to Pants not being within the project anymore when executing
compute_sha256
. I solved it by simply running
pyenv global 3.8.8
and now Pants seems to work just fine 🙂
🙌 1
h