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

curved-manchester-66006

05/12/2023, 7:41 PM
I've been debugging an issue for 2 days that I think I can describe, but don't have a minimal working example I've extracted from internal code to share. We use GitLab which get's cranky if you try to cache files that live outside the "CI_PROJECT_DIR" (the directory the git repo is checked out to. So in CI we set
named_caches_dir = '.cache/pants/named_caches'
. This worked fine, but recently while trying to merge two repositories we ended up with a
.gitignore
setting of
.cache
(that is matching the
named_caches_dir
). Pants then... mostly seems to work but does whacky things like
AttributeError: module 'pendulum' has no attribute 'tz'
(where pendulum totally has said attribute) when running some goals. part of the short term answer can be "dont' do that", but: • A cache seems like a reasonable thing to want to gitignore. • I'm not sure what other bugs might be latent
b

broad-processor-92400

05/12/2023, 9:37 PM
Is something else writing to/making changes in .cache? Does the problem persist if you rename the pants one to .pants-cache or similar?
(And for the second one, if doesn’t persist, does adding .pants-cache to .gitignore make it pop up again?)
c

curved-manchester-66006

05/13/2023, 12:47 AM
.Is something else writing to/making changes in .cache?
None of the code being run (the unit tests) is writing there.
Does the problem persist if you rename the pants one to .pants-cache or similar?
Amusingly
.pants-cache
is also matched by a gitignore rule in this repository. But the problem does go away with
named_caches_dir = '.los-pantalones-cache/pants/named_caches'
> (And for the second one, if doesn’t persist, does adding .pants-cache to .gitignore make it pop up again?) Yes adding
.los-pantalones-cache*
to
.gitignore
causes the error to reoccur. In case it helps (with the failure):
Copy code
$ find .los-pantalones-cache -iname pendulum
.los-pantalones-cache/pants/named_caches/pex_root/venvs/747154802a68bcb895f4a6b7cf72ae22f0b79821/a0667c3b93616650d128c0fb95a0e63dda357018/lib/python3.10/site-packages/pendulum
.los-pantalones-cache/pants/named_caches/pex_root/installed_wheels/c42051da34b4b8ffb6575354a454a5472dbd414744f063d8e1c63ce45209bdb3/pendulum-2.1.2-cp310-cp310-manylinux_2_36_x86_64.whl/pendulum
$ tree .los-pantalones-cache/pants/named_caches/pex_root/venvs/747154802a68bcb895f4a6b7cf72ae22f0b79821/a0667c3b93616650d128c0fb95a0e63dda357018/lib/python3.10/site-packages/pendulum
.los-pantalones-cache/pants/named_caches/pex_root/venvs/747154802a68bcb895f4a6b7cf72ae22f0b79821/a0667c3b93616650d128c0fb95a0e63dda357018/lib/python3.10/site-packages/pendulum
├── _extensions
│   └── _helpers.cpython-310-x86_64-linux-gnu.so
├── parsing
│   └── _iso8601.cpython-310-x86_64-linux-gnu.so
└── py.typed

2 directories, 3 files
So somehow the .py files are "missing"? I was sort of hoping there was an obvious negation error in
src/rust/engine/fs/src/gitignore.rs
or something but this continues to look spooky.
👍 1
b

broad-processor-92400

05/13/2023, 3:58 AM
Weird! Sounds like it’s clear that there’s some sort of weird interaction between cache and gitignore. Could you file an issue?
c

curved-manchester-66006

05/15/2023, 8:21 PM