fast-xylophone-56613
03/31/2025, 12:48 PM[WARN] Pants cannot infer owners for the following imports - do I need to address those to fix this?pex_binary I'm having this caching problem with:
pex_binary(
name='migrate',
entry_point='src/tools/migrate.py',
layout='loose',
dependencies=[
'service/web/manage.py:lib',
],
)wide-midnight-78598
03/31/2025, 1:45 PMfast-xylophone-56613
03/31/2025, 1:45 PMwide-midnight-78598
03/31/2025, 1:45 PMfast-xylophone-56613
03/31/2025, 1:45 PM14:45:34.76 [INFO] Initializing scheduler...
14:45:34.77 [INFO] Initializing Nailgun pool for 28 processes...
14:45:35.74 [INFO] Scheduler initialized.
ā ¤ 4.73s Resolve transitive targets
It spends a lot of time on that stepwide-midnight-78598
03/31/2025, 1:45 PMwide-midnight-78598
03/31/2025, 1:46 PMfast-xylophone-56613
03/31/2025, 1:46 PMpex_binary above šfast-xylophone-56613
03/31/2025, 1:46 PMpants run :migratefast-xylophone-56613
03/31/2025, 1:48 PMwide-midnight-78598
03/31/2025, 1:48 PMfast-xylophone-56613
03/31/2025, 1:48 PM14:47:21.22 [ERROR] The scheduler was invalidated: Exception('pantsd process 34119 was using 4096.41 MiB of memory (above the `--pantsd-max-memory-usage` limit of 4096.00 MiB).')wide-midnight-78598
03/31/2025, 1:49 PMpants peek to make sure the dependencies are what you expect (there are other commands that are less verbose than peek, but I always peek - out of habitwide-midnight-78598
03/31/2025, 1:49 PM4096.41 MiB
Oh come on ... 0.41
Maybe try upping that command's memory, see what happens?
Also, that shouldn't be in a log - that should be on the command line, no?fast-xylophone-56613
03/31/2025, 1:49 PMfast-xylophone-56613
03/31/2025, 1:50 PMwide-midnight-78598
03/31/2025, 1:50 PMfast-xylophone-56613
03/31/2025, 1:50 PMwide-midnight-78598
03/31/2025, 1:50 PMfast-xylophone-56613
03/31/2025, 1:50 PMfast-xylophone-56613
03/31/2025, 1:52 PMwide-midnight-78598
03/31/2025, 1:53 PMwide-midnight-78598
03/31/2025, 1:54 PMwide-midnight-78598
03/31/2025, 1:55 PMfast-xylophone-56613
03/31/2025, 1:55 PMfast-xylophone-56613
03/31/2025, 1:55 PM1244160 51311 pants.engine.fs.PathGlobs
2302800 28785 builtins.Snapshot
2392176 49837 pants.engine.target.DependenciesRequest
2392176 49837 pants.engine.target.ExplicitlyProvidedDependenciesRequest
2438080 30479 builtins.Digest
3624904 3504 (native) scandir
4121185 1225 (native) process
8734674 25114 (native) digest_file
9775535 25391 (native) pants.engine.intrinsics.path_globs_to_digest
11082225 28785 (native) pants.engine.intrinsics.digest_to_snapshot
19187245 49837 (native) pants.engine.internals.graph.convert_dependencies_request_to_explicitly_provided_dependencies_request
25293270 25391 (native) snapshotwide-midnight-78598
03/31/2025, 1:56 PMfast-xylophone-56613
03/31/2025, 2:00 PMfast-xylophone-56613
03/31/2025, 2:01 PMwide-midnight-78598
03/31/2025, 2:28 PMpants peek :: from the root dir and ensure it completes? I recall vaguely that someone had a symlink that was causing something like this (slow runs, lots of memory) but simpler commands just failedwide-midnight-78598
03/31/2025, 2:29 PMfast-xylophone-56613
03/31/2025, 2:31 PMnode_modules/.bin, but for the moment pants is only working on Python stufffast-xylophone-56613
03/31/2025, 2:32 PMpeek :: works okaywide-midnight-78598
03/31/2025, 2:33 PMfast-xylophone-56613
03/31/2025, 2:34 PMpants dependencies --transitive :migrate outputs what I expect it to. But it is picking up all the node files so maybe that's where it's strugglingwide-midnight-78598
03/31/2025, 2:35 PMfast-xylophone-56613
03/31/2025, 2:36 PMfast-xylophone-56613
03/31/2025, 2:36 PMwide-midnight-78598
03/31/2025, 2:37 PMfast-xylophone-56613
03/31/2025, 2:41 PMwide-midnight-78598
03/31/2025, 2:42 PMfast-xylophone-56613
03/31/2025, 2:42 PMwide-midnight-78598
03/31/2025, 2:42 PMwide-midnight-78598
03/31/2025, 2:43 PMfast-xylophone-56613
03/31/2025, 2:43 PMwide-midnight-78598
03/31/2025, 2:43 PMwide-midnight-78598
03/31/2025, 2:44 PMdist folder, what happens if you run that directly?fast-xylophone-56613
03/31/2025, 2:45 PMwide-midnight-78598
03/31/2025, 2:45 PMpants run
If you run pants package :migrate - it should materialize that pex_binary to a dist folderwide-midnight-78598
03/31/2025, 2:46 PMfast-xylophone-56613
03/31/2025, 2:47 PMpython ./dist/migrate.pex/__main__.py is in the 2s range, so that's working rightfast-xylophone-56613
03/31/2025, 2:47 PMwide-midnight-78598
03/31/2025, 2:48 PMpackage that time take any significant amount of time? How big/number of files in that pex?fast-xylophone-56613
03/31/2025, 2:49 PMpants package :migrate is about 3s or just underfast-xylophone-56613
03/31/2025, 2:49 PMwide-midnight-78598
03/31/2025, 2:51 PMwide-midnight-78598
03/31/2025, 2:53 PMfast-xylophone-56613
03/31/2025, 2:55 PMexecution_mode='venv' is a lot faster šwide-midnight-78598
03/31/2025, 2:55 PMwide-midnight-78598
03/31/2025, 2:57 PMloose setup, you spend a lot of I/O timefast-xylophone-56613
03/31/2025, 2:58 PMwide-midnight-78598
03/31/2025, 2:58 PMfast-xylophone-56613
03/31/2025, 2:58 PMwide-midnight-78598
03/31/2025, 3:00 PMfast-xylophone-56613
03/31/2025, 3:01 PMfast-xylophone-56613
03/31/2025, 3:03 PMwide-midnight-78598
03/31/2025, 3:05 PMwide-midnight-78598
03/31/2025, 3:05 PMpex_binary(
name="multipex",
dependencies=[":multipex-deps", ":multipex-srcs"],
entry_point="main.py",
execution_mode="venv",
layout="packed",
)
Like, I can't recall off the top of my head whether this idea in the end was actually faster, or if it was just more overheadwide-midnight-78598
03/31/2025, 3:08 PMfast-xylophone-56613
03/31/2025, 3:10 PMfast-xylophone-56613
03/31/2025, 3:11 PMpants export - not a lot of docs on there š Would it be something like pants export --bin=migrate?wide-midnight-78598
03/31/2025, 3:16 PMThat multipex doesn't seem to make any difference in time takenYeah, it seems like a lot of the time spent here anyways is on deleting and then materializing a bunch of files? But, I'm not sure I'd have to give that some thought. https://www.pantsbuild.org/stable/reference/goals/expor Re: export - generally I would export everything into a venv, and operate out of there. I think
pants export :: or similar, and then just work out of the dist (it's intended for IDEs and stuff - https://www.pantsbuild.org/stable/docs/using-pants/setting-up-an-ide)fast-xylophone-56613
03/31/2025, 3:35 PMfast-xylophone-56613
03/31/2025, 3:36 PMfast-xylophone-56613
03/31/2025, 3:36 PMwide-midnight-78598
03/31/2025, 3:37 PM