-
Notifications
You must be signed in to change notification settings - Fork 3k
Makefile: add target to generate bindings #8956
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
Conversation
|
@baude @vrothberg @nalind PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the build tests are failing because generate now has a dependency on goimports being in $PATH now? If a user doesn't have goimports in their path, the imports will not be correctly done.
I also would prefer it if we kept the generated time in the generated files.
Also, generating the bindings touches go.mod and go.sum and throws a bunch of inconsistent vendoring errors at me. Not entirely sure what's going on, but that might be my fault.
The files are correctly generated though, so that's good
2ab2fcb to
c1e1faa
Compare
886cfb1 to
925b0ac
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
5e9827b to
0277ddb
Compare
pkg/bindings/generator/generator.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gofmt is not available in path on a lot of ci/cd images, go fmt seems to work, so I switched to it.
go fmt [-n] [-x] [packages]
Fmt runs the command 'gofmt -l -w' on the packages named
by the import paths. It prints the names of the files that are modified.
For more about gofmt, see 'go doc cmd/gofmt'.
For more about specifying packages, see 'go help packages'.
The -n flag prints commands that would be executed.
The -x flag prints commands as they are executed.
The -mod flag's value sets which module download mode
to use: readonly or vendor. See 'go help modules' for more.
To run gofmt with specific options, run gofmt itself.
See also: go fix, go vet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this will cause us to have to update the bindings every time you run create bindings even if the bindings did not change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go generate does this not, me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is likely your problem. looking into why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, this gets removed when you go generate, I tried to hard code this back in, but it caused other tools to break.
Strange that I can not get this same error to happen with podman-remote ps --last 1.
Add a `.generate-bindings` make target that only runs in the absence of the `.generate-bindings` file or when a `types.go` file below `pkg/bindings` has changed. This will regenerate the go bindings and make sure the code is up2date. Signed-off-by: Valentin Rothberg <[email protected]> Signed-off-by: Daniel J Walsh <[email protected]>
ashley-cui
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM assuming tests pass!
vrothberg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks a lot @rhatdan !
|
/lgtm hold |
|
LGTM |
Add a
.generate-bindingsmake target that only runs in the absence ofthe
.generate-bindingsfile or when atypes.gofile belowpkg/bindingshas changed.It does not execute anything yet is just a template to wire in the
generation in a future change.
Signed-off-by: Valentin Rothberg [email protected]
Signed-off-by: Daniel J Walsh [email protected]