https://pantsbuild.org/ logo
#general
Title
# general
l

loud-laptop-89838

12/12/2022, 1:22 PM
Is there a way to clear the pants cache? I've been trying to figure out an issue with my project structure, Finally just deleted the cache and re-ran tailor, which fixed the issue. I was expecting that to happen automatically, but I guess it wouldn't if I didn't change any files? It's really weird, now if I edit
pants.toml
for example, when I run pants again it doesn't seem to know that the edit has been made. I get the same error message that caused me to update. But if I delete
.pants.d
and
pids
then run it works.
w

wide-midnight-78598

12/12/2022, 1:52 PM
I think my second ever Pants issue: https://github.com/pantsbuild/pants/issues/11477 In summary, it's a bit manual right now - but I really feel like we should have a goal for it. ... Unless someone sneakily added one without me knowing. For a full wipe, I do:
Copy code
rm -r ~/.cache/pants
rm -r ./pants.d
rm -r ./pids
./pants version
h

happy-kitchen-89482

12/12/2022, 5:48 PM
In theory clearing the cache should not be necessary except for when debugging Pants itself perhaps. If you're seeing end-user behavior change after deleting caches then that is a bug!
Editing
pants.toml
will cause pantsd to restart, so all the in-memory memoization will be lost and some work will re-run, but cached processes will still be satisfied from the on-disk cache.
w

wide-midnight-78598

12/12/2022, 5:50 PM
“In theory” - practically, I wipe the cache due to transient pseudo-bugs that can’t be replicated once every month or two.
h

happy-kitchen-89482

12/12/2022, 5:50 PM
Yeah, not saying we don't have bugs... 😞
But for example I would expect running tailor, which is idempotent, to not be sensitive to the cache state
1
w

wide-midnight-78598

12/12/2022, 5:52 PM
@loud-laptop-89838 Could you specify what the error was that tailor was intended to solve? Missing targets or something?
w

witty-crayon-22786

12/12/2022, 6:06 PM
https://www.pantsbuild.org/docs/troubleshooting#cache-or-pantsd-invalidation-issues walks through a particular order to try things in, and how to report issues
l

loud-laptop-89838

12/12/2022, 6:07 PM
I think the issue is due to running it as
wsl ./pants ...
when my project is in a windows directory. Pants is working fine for a project that is in Ubuntu (wsl), but I was running into the issue that any file changes wouldn't be picked up by subsequent pants calls, regardless of the call and that project is in a windows directory.
I'm on Windows 10, running wsl2 and Ubuntu 20.04 I think.
h

happy-kitchen-89482

12/12/2022, 6:11 PM
Oh...
Yeah, I would not be surprised if there are file-watching issues in that setup
l

loud-laptop-89838

12/12/2022, 6:26 PM
haha ok good to know. I'll stick to a consistent file system.
w

wide-midnight-78598

12/12/2022, 7:06 PM
Yeahhh, we have looong slack chats about this. And a couple of issues
b

best-autumn-75351

12/12/2022, 11:07 PM
Might it be possible to have an example reproduction of this issue within GitHub actions using the following? https://github.com/marketplace/actions/setup-wsl Might be worth having a failing CI test on record so that the issue is visible?
👀 1
l

loud-laptop-89838

12/12/2022, 11:10 PM
It sounds like it's not something pants can really deal with without the native integration to windows? Not a big deal honestly, I just setup my repo in my wsl home dir and it works fine. This issue came up for a repo that was already setup on the windows filesystem.
6 Views