Having some trouble getting `pants_ignore.add` to ...
# general
b
Having some trouble getting
pants_ignore.add
to not ignore a `.gitignore`d dir.
Copy code
# .gitignore
/deps/libs/*/versions/
Copy code
# pants.toml
pants_ignore.add = [
    "!/deps/libs/thing/versions/active",
]
Copy code
# deps/libs/thing/BUILD.pants
files(
    name="srcs",
    sources=["versions/active/src/**"],
)
Results in:
Copy code
Unmatched glob from deps/libs/thing:srcs's `sources` field: "deps/libs/thing/versions/active/src/**"
1
If I change my
pants.toml
to use
!/deps/libs/thing/versions
it'll hit an absolute symlink, so thats no bueno
f
maybe remove the
!
from the glob?
otherwise that is saying do not ignore this glob
versus do ignore this glob
b
That's exactly what I want, though. to have Pants not ignore it
See my
BUILD.pants
where I'm using the `.gitignore`d files
w
because of how git globs work, you cannot re-include something below something that is ignored
b
ruh roh
w
Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined.
https://git-scm.com/docs/gitignore …ditto pants
b
hooray for consistency at least 😅
Hmm so I changed my
.gitignore
to:
Copy code
/deps/libs/thing/versions/active
/deps/libs/thing/versions/thing.*
Then using the pants.toml:
Copy code
"!/deps/libs/thing/versions/active",
Still produces warning 😕
Oh interesting
active
is a symlink. I think that's why it isnt matching
w
it should still… is the dest ignored?
b
Currently yeah. Let me fiddle
👍 1
What a mess our build is 🥴
Yeah, ok making my
.gitignore
really nasty allows me to not gitignore it