Skip to content

Commit

Permalink
build(deps): bump prost* to 0.9.0, tonic to 0.6.2, tonic-reflection t…
Browse files Browse the repository at this point in the history
…o 0.3.0 (#5755)

Note: This subsumes #5738, which just attempted to update prost-types to 0.8.0.

For Reviewers: The only file I modified by hand is Cargo.toml. Everything else is auto-generated from subsequent commands (`cargo update`, `cargo raze`, `bazel run //tensorboard/data/server:update_protos`)

#5738 attempted to update prost-types from 0.7.0 to 0.8.0. This did not work out-of-the-box for several reasons, the most important of which is that we could not successfully build and run the server with mixed versions of prost (0.7.0), prost-types (0.8.0), and prost-build (0.7.0).

This PR attempts to upgrade all three of prost, prost-types, and prost-build to the same version at the same time. We also upgrade tonic, tonic-reflection, and tonic-build so that they, too, depend on the same prost version and we don't have multiple prost crates of different versions.

* https://crates.io/crates/prost/0.9.0 
* https://crates.io/crates/prost-types/0.9.0 
* https://crates.io/crates/prost-build/0.9.0 
* https://crates.io/crates/tonic/0.6.2 
* https://crates.io/crates/tonic-build/0.6.2 
* https://crates.io/crates/tonic-reflection/0.3.0 

We choose to upgrade prost to 0.9.0 because, why not? We attempted to upgrade to 0.10.* (the latest version) but these versions of prost have a dependency on cmake, which seems to assume cmake is installed on your machine, which it typically is not within Google. There seems to be some work to further refine the dependency on cmake (tokio-rs/prost#620, tokio-rs/prost#657) so hopefully this gets resolved in a future release of prost and a future upgrade to, say, 0.11 will not have the cmake problems.

The upgrade was not straightforward for me, a rust and rustboard newb. Several other edits had to be made and commands had to be run to get it to work. This was the incantation that finally worked for me:
* Edit Cargo.toml to update versions of prost, prost-types, prost-build, tonic, tonic-reflection, tonic-build and to update any related raze metadata entries.
* Run `cargo update -p prost -p prost-types -p prost-build -p tonic -p tonic-reflection -p tonic-build`
* Inspect Cargo.lock and compare to raze metadata entries in Cargo.toml. If any of the versions changed (indexmap) then update the associated raze metadata entry. If any of the crates were removed (none were) then remove the associated raze metadata entry. Also, libc version didn't change but I updated its raze metadata anyway since its version seems to have changed in the past.
* Run `cargo raze`
* Run `bazel test //tensorboard/data/server:update_protos_test` (especially since this is updating proto-related libraries) and witness it FAIL and then run `bazel run //tensorboard/data/server:update_protos`.
* Confirm server works with `bazel run -c opt //tensorboard/data/server -- --logdir <some logdir>`
  • Loading branch information
bmd3k committed Jun 13, 2022
1 parent 2683356 commit b23b3da
Show file tree
Hide file tree
Showing 58 changed files with 1,154 additions and 593 deletions.
287 changes: 168 additions & 119 deletions tensorboard/data/server/Cargo.lock

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions tensorboard/data/server/Cargo.toml
Expand Up @@ -35,8 +35,8 @@ crossbeam = "0.8.0"
env_logger = "0.8.2"
futures-core = "0.3.12"
log = "0.4.11"
prost = "0.7.0"
prost-types = "0.7.0"
prost = "0.9.0"
prost-types = "0.9.0"
rand = "0.7.3"
rand_chacha = "0.2.2"
rayon = "1.5.0"
Expand All @@ -46,14 +46,14 @@ serde_json = "1.0.59"
thiserror = "1.0.21"
tokio = { version = "1.8.4", features = ["macros", "rt-multi-thread"] }
tokio-stream = { version = "0.1.2", features = ["net"] }
tonic = "0.4.2"
tonic-reflection = "0.1.0"
tonic = "0.6.2"
tonic-reflection = "0.3.0"
walkdir = "2.3.1"

[dev-dependencies]
prost-build = "0.7.0"
prost-build = "0.9.0"
tempfile = "3.1.0"
tonic-build = "0.4.2"
tonic-build = "0.6.2"

[[bin]]
name = "rustboard"
Expand Down Expand Up @@ -86,13 +86,13 @@ targets = [
[package.metadata.raze.crates.crc.'1.8.1']
gen_buildrs = true

[package.metadata.raze.crates.libc.'0.2.80']
[package.metadata.raze.crates.libc.'0.2.126']
gen_buildrs = true

[package.metadata.raze.crates.log.'0.4.11']
gen_buildrs = true

[package.metadata.raze.crates.indexmap.'1.6.0']
[package.metadata.raze.crates.indexmap.'1.8.2']
additional_flags = [
"--cfg=has_std",
]
Expand All @@ -109,18 +109,18 @@ additional_flags = [
"--cfg=wrap_proc_macro",
]

[package.metadata.raze.crates.prost-build.'0.7.0']
[package.metadata.raze.crates.prost-build.'0.9.0']
gen_buildrs = true

[package.metadata.raze.crates.ring.'0.16.20']
gen_buildrs = true
data_attr = "glob([\"src/**/*.der\"])"

[package.metadata.raze.crates.tonic-reflection.'0.1.0']
[package.metadata.raze.crates.tonic-reflection.'0.3.0']
gen_buildrs = true
build_data_dependencies = ["@com_google_protobuf//:protoc"]

[package.metadata.raze.crates.tonic-reflection.'0.1.0'.buildrs_additional_environment_variables]
[package.metadata.raze.crates.tonic-reflection.'0.3.0'.buildrs_additional_environment_variables]
PROTOC = "$(execpath @com_google_protobuf//:protoc)"
# We don't have easy access to a rustfmt binary, so make it a no-op.
# https://github.com/bazelbuild/rules_rust/issues/87
Expand Down
14 changes: 7 additions & 7 deletions tensorboard/data/server/cargo/BUILD.bazel
Expand Up @@ -113,7 +113,7 @@ alias(

alias(
name = "prost",
actual = "@raze__prost__0_7_0//:prost",
actual = "@raze__prost__0_9_0//:prost",
tags = [
"cargo-raze",
"manual",
Expand All @@ -122,7 +122,7 @@ alias(

alias(
name = "prost_build",
actual = "@raze__prost_build__0_7_0//:prost_build",
actual = "@raze__prost_build__0_9_0//:prost_build",
tags = [
"cargo-raze",
"manual",
Expand All @@ -131,7 +131,7 @@ alias(

alias(
name = "prost_types",
actual = "@raze__prost_types__0_7_0//:prost_types",
actual = "@raze__prost_types__0_9_0//:prost_types",
tags = [
"cargo-raze",
"manual",
Expand Down Expand Up @@ -212,7 +212,7 @@ alias(

alias(
name = "tokio",
actual = "@raze__tokio__1_8_4//:tokio",
actual = "@raze__tokio__1_19_2//:tokio",
tags = [
"cargo-raze",
"manual",
Expand All @@ -230,7 +230,7 @@ alias(

alias(
name = "tonic",
actual = "@raze__tonic__0_4_2//:tonic",
actual = "@raze__tonic__0_6_2//:tonic",
tags = [
"cargo-raze",
"manual",
Expand All @@ -239,7 +239,7 @@ alias(

alias(
name = "tonic_build",
actual = "@raze__tonic_build__0_4_2//:tonic_build",
actual = "@raze__tonic_build__0_6_2//:tonic_build",
tags = [
"cargo-raze",
"manual",
Expand All @@ -248,7 +248,7 @@ alias(

alias(
name = "tonic_reflection",
actual = "@raze__tonic_reflection__0_1_0//:tonic_reflection",
actual = "@raze__tonic_reflection__0_3_0//:tonic_reflection",
tags = [
"cargo-raze",
"manual",
Expand Down
8 changes: 4 additions & 4 deletions tensorboard/data/server/tensorboard.data.pb.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tensorboard/data/server/tensorboard.pb.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b23b3da

Please sign in to comment.