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

curved-television-6568

05/23/2022, 9:21 AM
In order to solve https://github.com/pantsbuild/pants/issues/15585 I’d like to optionally resolve
UnparsedAddressInputs
. This has come up a few times before as well, where it would be desirable to not throw a
ResolveError
for invalid/unknown addresses (as they may be something else, too) 🧵
I don’t think it is very difficult to solve, but are there any concerns you have how we go about this?
I’m considering adding a new bool field to
UnparsedAddressInputs
that you can flip in order to get back `Address`es for all your inputs, but where addresses are gifted with a
is_valid
boolean property that you can examine to see if it was indeed resolved properly or not.
f

fast-nail-55400

05/23/2022, 1:42 PM
I wrote some hacky code to optionally parse strings as addresses when dealing with Maven coordinates. It just catches any exceptions. See https://github.com/pantsbuild/pants/blob/9762509ed08c48e72af81bf0698e4667681acac5/src/python/pants/jvm/resolve/jvm_tool.py#L112-L116
c

curved-television-6568

05/23/2022, 2:08 PM
Yeah, thats almost good, however in this case, the string may be formatted as a valid address (and I want it resolved if it indeed is an address too) into a
Address
So I could catch the engine
ExecutionError
I guess, but then it doesn’t interact well when I have a list of such addresses, some of which may throw..
Huh… so, looking at @hundreds-father-404’s Spec changes to implement ignores, I realise that maybe treating unparsed addresses as specs would actually work in this case, as there’s already implemented support for “unmatched glob behaviour” which I think will do what I want when set to “ignore”.
💯 1
h

hundreds-father-404

05/24/2022, 12:13 PM
Oh cool! Yeah, there is 🙂
🙌 1