stale-waitress-56895
04/28/2025, 9:08 AMtime pants run //helpers/utils:utils
Usage: utils.pex [OPTIONS] COMMAND [ARGS]...
Utility commands for working with Pants build system.
Options:
--help Show this message and exit.
Commands:
env Generate PYTHONPATH environment variables from Pants roots.
list List targets in the repository.
roots Show the pants build roots.
real 0m9.211s
user 0m5.290s
sys 0m1.500s
full-nightfall-13189
04/28/2025, 3:44 PMdocker run --rm -v ${PWD}:/work -w /work <http://cgr.dev/chainguard/apko|cgr.dev/chainguard/apko> build image.yaml image:test test.tar.
• docker load < test.tar
And then I can run the image.broad-processor-92400
04/29/2025, 5:07 AMpants.toml
to say pants_version = "2.26.0rc0"
2. Run your favourite commands like pants lint ::
and/or run it through your CI
3. Let me know how it goes! If it works, or if there's issues/questions.
By testing in advance, you help the Pants project and help yourself too: the sooner we catch issues, the better. Thank you!
(If you have more time, please read over the release notes and test any features that catch your eye.)bland-cpu-3662
04/29/2025, 1:26 PMrefined-cat-61929
04/29/2025, 9:21 PMdocker run -v
) because there's just no way to customize docker running for environments.
This is somewhat related to https://github.com/pantsbuild/pants/issues/18577, but in this case, we need to customize the docker run args, not the environment variable passed to the docker run command.
My question is: is my understanding of the limitations correct? Am I missing some other way to do what we want? And if my understanding is correct, and there is no other way, should I open up a feature request for this?microscopic-knife-5995
04/29/2025, 10:19 PMvLLM
to my project and did a pants generate-lockfiles
it successfully resolves the dependency and generate lock files but wen I run the test pants test ::
I get:
stderr:
Failed to resolve requirements from PEX environment @ /private/var/folders/ng/pwvk62kx1qjfrw51wg4_bbtr0000gp/T/pants-sandbox-wZAf5t/requirements.pex.
Needed cp311-cp311-macosx_15_0_arm64 compatible dependencies for:
1: datasets
Required by:
vllm 0.8.5
But this pex had no ProjectName(raw='datasets', validated=False, normalized='datasets') distributions.
While in the lock file, I can see the architecture: datasets-3.5.0-py3-none-any.whl
. How come generate-lockfiles
is successful on getting the whl
info but not pants test
/ pex? Is there away to get around this issue? Thank you! 🙏powerful-scooter-95162
04/30/2025, 8:04 PMambitious-actor-36781
05/01/2025, 7:20 AMfast-xylophone-56613
05/01/2025, 11:29 AMpants package
. I'm building Python PEX apps, but for one of our target systems I need to use a custom wheel (I think because the OpenSSL version on the system is really frickin' ancient but that's by-the-by). I've set up a wheels directory and added this to my pants.toml:
[python-repos]
find_links = ['file://%(buildroot)s/wheels']
path_mappings = ['WHEELS_DIR|%(buildroot)s/wheels']
Which all works perfectly fine when I use pants package
on my Mac. But when it runs on GitHub actions (Ubuntu), it seems to create a package without using the custom wheel I've supplied.
I'm guessing the reason is that because Pants detects it's running on Linux, it thinks "aha, I can compile this myself, no need for that wheel file". Can I somehow force Pants to prefer my supplied wheel rather than compiling its own?fast-xylophone-56613
05/01/2025, 11:51 AMbrief-engine-92399
05/01/2025, 10:37 PMfast-xylophone-56613
05/02/2025, 10:41 AMresolves_to_no_binary
but that doesn't seem to do what I want, which is for the dependency to be compiled on the prod system at runtime, rather than being pre-builtwhite-appointment-6770
05/05/2025, 9:39 PM--experimental_allow_proto3_optional
to protoc when pants build the *_pb2 files. Looking at the porotbuf_spource and protobuf_sources targets does not reveal any properties for specifying additional protoc parameters. Is this accurate or did I miss it?elegant-art-7479
05/06/2025, 3:31 PMload metadata <image name>
appears in the logs. However, it hangs forever, there are no warnings or network activity during this. When I pull the base image manually, the build works fine. I doubt it's a network-related problem because we pull various dependencies during the build, and it works fine. Building with Docker directly also works fine.
Any idea what's wrong here? I browsed Slack and all threads that contain a mention of load metadata
show an error, while in my case there's no error, it just keeps hanging.
CC @clean-policeman-96974helpful-continent-43698
05/06/2025, 8:20 PMhappy-sundown-654
05/06/2025, 10:31 PMpants \
--changed-since=origin/main \
tailor --check \
update-build-files --check \
lint
18:25:47.80 [INFO] Initializing scheduler...
18:25:47.82 [INFO] Initializing Nailgun pool for 24 processes...
18:25:50.15 [INFO] Scheduler initialized.
18:25:51.94 [ERROR] 1 Exception encountered:
Engine traceback:
in Update all BUILD files
ProcessExecutionFailure: Process 'Find interpreter for constraints: CPython<4,>=3.7' failed with exit code 1.
stdout:
stderr:
No supported version of Pip is compatible with the given targets:
cp312-cp312-macosx_14_0_arm64 interpreter at /opt/miniconda3/envs/greenfield/bin/python3.12
cp313-cp313-macosx_14_0_arm64 interpreter at /opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/bin/python3.13
cp39-cp39-macosx_14_0_arm64 interpreter at /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9
Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
I'm currently running things in version 2.22.0
broad-processor-92400
05/08/2025, 7:38 AMstale-truck-36011
05/08/2025, 8:05 AMsparse-florist-94998
05/08/2025, 4:30 PMdef get_docker_platform():
env_platform = os.getenv("DOCKER_PLATFORM")
if env_platform:
return env_platform
arch = platform.machine()
if arch == "x86_64":
return "linux/amd64"
elif arch in ["aarch64", "arm64"]:
return "linux/aarch64"
else:
raise ValueError(f"Unsupported architecture: {arch}")
This function is working when no env variable is set, but when I try to set the env variable in my terminal it's ignored. do you have any idea how I could fix it?elegant-art-7479
05/08/2025, 9:17 PMfiles
or docker_image
, but because no imports are allowed in the macro files, patching doesn't really work. I'd expect there are some utils that let us verify if given target functions were calledbreezy-apple-27122
05/09/2025, 8:08 AMelegant-art-7479
05/09/2025, 2:25 PM[docker]
build_verbose = true
but it prints the logs from Docker only after the command concludes. All we see for several minutes is e.g.:
14:17:25.02 [INFO] Starting: Building docker image <image name>
busy-ram-14533
05/09/2025, 4:21 PMzsh
completions with pants complete
and it doesn't seem to have made any difference. I'm wondering if anyone else noticed this? Or am I doing something wrong?
More specifically, if I type pants
in the repo root and hit tab, it only suggests the local files and folders to autocomplete. If I type something like pant fm
or pants li
and hit tab, it does not auto-complete the goal namesgentle-flower-25372
05/09/2025, 8:25 PM--find-links
repo or a custom --index
.proud-dentist-22844
05/11/2025, 5:49 AMpython-ldap
.
The wheel ends up with the linux_x86_64
platform tag (not with manylinux*
because it links against libldap
which is not one of the allowed libs for manylinux*
. For python-ldap
that is problematic because every distro and distro version seems to have a different version of libldap
, so I can't reuse the pex anywhere except on the distro version I used to build it.
So, it would be great if I could create a pex that includes an sdist instead of a wheel whenever the platform tag is too generic. That would require pex to build the wheel when the pex is first used instead of when building the pex. Is that possible?
More details in 🧵.hundreds-lion-13128
05/12/2025, 7:09 AMpants lint ::
it throws a bunch of warnings, all right. However, when I re-run it, I suppose the warnings aren't shown anymore because of caching. However, it would be good if the output were shown, regardless of whether it is cached. That makes it easier to resolve warnings.
Or is there another trick to show warning caching regardless?happy-kitchen-89482
05/12/2025, 2:15 PMhappy-kitchen-89482
05/12/2025, 2:52 PMstale-truck-36011
05/12/2025, 3:44 PM.pex
binaries with pants, and I noticed there are options to pex_binary
targets that lets you include or exclude sources and dependencies.
I'm wondering if there's a smooth way to reduce packaging time in those cases where the dependencies haven't changed. For instance, we have quite a few binaries that package torch
, which takes a cool 800MB and a handful of minutes to package, and it adds up to a lot of unnecessary time and resources.
Is there a nice way to incrementally build the pex, or something else? I'm open to trying out the different layout
options too.
Right now we just build them with mostly default options to pex_binary
.hundreds-lion-13128
05/13/2025, 7:05 AM21:00:00.00 [ERROR] Invalid table name [new-subsystem-config] in pants.toml
21:00:00.00 [ERROR] Invalid config entries detected. See log for details on which entries to update or remove.
Similarly, when my checkout removes targets in BUILD files, the server doesn't seem to notice and I get warnings like "no matching files for glob '...' in 'old_target'".