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

deps: update protobuf #70

Merged
merged 1 commit into from Aug 16, 2022
Merged

deps: update protobuf #70

merged 1 commit into from Aug 16, 2022

Conversation

benma
Copy link
Contributor

@benma benma commented Aug 15, 2022

The module we used previouly, github.com/golang/protobuf/proto, is
deprecated. See https://github.com/golang/protobuf/releases/tag/v1.5.2
and golang/protobuf#1306.

We use the official succssor:

(fix imports)
go get google.golang.org/protobuf/proto@v1.28.1
go mod tidy

The .pb.go generated files also needed to be updated with an updated
protoc-gen-go:

go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1

A new script was added to generate the files, as the
import_path=messages flag seems to be removed in favour of the M
flag, which unfortunately has to be specified for each .proto file :(

@benma benma force-pushed the protobuf branch 2 times, most recently from c42bf9e to ef8efcd Compare August 15, 2022 09:47
@benma benma requested a review from Beerosagos August 15, 2022 09:51
README.md Outdated
Make sure you have `protoc` and
[protoc-gen-go](https://developers.google.com/protocol-buffers/docs/reference/go-generated)
installed:

`git clone https://github.com/digitalbitbox/bitbox02-firmware.git`

```sh
rm -rf api/firmware/messages/*
Copy link
Collaborator

Choose a reason for hiding this comment

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

This removes also generate.sh. I would suggest to use rm -rf api/firmware/messages/*.proto and rm -rf api/firmware/messages/*.go or to move generate.sh in another folder

Copy link
Contributor Author

Choose a reason for hiding this comment

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

great catch! fixed

The module we used previouly, github.com/golang/protobuf/proto, is
deprecated. See https://github.com/golang/protobuf/releases/tag/v1.5.2
and golang/protobuf#1306.

We use the official succssor:

```
(fix imports)
go get google.golang.org/protobuf/proto@v1.28.1
go mod tidy
```

The .pb.go generated files also needed to be updated with an updated
protoc-gen-go:

```
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1
```

A new script was added to generate the files, as the
`import_path=messages` flag seems to be removed in favour of the `M`
flag, which unfortunately has to be specified for each .proto file :(

-----------

In `BTCSign()`, the inputs are not copied anymore due to:

```
api/firmware/btc.go:300:20: cannot use &input (value of type **messages.BTCSignInputRequest) as *messages.BTCSignInputRequest value in struct literal (typecheck)
					BtcSignInput: &input,
```
Copy link
Collaborator

@Beerosagos Beerosagos left a comment

Choose a reason for hiding this comment

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

tACK!

@benma benma merged commit 4968e9a into digitalbitbox:master Aug 16, 2022
@benma benma deleted the protobuf branch August 16, 2022 11:52
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.

None yet

2 participants