https://pantsbuild.org/ logo
p

proud-dentist-22844

04/14/2023, 11:09 PM
I'm about to write an
nfpm
plugin (wrapping https://nfpm.goreleaser.com/) that provides an
nfpm_package
target and can generate deb, rpm, and apk packages. I want to get it into 2.17 as an experimental backend. Do we have any tool backends that download static binaries (in this case written in go)? So far, I've only written plugins around python tools.
w

wide-midnight-78598

04/14/2023, 11:27 PM
ExternalTool
or
TemplatedExternalTool
- I think there are some other options, but this is what I typically use
p

proud-dentist-22844

04/14/2023, 11:46 PM
TemplatedExternalTool is just what I needed. Thanks.
Oh. It's on
Subsystem
But you don't register those rules anywhere.
w

wide-midnight-78598

04/15/2023, 12:44 AM
Generally, subsystem rules are registered when they’re used in an @rule method. I like to manually register them, as it just feels more correct. However, there is the chance that I forgot to place that subsystem.rules() in the register.py, as I copied the register file from elsewhere
👍 1
https://www.pantsbuild.org/docs/rules-api-subsystems#defining-options Item 3 mentions it. Was one of my earliest confusions. Personally, with stuff like registration, I think we’d be better served to remove the magic. Implicit rule registration seems to be a big hiccup (as you well know), when we get into testing plugins, where we then have to specify explicitly. If I had my would rathers, I would enforce rule registration for plugins - declare what you use. That way, the tests should only need to grab your plugins ruleset and call it a day
p

proud-dentist-22844

04/15/2023, 12:49 AM
Yeah. That would be a great change. Figuring out graph errors (which rules were not registered) is so painful.
w

wide-midnight-78598

04/15/2023, 12:56 AM
Unfortunately, I think it’s a bit of a maze right now - with all the various rules in operation