We've put a lot of effort recently into getting mo...
# general
e
We've put a lot of effort recently into getting most of our python repo (and all of our default resolve) compatible with native apple m1 development. There are a couple places where it is not feasible to use only packages that are compatible with m1, but we have isolated them into their own resolve. This has worked well for being able to manage packaging the different artifacts, but resulted in a state where developers who running in a native m1 environment are now unable to run commands like
./pants lint ::
. Is there anything we can do? An env var we could set on these systems to always filter out targets on the "bad" resolve?
h
Hmm, one way to filter out targets is to use tags. You could have an
m1_incompatible
tag and set it on all the relevant targets, and then have m1 users set the PANTS_TAG env var to exclude those targets. This is how Pants selects targets to run on macs in its own CI, for example.
This doesn't relate to resolves, directly, though
But you could perhaps use a macro to generate a target that has both the tag and the resolve set
e
That was my one idea so thank you for validating it! Going to give this a try tomorrow
h
Yeah, probably a
m1_incompatible_python_sources
macro could save you some typing
Related - we are close to being able to cross-build for linux on a mac by automatically executing relevant processes either in a local docker container or on a remote executor. At that point your code may not need to run on an m1 in order to develop natively on an m1
e
Look forward to trying that, but the m1s are still a problem. We're still dealing with some dependencies that don't publish arm wheels. Remote could work though That would be a larger change to integrate into everyone's setup
We'll definitely use local docker builder right away. Currently, even when developing on Linux, the PEXes don't match our target docker images and we have a whole complicated script wrapping the pants packaging in a docker image that would be nice to be able to do natively
Playing with this and I don't think i can do it with tags. The m1 incompatible resolve is not disjoint with our default resolve and we have a lot of
'resolve': parametrize('default', 'cnvkit')
. I am not aware of any way to apply the
m1-incompatible
tag only to the
@resolve=cnvkit
targets.