https://pantsbuild.org/ logo
a

ambitious-xylophone-5772

10/19/2022, 9:46 PM
Hi all, I was wondering if pants had a proper clear-all function to clean out all cached files? I saw that it was supported for older versions, but not the new versions of pants?
w

witty-crayon-22786

10/19/2022, 9:51 PM
hey! so far, we haven’t had requests for a goal to wipe the caches, except to manage disk usage: see this FAQ entry: https://www.pantsbuild.org/docs/troubleshooting#cache-or-pantsd-invalidation-issues
this ticket covers adding a “garbage collection” goal: https://github.com/pantsbuild/pants/issues/11167 … but that’s for the purposes of disk usage
a

ambitious-xylophone-5772

10/19/2022, 10:23 PM
Hmmm I see. That’s a bummer, because I’ve run into a few cases where clearing out a bunch of folders has solved a bunch of problems. I now just have an alias that does this:
rm -rf ~/.cache/pants ~/.pex dist .pids .pants.d
I feel like it would make sense to have a function that would just clear it all out, no?
w

witty-crayon-22786

10/19/2022, 10:24 PM
well, see the “Troubleshooting” entry i linked: we’d like to fix those issues, and your case is fairly rare
👀 1
rather than running that script, if you’re able to file a bug, that would be handy
a

ambitious-xylophone-5772

10/19/2022, 10:25 PM
Ah I see, gotcha
I’ll try to open up an issue next time I face such a problem
It’s an interesting philosophy to try and solve all the bugs related to cache invalidation. I feel like this is a case where “worse is better” and having a nice way to clear all caches might be helpful when really stuck with various bugs 🙂 , but fair enough.
w

witty-crayon-22786

10/19/2022, 10:34 PM
you are the first person in the last three months to have asked for it (…our Slack history doesn’t go further back), heh… i hope that we’re actually not just scaring folks out of reporting bugs, but yes: our goal is to fix them
👀 1
a

ambitious-xylophone-5772

10/19/2022, 10:35 PM
Ha! That’s amazing, I figured it would be something that people would’ve asked more of but I guess not! Interesting. Maybe I’m just doing things I shouldn’t be doing with pants…I promise I’ve been following the docs! 🙂
w

witty-crayon-22786

10/19/2022, 10:36 PM
there is one reported issue with the
.pex
directory now, so i’m curious what your issue is
👀 1
a

ambitious-xylophone-5772

10/19/2022, 11:28 PM
If I ever run into one again I will let you know! @witty-crayon-22786
w

witty-crayon-22786

10/19/2022, 11:28 PM
thank you!
h

high-magician-46188

10/20/2022, 7:23 AM
Actually, I’ve got one to report. In a this Discussion, I’m describing an issue I’m having. At the end there is a reproduction repo. For the issue to be reproduced consistently, I’m running
rm -rf .pids
before
pants package ::
. I was actually thinking about whether or not I should report it and this made me decide to do that. Should I open an “Issue” on GH? Also, I’d you’d like to get that reported, you’d might want to put up a section for cache-invalidation in the docs and in the CLI’s help as a click-bait. The user will expect it to have docs on how to invalidate and what it does and instead will find a request to file a report for their use-case for it to be fixed.
h

happy-kitchen-89482

10/20/2022, 11:06 AM
An issue would be great!
For the record, nuking the
.pids
is reproducing the issue just because it forces pantsd to restart. But you can also reproduce it with
--no-pantsd
.
👀 1
What’s happening is, since this is a warning, not an error, the result is still memoized in pantsd’s memory, so to reproduce it you need to restart pantsd
that’s not quite the same as the persistent cache on disk, which survives pantsd restarts
w

witty-crayon-22786

10/20/2022, 4:42 PM
Also, I’d you’d like to get that reported, you’d might want to put up a section for cache-invalidation in the docs and in the CLI’s help as a click-bait. The user will expect it to have docs on how to invalidate and what it does and instead will find a request to file a report for their use-case for it to be fixed.
ah, yea: something on the CLI would be good. you will get a prompt to file an issue when an exception happens, but not sure what other cases to trigger it in. as it stands, this item is the primary documentation on that: https://www.pantsbuild.org/docs/troubleshooting#cache-or-pantsd-invalidation-issues
s

straight-action-80318

12/16/2022, 3:34 AM
Late to the party, but I’ll chime in here that I someone ended up in a state where I was getting
Copy code
Exception: Could not identify a process to backtrack to for: Missing digest
Clearing out all the caches seems to have fixed it
w

witty-crayon-22786

12/16/2022, 4:23 AM
@straight-action-80318: mm, thanks for the report. in future, please try to follow the instructions at https://www.pantsbuild.org/docs/troubleshooting#cache-or-pantsd-invalidation-issues : it will help to determine what kind of bug we’re dealing with, and will guide you through filing an issue
what version of Pants was that? and were you using a non-default setting of cache_content_behavior?
7 Views