quaint-telephone-89068
01/15/2023, 3:50 PMResolveError: Directory ":" does not contain any BUILD files.
This was because their BUILD file contained:
python_library(
dependencies = [
"//:pytz",
"//:python-dateutil",
"//:requests",
"//::PyYAML",
"ns/core",
"ns/config",
"ns/bar",
]
)
where //::PyYAML was a typo. I believe in this case, the ResolveError didn't even show the directory where the address was erroring in, which would make this very difficult to diagnose in a larger repo.
I think that when we parse BUILD files, we should be able to validate dependency addresses against the regex:
(//)?([^:]+(:[^/:]+)?|:[^/:]+)
and if it fails, spit out an error message either with just that regex, or with a nicer subroutine that detects which part of the address was invalid, along with the path to the specific BUILD file with the error.
pantsbuild/pantsuser
01/15/2023, 3:50 PM