<@UB2J9BQA0>, <@U051221NF>: re: file-level deps
# development
w
@hundreds-father-404, @happy-kitchen-89482: re: file-level deps
@happy-kitchen-89482: when you and i talked on Wednesday we discussed ignoring the problem of roots for now, and only focusing on inner nodes… did you end up having that conversation with @hundreds-father-404 as well?
h
Yes, Eric and I discussed what the easiest path to getting something working would be here, including that.
h
On thursday, we discussed that the spiritual equivalent of what we want is that you have an explicit target for every single BUILD file. This feature is that you can get that via Pants inferring the target, rather than having to do it explicitly The end effect is the same: one target per one file
Again, as we were DMing, this is not “file level deps”. This is “implicit targets that happen to have file-level precision”
w
the difference between the two of those though, is that one theoretically needs to support “roots” of the graph, while the other doesn’t
only doing “inner nodes” means you don’t need to figure out the types of inner nodes… if i depend on you, you’re a library.
whereas if i run
./pants test ::
, “which things are tests?” is a harder question that can be deferred.
hence the focus on file-level deps, to support inner nodes.
(with the caveat that there was one open question after Benjy and my conversation though, which was
lint
needing “roots” as well, and needing type information.)
h
@hundreds-father-404 I think we discussed this, re at least at first requiring, say, binary/test targets to be explicit (we can then easily get rid of that requirement for test targets, at least, since we detect those by name).
h
What’s the point of that? The purpose of this project is to faciliate onboarding a new project. If you still need all your roots to be explicitly declared, I’m missing the benefit NB that
./pants fmt ::
would not work like Benjy wants because it never uses Dependencies. It purely considers the roots
I think we discussed this, re at least at first requiring, say, binary/test targets to be explicit
Stu is talking about something else, I think. Where do we do this inference? Only within
resolve_dependencies
rule (the inner nodes), or before Pants runs on anything when we calculate the universe of targets? You and I discussed on Thursday the latter
w
@hundreds-father-404: same thing
test/binary here are roots
1
but yea, lint and fmt are still a problem as you and i mentioned.
h
they’re roots for the goals
run
,
binary
, and
test
, but not for
repl
,
fmt
,
lint
,
setup-py
,
filedeps
,
list
, etc
w
@hundreds-father-404: i’m just saying that benjy and i are talking about the same thing re: https://pantsbuild.slack.com/archives/C0D7TNJHL/p1594074154476000?thread_ts=1594073804.474100&amp;cid=C0D7TNJHL
h
not only does
./pants lint ::
need to work in a repo with zero BUILD files, but so does
./pants repl ::
and
./pants dependencies helloworld/app.py
h
I think @hundreds-father-404 is pointing out that the term "roots" is misleading in this discussion, since library targets can be roots in some cases
👍 1
h
it’s not adequate to special case
fmt
and
lint
afaict
h
In many cases in fact
h
would it be more effective to VC?
h
So I think this boils down to - "all inferred targets are library targets" for now
w
right, which is important.
@hundreds-father-404: that or create a design doc, yea.
h
Can hop on a quick call
👍 1