jolly-midnight-7275911/06/2020, 9:02 PM
object. Are the following statements true? * The part to the left of the colon is always a path to a file relative from the top of the repo. * The part to the right is the name of the target that has the file as a source. * If no target is listed, then nothing owns that file. * When a file has no owner, then
goals using targets will not be able to act on that file.
hundreds-father-40411/06/2020, 9:09 PM
, i.e. the path to the directory with the BUILD file. 2. it’s the
field from the BUILD file. If you leave off
, then it defaults to the directory name 3. That’s correct 4. That’s correct. Some goals like
don’t need targets, but most do.
how are two targets with the same name in different projects differentiated?An address ==
(left side of colon) +
(right side of colon) The
field is enforced to be unique in each directory, which ensures that each address is unique
jolly-midnight-7275911/06/2020, 9:19 PM
and they both source the same file,
, then that's when the
becomes important? Is this how the
objects look for this scenario? *
hundreds-father-40411/06/2020, 9:19 PM
jolly-midnight-7275911/06/2020, 9:20 PM
hundreds-father-40411/06/2020, 9:22 PM
, right? This would imply that you have a BUILD file at
and one at
. Both BUILD files have targets with
. Does that sound right?
jolly-midnight-7275911/06/2020, 9:23 PM
hundreds-father-40411/06/2020, 9:24 PM
field for both of those targets? It sounds like the one in
is using recursive globs like
jolly-midnight-7275911/06/2020, 9:26 PM
seem to used to represent filesystem structure but are also used for namespace structure. Still trying to articulate the question I am curious to answer.
could be recursive or explicit.
hundreds-father-40411/06/2020, 9:30 PM
Does recursive or explicit declaration make a difference for Address()?The recursive part only changes the way it’s represented for a “file” address.
means you have a file named
. Its metadata is coming from the parent directory, in a target with
, specifically its metadata is coming from
jolly-midnight-7275911/06/2020, 9:30 PM
characters are illegal in target names?"
hundreds-father-40411/06/2020, 9:32 PM
jolly-midnight-7275911/06/2020, 9:35 PM
are combined to make the fully qualified target name. (
then replace the right most
PurePath(spec_path).parent + target
is a path separator too on HFS. LOL.)
hundreds-father-40411/06/2020, 9:39 PM
So spec_path and target are combined to make the fully qualified target name.Yes, that’s correct. And I guess I mispoke about what
means… For a traditional (aka “base”) address, which is all there was in v1: -
== path to the directory of BUILD file -
field of the target for a “file” address: -
== the literal file name -
== the original target’s name where the metadata is coming from, possibly including
if it’s in a parent directory Sorry, this is super confusing and imo the most confusing part of Pants. We spent a lot of time trying to figure this all out, and ended up going with it because making files the “atomic unit” of Pants was crucial to things like dep inference working well. But it’s still confusing, even if worth it
jolly-midnight-7275911/06/2020, 9:40 PM
files, these kinds of design decisions will need to be refactored.
witty-crayon-2278611/06/2020, 10:12 PM