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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated: go & Dockerfile #9

Merged
merged 4 commits into from
Oct 1, 2021
Merged

Updated: go & Dockerfile #9

merged 4 commits into from
Oct 1, 2021

Conversation

GoliathLabs
Copy link
Member

I have updated the go-module to the latest version and set the dockerfile to golang 1.17.1. We should now be up-to-date again

@DasSkelett
Copy link
Member

$ go1.17.1 mod tidy
go: errors parsing go.mod:
/home/kilian/git/wg-access-server/go.mod:3: invalid go version '1.17.1': must match format 1.23

The go directive in go.mod is only specified to the MINOR.

After changing it to go 1.17 and running go mod tidy, there are a bunch of changes to go.mod and go.sum.
Do you have a go installation locally? Then you could commit them yourself, otherwise I can open a PR to your branch.

@GoliathLabs
Copy link
Member Author

Thank you :)

@DasSkelett
Copy link
Member

Hm, for some reason I'm getting the following when trying to build the Dockerfile locally:

 => ERROR [server 12/17] RUN ./codegen.sh                                                                                      19.5s 
------                                                                                                                               
 > [server 12/17] RUN ./codegen.sh:                                                                                                  
#22 6.887 protoc-gen-go: unable to determine Go import path for "devices.proto"
#22 6.887 
#22 6.887 Please specify either:
#22 6.887       • a "go_package" option in the .proto source file, or
#22 6.887       • a "M" argument on the command line.
#22 6.887 
#22 6.887 See https://developers.google.com/protocol-buffers/docs/reference/go-generated#package for more information.
#22 6.887 
#22 6.889 --go_out: protoc-gen-go: Plugin failed with status code 1.
------
executor failed running [/bin/sh -c ./codegen.sh]: exit code: 1

Let me try to figure out whether this is caused by the Go version update and how we can fix it

@DasSkelett
Copy link
Member

Okay, it's the update of github.com/golang/protobuf/protoc-gen-go, reverting it back to v1.3.5 fixes it.
If I have to take a guess, it's the 1.4.0 update, which looks like it had a bunch of breaking changes:
https://github.com/golang/protobuf/releases/tag/v1.4.0

@DasSkelett
Copy link
Member

DasSkelett commented Oct 1, 2021

This was a bit of a fight (code generation is exhausting), but I think I got everything working and tidy.

After downloading all the protobuf packages on my PC and adding

option go_package = "github.com/place1/wg-access-server/proto/proto";

to proto/devices.proto and proto/server.proto, the generated files were put into the wrong directory (proto/proto/github.com/place1/wg-access-server/proto/proto/).

This comment had the solution, I needed to add --go_opt=paths=source_relative to the args in codegen.sh.

The diff of the *.proto.pb files is bigger than I had hoped for, but everything appears to work, both inside and outside of the Docker container. There's a chance this script hasn't been run in an eternity, with very outdated protobuf compilers.

Copy link
Member

@DasSkelett DasSkelett left a comment

Choose a reason for hiding this comment

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

🤞

@DasSkelett DasSkelett merged commit a84a3ad into freifunkMUC:master Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants