-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V2 remove go generate
from the build process
#1802
base: v2-maint
Are you sure you want to change the base?
Conversation
@meatballhat Can you review as this is more in your area ? |
@abitrolly sorry for my big delay! I had thought that using the built-in Go tooling for this generation hook was preferable 🤔 Can you help me understand why you think this approach is better? |
@meatballhat |
I would prefer to get rid of the Makefile towards a build that uses only |
@dolmen what is the point in |
Just call the flag builder directly
71f41d1
to
89d7e63
Compare
Resolved conflict and rebased. It would be nice to change |
The principle with "go generate" is that it is run by the developer and its result is committed in the repo so when you run "go build" on any platform you don't need to run "go generate" again. |
I haven't found this principle in |
From Rob Pike himself on the Go blog (emphasis mine):
I understand that you want the code generation to be simplified, but I disagree with the choice of switching to make instead of using just the Go toolchain. I'll propose something else. But I'm concerned with the dual maintenance of v2 and v3. |
@dolmen I could agree with the argument if it was |
I'm still feeling ➕ 0️⃣ on this one @abitrolly 🤷🏼 It's true that we have a Makefile, but it's pretty slim, and I want to make sure the project doesn't slip into requiring |
I'm personally against having a makefile in a go project, except if it's really necessary. |
@julian7 would you be able to come up with PR to remove Makefile? |
@meatballhat it is not about graph LR
make --> build.go --> gogen[go generate] --> cli.go --> urfave-cli-genflags/make --> urfave-cli-genflags --> goimports
|
@abitrolly I think I understand the intent of the original design i.e to use go tooling as much as possible. I would suggest to drop this PR. We should document the build process somewhere though |
@dearchap I wouldn't mind pure Go code, but this Go code calls Make, which calls Go program through shell. If there is a way to use Go program directly, maybe as a library, that would make it use Go. |
What type of PR is this?
What this PR does / why we need it:
Simplifies build process.
Which issue(s) this PR fixes:
Fixes #1801
Testing
Run
make
. Remove generated files. Run again. See they are regenerated and identical.Release Notes
(REQUIRED)