blue-city-97042
09/19/2023, 4:52 PMpid 75651 -> /Users/jmello/sandbox/pants-build/named_caches/pex_root/venvs/a80988bb3f0e73c2683977f47507e857bda85f08/b1226bdc6f65481853a9719d7912127489403612/bin/python -sE /Users/jmello/sandbox/pants-build/named_caches/pex_root/venvs/a80988bb3f0e73c2683977f47507e857bda85f08/b1226bdc6f65481853a9719d7912127489403612/pex --disable-pip-version-check --no-python-version-warning --exists-action a --no-input --isolated -q --cache-dir /Users/jmello/sandbox/pants-build/named_caches/pex_root/pip_cache --log /private/var/folders/6x/764jvn315hg0clblwyvqy2lrvmwrk7/T/pants-sandbox-gioMjM/.tmp/pex-pip-log.p96kty96/pip.log download --dest /private/var/folders/6x/764jvn315hg0clblwyvqy2lrvmwrk7/T/pants-sandbox-gioMjM/.tmp/tmpgjgv70hm/Users.jmello..pyenv.versions.3.10.3.bin.python3.10 --constraint constraints.txt dkpro-cassis==0.2.1 joblib<2.0.0 numpy<1.25.0 scikit-learn==0.22.2.post1 setuptools>=41.0.0 spacy==2.1.9 --index-url <https://pypi.org/simple/> --retries 5 --timeout 15 exited with 1 and STDERR:
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
I can't seem to figure out how to get the actual log of the build/lockfile generation to see exactly what was happening. I've got the following files that allow reproduction of this issue. For completeness this is on a Mac x86 system. The spacy, thinc, and a couple of other wheels do not have binaries built for this platform, so they will have there deps extracted from an sdist:
BUILD:
python_requirements(
name = "requirements",
resolve = "event_detection"
)
pants.toml
[GLOBAL]
pants_version = "2.17.0"
pants_workdir = "%(buildroot)s/pants-build/.pants.d"
pants_subprocessdir= "%(buildroot)s/pants-build/.pids"
local_store_dir = "%(buildroot)s/pants-build/lmdb_store"
named_caches_dir = "%(buildroot)s/pants-build/named_caches"
backend_packages = [
"pants.backend.python",
"pants.backend.project_info",
"pants.backend.python.lint.pylint",
"pants.backend.shell",
"pants.backend.docker"
]
[python]
interpreter_constraints = [ ">=3.8" ]
default_resolve = "python_default"
enable_resolves = true
[python.resolves]
event_detection = "event-detection.lock"
[python.resolves_to_constraints_file]
event_detection = "constraints.txt"
[python-infer]
use_rust_parser = true
[setup-py-generation]
first_party_dependency_version_scheme = "compatible"
[anonymous-telemetry]
enabled = false
requirements.txt:
dkpro-cassis==0.2.1
numpy<1.25.0
joblib<2.0.0
setuptools>=41.0.0
scikit-learn==0.22.2.post1
spacy==2.1.9
constraints.txt:
wheel>0.32.0,<0.33.0
cymem>=2.0.2,<2.1.0
preshed>=2.0.1,<2.1.0
murmurhash>=0.28.0,<1.1.0
thinc>=7.0.8,<7.1.0
nutritious-carpenter-5676
09/19/2023, 5:14 PMblue-city-97042
09/19/2023, 5:18 PM__run.sh
but I only get that output.blue-city-97042
09/19/2023, 5:19 PMblue-city-97042
09/19/2023, 5:28 PMgenerate-lockfiles
goal in a docker_environment
? We are looking to generate this specifically for a CentOS7 platform.nutritious-carpenter-5676
09/19/2023, 5:35 PMblue-city-97042
09/19/2023, 5:35 PMcurved-television-6568
09/19/2023, 6:10 PMPEX_VERBOSE=9
or so may be illustrative..
see this related thread for more tips & tricks https://pantsbuild.slack.com/archives/C046T6T9U/p1693392344130759blue-city-97042
09/19/2023, 6:18 PMgenerate-lockfiles
target seems to ignore the fallback:
docker_environment(
name = "centos7_python38",
image = "<http://racp-dev.docker.artifactory.rii.io/python38-builder-image:1.0.0|racp-dev.docker.artifactory.rii.io/python38-builder-image:1.0.0>",
platform = "linux_x86_64"
)
local_environment(
name = "local_environment",
compatible_platforms=["linux_x86_64"],
fallback_environment = "centos7_python38"
)
and pants.toml:
[environments-preview.names]
local_environment = "//:local_environment"
centos7_python38 = "//:centos7_python38"
Looking at the code the generate-lockfiles goal should be selecting __local__
as it's environment, which I would have assumed would spin up the appropriate docker environment with all the required goodies.enough-analyst-54434
09/19/2023, 6:32 PMAlso, I would hope that it would be able to glean the dependencies for the package without having to do a binary install.You may have missed:
pip subprocess to install build dependencies did not run successfully.
So these are not runtime dependencies, but build dependencies. If you read through PEP-517 / PEP-518, to even be able to determine final artifact metadata, Pip must be able to load the build backend in question in order to ask it what the artifact metadata is. It's failing to do that. Now, this may be because [build-system] requires = [...]
include more than just the build backend requirements or it may be because its failing to install the results of get_requires_for_build_wheel
which is required before calling prepare_metadata_for_build_wheel
(or build_wheel
) per the spec: https://peps.python.org/pep-0517/#get-requires-for-build-wheel.enough-analyst-54434
09/19/2023, 6:36 PMI can't find a way to get additional output unfortunately. I can keep the sandbox and execute the __run.sh but I only get that output.Add the command line flag
--preserve-pip-download-log
to the Pex command in that file. When you re-run you'll see a tmp file path you can later read or share.curved-television-6568
09/19/2023, 6:37 PMdocker_environment
is not compatible with the specified platform, I think..blue-city-97042
09/19/2023, 6:37 PMcurved-television-6568
09/19/2023, 6:38 PMblue-city-97042
09/19/2023, 6:39 PMenough-analyst-54434
09/19/2023, 6:42 PMenough-analyst-54434
09/19/2023, 6:42 PMblue-city-97042
09/19/2023, 6:44 PMenough-analyst-54434
09/19/2023, 6:49 PMblue-city-97042
09/19/2023, 6:50 PMenough-analyst-54434
09/19/2023, 6:51 PMblue-city-97042
09/19/2023, 6:51 PMcurved-television-6568
09/19/2023, 6:53 PMcurved-television-6568
09/19/2023, 6:56 PM__local__
one.. 🤔curved-television-6568
09/19/2023, 6:56 PMblue-city-97042
09/19/2023, 6:56 PMcurved-television-6568
09/19/2023, 6:57 PMwitty-crayon-22786
09/19/2023, 7:13 PMblue-city-97042
09/19/2023, 7:13 PMwitty-crayon-22786
09/19/2023, 7:14 PMblue-city-97042
09/19/2023, 7:26 PMblue-city-97042
09/19/2023, 7:27 PM