cold-soccer-63228
08/28/2023, 6:19 PMError: Operation timed out (os error 60)
Reason: Operation timed out (os error 60)curved-television-6568
08/28/2023, 6:22 PMcold-soccer-63228
08/28/2023, 6:25 PM<your_platform_dir>?
source ~/.cache/pants/pants_dev_deps/<your platform dir>/bin/activatecurved-television-6568
08/28/2023, 6:29 PMIt extracts the needed files into a base directory that is traditionally located in the local user cache subdirectoryyou see which when ever you get your pants bootstrapped on a new version(nceon Linux,~/.cache/nceon macOS and~/Library/Caches/nceon Windows).~\AppData\Local\nce
cold-soccer-63228
08/28/2023, 7:02 PM./pants <cmd> ...curved-television-6568
08/28/2023, 7:05 PMInstalling pantsbuild.pants==2.16.0 into a virtual environment at /Users/andreas.stenius/.cache/pants/setup/bootstrap-Darwin-arm64/2.16.0_py39
curved-television-6568
08/28/2023, 7:05 PMcurved-television-6568
08/28/2023, 7:06 PMcurved-television-6568
08/28/2023, 7:07 PM~/.cache/pants/pants_dev_deps/Darwin.arm64.arm.py39.venv/bin/activatecurved-television-6568
08/28/2023, 7:08 PMcurved-television-6568
08/28/2023, 7:09 PMcold-soccer-63228
08/28/2023, 7:10 PM~/.cache/pants/ directory…
ls ~/.cache/pants/
lmdb_store named_caches setupenough-analyst-54434
08/28/2023, 7:29 PM~/.cache/pants/setup - @curved-television-6568 was assuming you were hacking on Pants, but it appears you're just using a released Pants in your own repo.enough-analyst-54434
08/28/2023, 7:30 PMpants.toml, although IIRC the obvious dir is a symlink to a tmpdir-style-sibling dir.enough-analyst-54434
08/28/2023, 7:33 PM./pants script checked in:
$ ls -l ~/.cache/pants/setup/bootstrap-Linux-x86_64/
total 16
lrwxrwxrwx 1 jsirois jsirois 76 Aug 28 12:32 2.14.0_py39 -> /home/jsirois/.cache/pants/setup/bootstrap-Linux-x86_64/pants.m5B9ZS/install
drwx------ 3 jsirois jsirois 4096 Aug 28 12:32 pants.m5B9ZS
drwxr-xr-x 2 jsirois jsirois 4096 Aug 28 12:31 pex-2.1.103
drwxr-xr-x 2 jsirois jsirois 4096 Aug 28 12:32 virtualenv-20.4.7cold-soccer-63228
08/28/2023, 7:33 PMsource ~/.cache/pants/setup/bootstrap-Darwin-arm64/2.15.1_py39/bin/activate
export PYTHONPATH=src/pants:$PYTHONPATH
sudo py-spy record --subprocesses -- python -m pants.bin.pants_loader --no-pantsd --changed-since=origin/master dependees --transitive --closedcold-soccer-63228
08/28/2023, 7:34 PMdependees --transitive command takes a super long time to run. but we want to confirm if that hypothesis is true, so we wanted to profile a run of the dependees --transitive commandenough-analyst-54434
08/28/2023, 7:35 PMenough-analyst-54434
08/28/2023, 7:35 PMenough-analyst-54434
08/28/2023, 7:37 PMpants -V to get the pantsd up, use that pid to attach to, then run the command you care to profile.curved-television-6568
08/28/2023, 7:39 PMenough-analyst-54434
08/28/2023, 7:40 PMenough-analyst-54434
08/28/2023, 7:41 PMenough-analyst-54434
08/28/2023, 7:42 PMcold-soccer-63228
08/28/2023, 7:54 PMcold-soccer-63228
08/28/2023, 7:55 PMenough-analyst-54434
08/28/2023, 7:57 PMcold-soccer-63228
08/28/2023, 7:58 PMenough-analyst-54434
08/28/2023, 7:58 PM-- python ... - A bare python is dangerous! What is python? System, brew, other?enough-analyst-54434
08/28/2023, 7:59 PMenough-analyst-54434
08/28/2023, 8:00 PMenough-analyst-54434
08/28/2023, 8:05 PMpython certainly doesn't mean what you think it means.enough-analyst-54434
08/28/2023, 8:06 PMsudo -E ..., but still, better an abs path.cold-soccer-63228
08/28/2023, 8:39 PMsudo -E py-spy record --subprocesses -- /Users/hughhan/.local/share/virtualenvs/front-porch-2eoLkmA-/bin/python -m pants.bin.pants_loader --no-pantsd --changed-since=origin/master dependees --transitive --closedcold-soccer-63228
08/28/2023, 8:39 PM/Users/hughhan/.local/share/virtualenvs/front-porch-2eoLkmA-/bin/python: Error while finding module specification for 'pants.bin.pants_loader' (ModuleNotFoundError: No module named 'pants')cold-soccer-63228
08/28/2023, 8:40 PMexport PYTHONPATH=src/pants:$PYTHONPATHcold-soccer-63228
08/28/2023, 8:41 PMenough-analyst-54434
08/28/2023, 8:43 PM~/.cache/pants/setup/... and certainly not ~/.local/....cold-soccer-63228
08/28/2023, 8:43 PMenough-analyst-54434
08/28/2023, 8:43 PMcold-soccer-63228
08/28/2023, 8:44 PMenough-analyst-54434
08/28/2023, 8:45 PMpython or unqualified paths in general when debugging.enough-analyst-54434
08/28/2023, 8:45 PMcold-soccer-63228
08/28/2023, 8:45 PMenough-analyst-54434
08/28/2023, 8:46 PMcold-soccer-63228
08/28/2023, 8:46 PMcold-soccer-63228
08/28/2023, 8:47 PMcold-soccer-63228
08/28/2023, 8:47 PMcold-soccer-63228
08/28/2023, 8:47 PMls -l ~/.cache/pants/setup/bootstrap-Darwin-arm64/2.15.1_py39/bin
[...]
lrwxr-xr-x 1 hughhan staff 63 May 26 14:45 python -> /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9enough-analyst-54434
08/28/2023, 8:48 PMenough-analyst-54434
08/28/2023, 8:48 PMcold-soccer-63228
08/28/2023, 8:51 PMcold-soccer-63228
08/28/2023, 8:51 PMBootstrapping Pants using /opt/homebrew/opt/python@3.9/libexec/bin/python
Installing pantsbuild.pants==2.15.1 into a virtual environment at /Users/hughhan/.cache/pants/setup/bootstrap-Darwin-arm64/2.15.1_py39enough-analyst-54434
08/28/2023, 8:51 PMcold-soccer-63228
08/28/2023, 8:51 PM[ERROR] Absolute spec path /opt/homebrew/Cellar/python@3.9/3.9.16/Frameworks/Python.framework/Versions/3.9/bin/python3.9 does not share build root /Users/hughhan/src/front-porchcold-soccer-63228
08/28/2023, 8:52 PMcd into the directory of my Python?..enough-analyst-54434
08/28/2023, 8:52 PMenough-analyst-54434
08/28/2023, 8:52 PMcold-soccer-63228
08/28/2023, 8:54 PMcold-soccer-63228
08/28/2023, 8:58 PMcold-soccer-63228
08/28/2023, 8:58 PMenough-analyst-54434
08/28/2023, 8:59 PMcurved-television-6568
08/28/2023, 9:00 PMpyenv …enough-analyst-54434
08/28/2023, 9:02 PMwitty-crayon-22786
08/28/2023, 10:53 PMpy-spy to a running process is much easier (and we should probably update those instructions).
in that case, you:
1. start pantsd (e.g. using pants help),
2. find the pid of pantsd using e.g. ps -ef | grep pantsd
3. attach to pantsd using sudo py-spy record --format flamegraph -o ~/Desktop/pantsd-help.svg -p $PID
4. execute the command you want to profile
5. ctrl+c out of py-spywitty-crayon-22786
08/28/2023, 10:54 PMpantsd itself, butenough-analyst-54434
08/28/2023, 11:46 PMwitty-crayon-22786
08/28/2023, 11:48 PMenough-analyst-54434
08/28/2023, 11:49 PMenough-analyst-54434
08/28/2023, 11:50 PMcold-soccer-63228
08/29/2023, 1:16 AMnutritious-carpenter-5676
02/04/2024, 2:19 PM