gorgeous-winter-9929610/31/2022, 9:40 PM
from a dep+name of entrypoint in the dep, but it doesn't seem like I can run a
. Context: Want to https://github.com/kubernetes-sigs/controller-tools to generate code.
hundreds-father-40410/31/2022, 9:42 PM
target. But that requires that you have a
target with the package name set to
, so you would essentially have first-party code that invokes the third-party code. Would that work?
gorgeous-winter-9929610/31/2022, 9:45 PM
package it doesn't really export anything meaningful I can use.
hundreds-father-40410/31/2022, 9:46 PM
to point to a
gorgeous-winter-9929610/31/2022, 9:47 PM
hundreds-father-40410/31/2022, 9:47 PM
gorgeous-winter-9929610/31/2022, 9:48 PM
hundreds-father-40410/31/2022, 9:50 PM
is only a target you define in your BUILD file. It doesn't require you to have any specific code present. It only needs the
field to point to a valid
, which we default to the same directory of the BUILD file
I'm suggesting that we loosen the
field to either point to a
. So, you woulndn't need to auto-generate anything 🙂 Only add the 1-3 line target to your BUILD file
gorgeous-winter-9929610/31/2022, 9:51 PM
hundreds-father-40410/31/2022, 9:53 PM
, and then you set this:
gorgeous-winter-9929610/31/2022, 9:55 PM
is to make it a
cannot be a dependency elsewhere.
. So why not skip/automate the boilerplate?
hundreds-father-40410/31/2022, 9:58 PM
and it's expected to always be generated by
So, automating this would look like allowing you to directly run/package any
, rather that manually defining some target. We could do that, but then we miss important fields like
, and people may try running packages that don't make sense
pointing to a
? Boilerplate, or something else too?
gorgeous-winter-9929610/31/2022, 10:00 PM
and also output a
. I don't think all packages should be runnable; only those that are named
hundreds-father-40410/31/2022, 10:03 PM
target for you? Yeah we could theoretically do that, but it results in some weirdness like
a) what is the address for it, given that the package name is already claimed
b) if you want to set
etc, then you now need to use
, which is a little awkward/less discoverable
Either way though, the first step we'd need to do is improving
to work with
. That's still a possible future improvement to auto-generate that
gorgeous-winter-9929610/31/2022, 10:06 PM
solves that since it cannot be passed elsewhere that expects a package - the current way of writing it opens up for writing incorrect dependencies.)
2. Sure. Or manually write a go_binary rule from scratch.
hundreds-father-40410/31/2022, 10:08 PM
Or manually write a go_binary rule from scratch.Yeah. Although at that point, I'd bias towards "keep it simple" and "keep it explicit", and have users write the 1-2 lines in a BUILD file. We try (but often fail) to avoid complex edge cases of "do this most the time! but if that fails, do this whole other thing"
gorgeous-winter-9929610/31/2022, 10:10 PM
hundreds-father-40410/31/2022, 10:11 PM
gorgeous-winter-9929610/31/2022, 10:12 PM