-
Notifications
You must be signed in to change notification settings - Fork 373
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
update protoc and related #552
update protoc and related #552
Conversation
cc @jdef |
d5566d2
to
2862f99
Compare
@saad-ali Fixed GitHub action. It seems we are not running Lines 46 to 48 in 80d5310
This rule is not running because the timestamp of csi.proto is not updated.
It seems to me that we should remove all the |
Can you make sure you've signed the CLA. See https://github.com/container-storage-interface/spec/blob/master/CONTRIBUTING.md#licence-and-cla |
@saad-ali I just sent the CCLA. Please check. |
Confirmed, CCLA received. Thank you @huww98! |
cc @bswartz |
are we sure there are no breaking API changes here? e.g. the APIs exposed from the generated bindings seem to have changed considerably. i realize that there were no changes to the CSI API specification, but I wonder about potential breakage for folks relying on anything generated by the old compilers that may have changed. not that we want to block this PR because of that - but the potential for downstream breakage should probably be noted somewhere. also, has anyone attempted to run these newly generated bindings against some sort of CO-maintained test suite? "CSI sanity" (or similar) comes to mind. or, at least, tried to recompile CO/CSI integration layers in conjunction w/ the changes herein? |
The only breaking I'm aware of is this:
I will try this change on existing CSI driver and Kubernetes, and report back soon. |
@jdef See here for how I get csi-driver-host-path to work with this change. I tested this with csi-sanity. Both from master branch and recompiled with this change (I made some changes to the mock driver used in testing to compile it). The result is:
|
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.
It looks like there are a lot of different changes some fixing issues, some refactoring.
Would you be willing to break the changes in to smaller (more targeted) PRs? Or would you be willing to attend one of the monthly CSI community meetings to walk us through the changes?
lib/go/Makefile
Outdated
@@ -21,7 +21,7 @@ export GOPATH | |||
|
|||
# Only set PROTOC_VER if it has an empty value. | |||
ifeq (,$(strip $(PROTOC_VER))) | |||
PROTOC_VER := 3.9.1 | |||
PROTOC_VER := 24.3 |
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.
Per @bswartz where does this version number come from?
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 just the latest version from https://github.com/protocolbuffers/protobuf/releases when I open this PR. I will update it again.
It is hard. The old version does not support my arm64 MacBook. I have to upgrade the version first then tweak the Makefile to make it compile.
OK if that is necessary. |
I've reviewed the meeting record yesterday. About the GitHub action, I've fixed it in this PRs. Please see https://github.com/huww98/csi-spec/actions/runs/7736057831/job/21092762877 . In the action, It downloads all dependencies, run protoc, then compile the generated go file to make sure it compiles at least. Plus I have tried to integrate it into csi-driver-host-path and csi-sanity manually. I think this change should be safe enough. |
Will look again, was looking at each commit and didn't make it through all 3
…On Tue, Feb 6, 2024, 11:22 PM 胡玮文 ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In go.mod
<#552 (comment)>
:
> @@ -5,12 +5,12 @@ go 1.18
require (
github.com/golang/protobuf v1.5.3
this is already fixed in the 3rd commit of this PR, please check.
—
Reply to this email directly, view it on GitHub
<#552 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAR5KLGNW4GG6Z7QFN3ICK3YSL6OVAVCNFSM6AAAAAA5OHSWCWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQNRWHA3TSNJRHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
c800de2
to
b43fb50
Compare
@huww98 came to the CSI meeting and walked us through the changes. @huww98 has one more commit that may need to be added to this. |
b43fb50
to
f69defd
Compare
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 doesn't work on my system. The command "go env GOBIN" returns the empty string, and therefore I later get this error:
.protoc/bin/protoc -I../.. --go-grpc_out=csi --go_out=csi
--go_opt=paths=source_relative --go-grpc_opt=paths=source_relative
"csi.proto"
protoc-gen-go-grpc: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--go-grpc_out: protoc-gen-go-grpc: Plugin failed with status code 1.
make[1]: *** [Makefile:83: csi/csi.pb.go] Error 1
make[1]: Leaving directory '~/src/spec/lib/go'
make: *** [Makefile:20: lib/go/csi/csi_grpc.pb.go] Error 2
updated protoc to v25.2 updated protoc-gen-go to v1.32.0 added protoc-gen-go-grpc at v1.3.0 Modified the makefile to use "go install" to install tools. Use extended regular expressions in "sed" command. Fixes build on arm OSX host
f69defd
to
4421b74
Compare
Always run "make build_go" on github actions Always update the timesptamp of spec.md/csi.proto to make sure lib/go is built on CI
- use git to check for out-of-date generated files, avoids all the temp files and manual diff in the Makefile. - not specify version for protoc-gen-go, it will use the version from go.mod - do not copy over the protoc binary. Call it directly from unzipped path. So it can find the includes automatically, and we don't need the -I or --go_opts=Mxxx flags. - use paths=source_relative to generate go files directly into destination, avoid the copy. - simplify the sed command used to extract "csi.proto" file.
4421b74
to
266ee1a
Compare
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
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.
.
Modeled after: container-storage-interface/spec#552 Update to the latest, non-deprecated versions of Google's tools for protobuf generation. Also update make tools to allow working with go modules outside of GOPATH, and to build on ARM-based Macbooks. New tools are significantly different from prior tools. Notably, the grpc plugin is no longer supported, so the `--go-gprc_out` flag is used, which moves some generated content from `cosi.pb.go` to a new `cosi_grpc.pb.go` file. We are still able to keep fake-gen by continuing to use deprecated tool versions for that purpose. There's a chance that it may not serve the COSI project long-term, but it should still work for now. Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
Modeled after: container-storage-interface/spec#552 Update to the latest, non-deprecated versions of Google's tools for protobuf generation. Also update make tools to allow working with go modules outside of GOPATH, and to build on ARM-based Macbooks. New tools are significantly different from prior tools. Notably, the grpc plugin is no longer supported, so the `--go-gprc_out` flag is used, which moves some generated content from `cosi.pb.go` to a new `cosi_grpc.pb.go` file. We are still able to keep fake-gen by continuing to use deprecated tool versions for that purpose. There's a chance that it may not serve the COSI project long-term, but it should still work for now. Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
Modeled after: container-storage-interface/spec#552 Update to the latest, non-deprecated versions of Google's tools for protobuf generation. Also update make tools to allow working with go modules outside of GOPATH, and to build on ARM-based Macbooks. New tools are significantly different from prior tools. Notably, the grpc plugin is no longer supported, so the `--go-gprc_out` flag is used, which moves some generated content from `cosi.pb.go` to a new `cosi_grpc.pb.go` file. We are still able to keep fake-gen by continuing to use deprecated tool versions for that purpose. There's a chance that it may not serve the COSI project long-term, but it should still work for now. Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
Modeled after: container-storage-interface/spec#552 Update to the latest, non-deprecated versions of Google's tools for protobuf generation. Also update make tools to allow working with go modules outside of GOPATH, and to build on ARM-based Macbooks. New tools are significantly different from prior tools. Notably, the grpc plugin is no longer supported, so the `--go-gprc_out` flag is used, which moves some generated content from `cosi.pb.go` to a new `cosi_grpc.pb.go` file. We are still able to keep fake-gen by continuing to use deprecated tool versions for that purpose. There's a chance that it may not serve the COSI project long-term, but it should still work for now. Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
updated protoc to v25.2
updated protoc-gen-go to v1.32.0
added protoc-gen-go-grpc at v1.3.0
Modified the Makefile to use "go install" to install tools.
Use extended regular expressions in "sed" command.
Which issue(s) this PR fixes:
Fixes build on arm MacOS host
Maybe Fixing #471, not tested
Special notes for your reviewer:
Does this PR introduce an API-breaking change?: