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

feat(console-api): Update tonic to 0.7 #318

Merged
merged 3 commits into from Apr 8, 2022
Merged

feat(console-api): Update tonic to 0.7 #318

merged 3 commits into from Apr 8, 2022

Conversation

LucioFranco
Copy link
Member

@LucioFranco LucioFranco commented Apr 2, 2022

This change updates tonic and prost to their latest versions. In
addition this PR changes how the generated protobuf is built from being
done in a build.rs file to a tests/boostrap.rs test. This removes
the need for downstream consumers to compile/provide protoc for
prost to generate the protobuf files (which was changed in 0.10).

The bootstrap test will first attempt to compile the protobuf files and
check if there is a git diff between the checked in version. If there is
a difference it will fail the test waiting for the files to be checked
in. This will fail PRs that have updated the protobuf files but not
checked in the new versions.

BREAKING CHANGE:
console-api is now no longer compatible with projects using prost
0.9 or tonic 0.7. These crates must be updated to use console-api
0.2.

This change updates `tonic` and `prost` to their latest versions. In
addition this PR changes how the generated protobuf is built from being
done in a `build.rs` file to a `tests/boostrap.rs` test. This removes
the need for downstream consumers to compile/provide `protoc` for
`prost` to generate the protobuf files (which was changed in `0.10`).

The bootstrap test will first attempt to compile the protobuf files and
check if there is a git diff between the checked in version. If there is
a difference it will fail the test waiting for the files to be checked
in. This will fail PRs that have updated the protobuf files but not
checked in the new versions.
@LucioFranco LucioFranco changed the title console-api: Update tonic to 0.7 console-api: Update tonic to 0.7 Apr 2, 2022
@LucioFranco
Copy link
Member Author

I tried adding some code to download protoc to speed up CI but didn't realize that deps were cached so we only pay the cost on the first build. Going to back out my changes.

Comment on lines +28 to +30
# Make 1.58 MSRV due to <=1.57 failing to build console-api due to a bug
# with cargo version resolution.
minrust: 1.58.0
Copy link
Member Author

Choose a reason for hiding this comment

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

Would be good to find the bug here 🤷

@LucioFranco LucioFranco marked this pull request as ready for review April 4, 2022 18:43
@LucioFranco LucioFranco requested a review from a team as a code owner April 4, 2022 18:43
Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

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

I notice that the generated code is now checked in --- is this a recommended practice in Tonic 0.7-land?

@LucioFranco
Copy link
Member Author

So prost 0.10 requires at least a c compiler and to compile protobuf from source if protoc is not present. So for end users of the console-api checking in the code will avoid having to compile C code.

Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

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

this seems legit to me!

@hawkw hawkw changed the title console-api: Update tonic to 0.7 feat(console-api): Update tonic to 0.7 Apr 8, 2022
@hawkw hawkw merged commit 83d8a87 into main Apr 8, 2022
@hawkw hawkw deleted the lucio/update-tonic branch April 8, 2022 00:11
hawkw added a commit that referenced this pull request Apr 8, 2022
<a name=""></a>
## 0.2.0 (2022-04-08)

#### Breaking Changes

*  Update `tonic` to `0.7` (#318) ([83d8a87](83d8a87))

#### Features

*  Update `tonic` to `0.7` (#318) ([83d8a87](83d8a87))
hawkw added a commit that referenced this pull request Apr 11, 2022
<a name=""></a>
## 0.2.0 (2022-04-08)

#### Breaking Changes

*  Update `tonic` to `0.7` (#318) ([83d8a87](83d8a87))

#### Features

*  Update `tonic` to `0.7` (#318) ([83d8a87](83d8a87))
hawkw added a commit that referenced this pull request Apr 11, 2022
<a name="0.1.4"></a>
## 0.1.4  (2022-04-11)

#### Bug Fixes

*  fix memory leak from historical `PollOp`s (#311)
   ([9178ecf](9178ecf), closes [#256](256))

#### Features

* **console-api:**  Update `tonic` to `0.7` (#318) ([83d8a87](83d8a87))
*  don't trace tasks spawned through the console server (#314)
   ([0045e9b](0045e9b))
hawkw pushed a commit that referenced this pull request Apr 28, 2022
In #318, the CI version was changed to Rust 1.58+ and installation of
tokio-console 0.1.4 on Rust 1.56-1.57 fails on that version as noted in
`ci.yaml` changes in commit 83d8a87.
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