https://pantsbuild.org/ logo
f

freezing-vegetable-92896

11/02/2021, 8:16 PM
I'm running into trouble getting certain libraries (
scs
in particular) to install on a mac. It looks like the issue is with pants picking up a universal binary and attempting to build an arm64 version of the library that we don't need and failing. I've been able to install in docker, but still struggling on mac native. One of my co-workers was able to get it to work by forcing an
interpreter_constraints
to a version that doesn't have a universal binary installed. This feels like a fairly unmaintainable hack, so I'm hoping there is a better way
👋 3
h

happy-kitchen-89482

11/02/2021, 9:21 PM
This is on an M1 presumably
@hundreds-father-404 @ancient-vegetable-10556 you're our resident Apple Silicon experts, is this a known issue?
a

ancient-vegetable-10556

11/02/2021, 9:23 PM
Not specifically. Pants will need to use an arm64 version of Python3.9 in order to run fully natively on arm
which may or may not be the issue here
@freezing-vegetable-92896 Which version of python is your universal binary, and which is the arm64-only one?
f

freezing-vegetable-92896

11/02/2021, 9:26 PM
No, this is not an M1, I'm on a 3+ year old macbook pro
👀 1
but the python version it is picking up is a universal binary
h

hundreds-father-404

11/02/2021, 9:27 PM
what goal are you running? Like
./pants package
,
test
?
f

freezing-vegetable-92896

11/02/2021, 9:27 PM
Copy code
file python
/usr/bin/python: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
/usr/bin/python (for architecture x86_64):	Mach-O 64-bit executable x86_64
/usr/bin/python (for architecture arm64e):	Mach-O 64-bit executable arm64e
I'm attempting to run
test
👍 1
and my cpu is an i7
h

hundreds-father-404

11/02/2021, 9:32 PM
Interesting, thanks for posting
file python
. Didn't realize macOS is doing that. I suspect Pex (which vendors pip) is detecting the wrong platform here, so trying to build a dependency with the wrong architecture In the meantime to confirming that, you could try the workaround of setting
[python-setup].interpreter_search_path
. See the warning box about macOS on https://www.pantsbuild.org/docs/python-backend
f

freezing-vegetable-92896

11/02/2021, 9:38 PM
Thanks for the pointer to
interpreter_search_paths
. I've got a run going with that, unfortunately given the size of our repo it can take a little while before the error manifests
h

happy-kitchen-89482

11/02/2021, 9:46 PM
Might have to add this to the list of reasons not to use MacOS system pythons but instead use pyenv or brew-installed ones only
☝️ 3
MacOS system pythons are broken in a variety of subtle and annoying ways
To the point where I'm almost tempted to have Pants flat-out refuse to use them
f

freezing-vegetable-92896

11/02/2021, 9:47 PM
sounds good to me 🙂