https://pantsbuild.org/ logo
#general
Title
# general
n

narrow-vegetable-37489

05/26/2021, 1:27 PM
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

happy-kitchen-89482

05/26/2021, 2:44 PM
I believe it requires Rosetta, but @hundreds-father-404 and @ancient-vegetable-10556 have experience here
a

ancient-vegetable-10556

05/26/2021, 3:07 PM
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

narrow-vegetable-37489

05/26/2021, 4:08 PM
Alright, I'll give it a go. Thanks!
a

ancient-vegetable-10556

05/26/2021, 4:08 PM
Let me know if you have any questions
b

busy-vase-39202

05/26/2021, 4:10 PM
@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

narrow-vegetable-37489

05/26/2021, 5:28 PM
Sure, will do!
๐Ÿ‘– 1
p

plain-sundown-25537

06/02/2021, 4:51 AM
benchmark too lol
b

busy-vase-39202

06/11/2021, 6:51 PM
@narrow-vegetable-37489 how'd the experiment go with Rosetta? Is Pants running for you now on the M1?
n

narrow-vegetable-37489

06/11/2021, 7:46 PM
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

busy-vase-39202

06/11/2021, 9:13 PM
When you do, this might prove useful as well: https://pantsbuild.slack.com/archives/C0D7TNJHL/p1623442519077200
a

ancient-vegetable-10556

06/11/2021, 9:36 PM
Note that the thread there is mostly around building pants so that I can contribute to the codebase, not necessarily using pants
๐Ÿ‘ 1
n

narrow-vegetable-37489

06/16/2021, 12:32 PM
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

happy-kitchen-89482

06/22/2021, 5:59 PM
5 Views