high-energy-55500
05/24/2022, 10:11 AM[WARN] Unmatched globs from //:git-files's `sources` field: [".git/HEAD", ".git/refs/heads/**/*"]
i have a few files
targets that I don’t care if they’re missing or not, so I don’t mind hiding the warning for them. I’d probably even say that I usually don’t care about missing files
targets as opposed to missing resources
targets.curved-television-6568
05/24/2022, 10:17 AMcurved-television-6568
05/24/2022, 10:17 AMhigh-energy-55500
05/24/2022, 10:29 AMbitter-ability-32190
05/24/2022, 10:32 AMbitter-ability-32190
05/24/2022, 10:33 AMhundreds-father-404
05/24/2022, 12:10 PMignore
option because it was a really common gotcha people were making to have bad sources=
and people were getting confused. We didn't think ignore
was safe
But maybe we should add it...? It's super trivial to add, only a question of judgmentcurved-television-6568
05/24/2022, 12:11 PMignore
may be bad practice, at least, but perhaps a way to indicate per source field, that the globs are required/optional ?hundreds-father-404
05/24/2022, 12:15 PMcurved-television-6568
05/24/2022, 12:15 PMi have a fewtargets that I don’t care if they’re missing or notfiles
bitter-ability-32190
05/24/2022, 12:24 PMhundreds-father-404
05/24/2022, 12:31 PMbitter-ability-32190
05/24/2022, 12:44 PMhundreds-father-404
05/24/2022, 12:50 PMsources
ever be empty? The assets either exist or they don't, right?hundreds-father-404
05/24/2022, 12:51 PM.git
by default, so it won't see .git/HEAD
See https://www.pantsbuild.org/docs/troubleshooting#pants-cannot-find-a-file-in-your-projectbitter-ability-32190
05/24/2022, 1:03 PMBut then why would theThey are gitignoredever be empty? The assets either exist or they don't, right?sources
hundreds-father-404
05/24/2022, 1:14 PM.git/info/excludes
? If they're gitignored, that sounds like the same case as Martim and I would expect that to be a bugbitter-ability-32190
05/24/2022, 1:14 PMhundreds-father-404
05/24/2022, 1:16 PMFor people running the scripts that need the assets, they need the assetsPants doesn't think the assets exist
bitter-ability-32190
05/24/2022, 1:16 PMhundreds-father-404
05/24/2022, 1:24 PMpants_ignore
so that Pants can find the files. https://www.pantsbuild.org/docs/troubleshooting#pants-cannot-find-a-file-in-your-project
The annoying warning is legit, it's helping you out here. Ignoring it would mask a real issuebitter-ability-32190
05/24/2022, 1:26 PMhigh-energy-55500
05/24/2022, 5:38 PM.git
files to our pants.toml
file 😄
pants_ignore.add = [
"!.git/",
".git/FETCH_HEAD",
".git/index*",
".git/logs/**/*",
".git/objects/**/*",
".git/refs/remotes/**/*",
".git/refs/tags/**/*",
]
so we have 2 use cases: for git-files
, these files are often not available in non-local environments, but that’s typically not a problem since they’re not needed in that scenario and we have a fallback for those situations.
another use case is when we use pants to create an asset that is later used by another pants command. we don’t care about these files not existing because they will be created when we’re running that command, but we still need pants to be able to see the fileshundreds-father-404
05/24/2022, 6:01 PMpants_ignore
. Hmhigh-energy-55500
05/24/2022, 8:17 PM