high-magician-46188
10/09/2023, 8:31 AMpants --version
07:57:59.01 [ERROR] Work directory ../current-branch-name escapes build root /path/to/jenkins/workspace/some-other-random-branch
I'm not sure if it is something I can control, or is it a Pants bug.
I didn't find a ticket for it in GitHub or seen it mentioned on Slack.
My current solution is each time it happens to SSH into the CI instance and rm -rf
the folder of the other branch.
Has anyone else experienced it or have a suggestion?gorgeous-winter-99296
10/09/2023, 1:33 PMpantsd
, otherwise just killing pantsd
at the end of a build or at the start of the next should fix it.
Edit: from below repro`, rm -rf .pids
should work equally well since it should be unique per directory.gorgeous-winter-99296
10/09/2023, 1:36 PMgorgeous-winter-99296
10/09/2023, 1:45 PMpkill pantsd
rm -rf .pids ../copy2/.pids
pants --version
cp -r .pids ../copy2/.pids
(cd ../copy2 && pants --version)
Which doesn't say much about why it happens for you though. Does jenkins do something smart like cache repositories or copy from main to avoid doing full pulls?high-magician-46188
10/09/2023, 2:02 PMlocal_execution_root_dir = "/var/jenkins_home/pants/tmp"
local_store_dir = "/var/jenkins_home/pants/lmdb_store"
named_caches_dir = "/var/jenkins_home/pants/named_caches"
pants_subprocessdir = "/var/jenkins_home/pants/pids"
high-magician-46188
10/09/2023, 2:02 PMpids
folder is shared...gorgeous-winter-99296
10/09/2023, 2:08 PMpkill pantsd
pants --pants-subprocessdir=/tmp/pids --version
(cd ../copy2 && pants --pants-subprocessdir=/tmp/pids --version)
high-magician-46188
10/09/2023, 2:19 PMpants_subprocessdir = "/var/jenkins_home/pants/{version}/pids"
?gorgeous-winter-99296
10/09/2023, 2:21 PMhigh-magician-46188
10/09/2023, 2:28 PMpants_subprocessdir
I'm not sure.
The documentation says about it:
The directory to use for tracking subprocess metadata. This should live outside of the dir used by pants_workdir to allow for tracking subprocesses that outlive the workdir data.
So if for each branch, I have a different copy of the repo, does it mean I need to not share it between them?
Though it probably won't help me anyway, as if I run CI for a branch, then update Pants' version and then run CI again for the same branch, the .pids
folder will be shared again.gorgeous-winter-99296
10/09/2023, 2:32 PMgit clone ...
(cd ... && run-ci)
rm -rf ...
this setting would allow you to keep pantsd running despite the dir disappearing. Or if you run multiple pants processes in the same directory for different CI runs, maybe. I'd skip setting it and see if anything breaks with your specific setup, but I don't think so.
The version-bump is fine; that would cause a panstd restart since the options have changed.high-magician-46188
10/09/2023, 2:35 PM