Greetings, pants devs! Hope everyone is well toda...
# development
w
Greetings, pants devs! Hope everyone is well today. @happy-kitchen-89482 and I had a brief discussion about an issue I posted to github last week - #21371. He suggested that I come here to see what you all thought of it. Basic tldr; Our team has encountered the need to use git stash --all. This command stashes and then removes ALL untracked and git-ignored file in the repo. This can lead to orphaned pantsd instances since the pid tracking files get clobbered and also stashes are complicated by lots of pants-related files being stored in them. The issue proposes moving all temporary pants file out of the git repository structure and offers one idea for how pants could determine reliably the location of the temp files by generating a digest of the repository root path. The question for all of you is: does anyone have any concerns or have awareness of any problems that would arise from moving pants data that is not under version control out of the repository structure? Thanks for your time and consideration of the above!
w
I'd casually lurked that issue a week ago or whenever it was created. I know some of the folders have flags to move them around, I -thought- we had a flag to set the directory of
.pants.d
- but I'd never looked for it. If we don't have that, then that seems like a logical first step, no? Stick it alongside
~/.cache/pants/pantsd/[some deterministic path?]
(or make it configurable) I know in some cases, if you, let's say, stick it in temp and you use docker/vscode dev envs - you can run into weird permissions interactions on container reboots/restarts which need handling. But at the top level, 🤷
w
Thanks for those thoughts. You raise some important scenario to keep in mind. If I understood Benjy's comments and the documentation correctly, even when using those config options to move the temp files outside of the repo, there is still a symbolic link created in the repo directing pants to the files. So this doesn't fully resolve the problem of git stash --all / git clean. I like your idea of:
Copy code
~/.cache/pants/pantsd/[some deterministic path?]
w
there is still a symbolic link created in the repo directing pants to the files
Ah, okay, I hadn't looked at this past the logs and pids and stuff
f
At least for system daemons, I recall PID files and the like are supposed to go in
/var/run
-- What is the user-specific version of
/var/run
?
w
That's a great question, @fast-nail-55400.
p
We could also cheat, and push the files/symlinks under the .git directory. Maybe with
.git/pants/d/
and
.git/pants/pids/
?
👍 1
w
I think just exposing a new
pantsd_folder
or whatever to config - then users can place them wherever they want, rather than imposing any specific location outside of the default
w
That's totally fine, so long as the same config value in pants.toml files in different repose will not cause conflicts. In other words, if I can put something like
pantsd_folder = ~/.pantsd
in all my pants.toml files and trust that pants will keep each repo's data separated, I'm happy.
w
Can probably even put it in your
~/.pants.rc
but then that wouldn't be for all your team