Hm. I have no idea how with explicit deps in BUILD...
# development
h
Hm. I have no idea how with explicit deps in BUILD files we plan to distinguish between what is a target address vs. a generated subtarget. If there’s a
:
, then we know it’s a target address. Otherwise, we don’t know how to distinguish between the address shorthand of leaving off
:foo
when the parent directory is
foo/
. It’s not reliable to look for a file extension, because not all files have it and dirs can have them. We can’t call
Path.is_file()
because that’s not engine safe, afacit.
With file args, we tried our best to solve this via several heuristics: 1. if
:
is there, it’s an address. 2. if there’s a file suffix, assume it’s a file. 3. Finally, call
Path.is_file()
w
3) continues to be a way to break this tie, i think
the Specs are parsed outside the engine right now, iirc. could move parsing in if you want that operation cached (and then use a Snapshot)
(but as long as it’s outside, it’s relatively safe to do)
h
Yes, but this needs to happen within the resolve dependencies rule
w
ah. yea, then the Snapshot equivalent of “is_file”, probably. makes it a bit more important to do this at the directory level, probably.
and more reason to follow up on the “list without Snapshotting” thing… it’s on my list.
h
Okay. For the sake of landing this, I’ll for now assume anything without an extension is a directory, meaning shorthand for address. This is a pretty particular edge case: you’re using explicit generated subtargets (rather than dep inference) on a file without an extension