cli
cli copied to clipboard
Remove `go generate` from v2 build process
My urfave/cli version is
v2
Checklist
- [x] Are you running the latest v2 release? The list of releases is here.
- [x] Did you check the manual for your release? The v2 manual is here
- [ ] Did you perform a search about this problem? Here's the GitHub guide about searching.
Dependency Management
- My project is using go modules.
- My project is using vendoring.
- My project is automatically downloading the latest version.
- I am unsure of what my dependency management setup is.
Describe the bug
The generation step when calling make
from https://cli.urfave.org/CONTRIBUTING/#development-workflow takes way too much detours.
Observed behavior
graph LR
make --> build.go --> gogen[go generate] --> cli.go --> urfave-cli-genflags/make --> urfave-cli-genflags --> goimports
Expected behavior
At least this.
graph LR
make --> build.go --> urfave-cli-genflags/make --> urfave-cli-genflags --> goimports
Additional context
- There are no other usage of
go generate
except callingmake
fromurfave-cli-genflags
-
go generate
is not called duringgo build
process, so there is no implicit automation here
Did I miss anything?
Want to fix this yourself?
Yup. If there is no some hidden magic behind.
@abitrolly Do you really want to optimize this since we are moving forward with v3 ? Does the analysis apply to v3 ?
@dearchap yes. That will make v2
maintenance easier. In case somebody needs to build it with modifications for debug.
v3 doesn't seem the be affected.
Instead the build process should depend on go generate
and not on make
because that's the idiomatic way. See discussion in #1802 for opinions.
@dolmen "if all you have is a hammer, everything looks like a nail".
I need a reference that calling make
from Go code is the idiomatic Go. As shown by https://github.com/urfave/cli/pull/1802#issuecomment-1953505678 it is make calling Go, then Go calling make
to call an app. Much more maintainable it to have make
call the app.