Pants is failing to build a pex with this error: `...
# general
d
Pants is failing to build a pex with this error:
Copy code
stderr:
There was 1 error downloading required artifacts:
1. mlprodict 0.9.1883 from <https://files.pythonhosted.org/packages/5b/d2/7f643bb8432e9c7961becb4f44e0e0f8455dffa92344c6e4ca7b4d18d232/mlprodict-0.9.1883.tar.gz>
    hint: See above for details.
This works fine for some folks on my team, but is failing for others. I re-ran the command with
--keep-sandbox=on_failure
and modified the
__run.sh
script with
--preserve-pip-download-log
(as mentioned here) and ran the
__run.sh
script. But that doesn't output any additional information and I can't find the logs. (The
.tmp
folder appears, but disappears as soon as the command exits.) How do I get the full error message?
f
maybe try
--keep-sandboxes=always
so it s guaranteed to not be deleted?
also given https://www.pantsbuild.org/docs/reference-global#keep_sandboxes it is
--keep-sandboxes
and not
--keep-sandbox
d
Oh, I had it correct locally, I just mistyped it in my post. To be clear, the sandbox is sticking around; that's where the aforementioned
__run.sh
script lives. It's the output logs from running
__run.sh
from inside of the sandbox directory that are not available to me
f
for the
pip
invocation, maybe add
--log <path>
to set a specific file to write to?
(I'm just going by
pip --help
)
d
__run.sh
isn't calling
pip
. It's asking
python
to invoke
./pex
f
ah understood, then let's add the
pex
config options to configure logging. Is
PEX_VERBOSE=9
set?
d
Oh neat, that definitely gets me more log output. I thought I could set
-v 9
to get verbose output. Using
-v 9
gave me more lines as output, but changed the behavior in some other way and lead to a different error.
PEX_VERBOSE=9
is good
f
-v 9
and
PEX_VERBOSE=9
should technically be the same
e
Nope. The -v does not accept an argument. Must
-vvvvvvvvv
👍 1
Presumably fails for Mac arm users: https://pypi.org/project/mlprodict/0.9.1883/#files No wheels; so needs to build and missing required native libs, tools or env var poke throughs on those Mac's.
👍 1
This is a death sentence: https://github.com/sdpython/mlprodict/blob/27d6da4ecdd76e18292f265fde61d19b66937a5c/setup.py#L478-L479 The
setup_requires
mechanism is old, deprecated / removed and buggy. It flat out will not work with Pex. You can fork the repo and add a
pyproject.toml
to use setup.py still, but leverage PEP-518 to get those build requirements properly pre-installed. Then send the repo a PR once you have that working through a VCS requirement. Lots to chew on there, and from my phone, but this style of topic should yield slack search hits.
👍 1
d
Cool, thanks for the rundown. I also noticed that wheels were absent for arm Macs, but
setup.py
is unfamiliar territory to me, so it wasn't obvious why building from sources was failing. Thanks for the explanation!
For now, we're going to try and refactor our code to just avoid using the library altogether, but I've opened a ticket with the repo to see if building for arm Macs is trivial for them to add
e
It is almost certainly not trivial. Mac Arm generally means you need to pay for CI at that point. We have to for Pants for example to support Mac Arm. It's 3 years later too.