https://pantsbuild.org/ logo
b

bitter-ability-32190

04/20/2022, 4:02 PM
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

fast-nail-55400

04/20/2022, 4:04 PM
maybe remove the
!
from the glob?
otherwise that is saying do not ignore this glob
versus do ignore this glob
b

bitter-ability-32190

04/20/2022, 4:04 PM
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

witty-crayon-22786

04/20/2022, 4:10 PM
because of how git globs work, you cannot re-include something below something that is ignored
b

bitter-ability-32190

04/20/2022, 4:10 PM
ruh roh
w

witty-crayon-22786

04/20/2022, 4:11 PM
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

bitter-ability-32190

04/20/2022, 4:11 PM
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

witty-crayon-22786

04/20/2022, 4:19 PM
it should still… is the dest ignored?
b

bitter-ability-32190

04/20/2022, 4:19 PM
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
4 Views