Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update makefile update-proto #1497

Merged

Conversation

mgjm
Copy link
Contributor

@mgjm mgjm commented Jul 11, 2023

What type of PR is this?

/kind other

What this PR does / why we need it:

This updates the update-proto rule in the Makefile to be more robust und work with go version 1.20.

  • 880e0b7 creates an intermediate file in internal/proto/conmon.capnp with the required changes for go

    • Bug: If the capnp compile step failed the applied changes didn't get reverted, when tried again the patch was applied twice
    • Bug: The git checkout at the end did remove my uncommitted changes 馃槩
    • The new version no longer overwrites the existing file
    • The intermediate file gets removed by make automatically, even on error
  • 17780b4 updates the make rule to be compatible with go version 1.20

    • go install no longer places source code in $GOPATH/src
    • The change uses the new $GOMODCACHE = $GOPATH/pkg/mod used by go install in module mode
    • And it uses the same go capnp version as specified in the go.mod file (instead of latest)

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Verify that this change also works with older go versions (depending on the minimum required go version). I could not figure out in wich version go switched to the GOMODCACHE directory for go install.

And check that the grep rule works. Tested on Alpine and Arch Linux.

Does this PR introduce a user-facing change?

None

mgjm added 2 commits July 11, 2023 06:24
Signed-off-by: Martin Michaelis <code@mgjm.de>
Signed-off-by: Martin Michaelis <code@mgjm.de>
s := capnp.Send{
Method: capnp.Method{
InterfaceID: 0xb737e899dd6633f1,
MethodID: 0,
InterfaceName: "conmon-rs/common/proto/conmon.capnp:Conmon",
InterfaceName: "internal/proto/conmon.capnp:Conmon",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the location of the capnp file changed the generated InterfaceName changed as well. But this is only used in debug messages, as far a I know.

Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 11, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mgjm, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@saschagrunert
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jul 11, 2023
@openshift-merge-robot openshift-merge-robot merged commit f132a00 into containers:main Jul 11, 2023
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants