Skip to content

Commit b2ef9b5

Browse files
Ben Carrfacebook-github-bot
authored andcommitted
Update modern Hyper deps in shims
Summary: This brings changes into the OSS shim that should have been included in D76918206 but were missed (partially due to the OSS CI job already being broken at the time). Reviewed By: dtolnay Differential Revision: D80467762 fbshipit-source-id: 1b3aa5d42bdb73a1bb2f2957cd340484b50657a9
1 parent 5965d7f commit b2ef9b5

File tree

3 files changed

+100
-16
lines changed

3 files changed

+100
-16
lines changed

shim/buck2/proto_defs.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ load(
1010
"@shim//:shims.bzl",
1111
_proto_srcs = "proto_srcs",
1212
_rust_protobuf_library = "rust_protobuf_library",
13+
_rust_protobuf_library_prost_0134 = "rust_protobuf_library_prost_0134",
1314
)
1415

1516
rust_protobuf_library = _rust_protobuf_library
17+
rust_protobuf_library_prost_0134 = _rust_protobuf_library_prost_0134
1618
proto_srcs = _proto_srcs

shim/shims.bzl

Lines changed: 74 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -350,22 +350,90 @@ def rust_protobuf_library(
350350
name,
351351
srcs,
352352
build_script,
353-
protos = None, # Pass a list of files. Thye'll be placed in the cwd. Prefer using proto_srcs.
353+
protos = None, # Pass a list of files. They'll be placed in the cwd. Prefer using proto_srcs.
354354
deps = None,
355355
test_deps = None,
356356
doctests = True,
357357
build_env = None,
358-
proto_srcs = None): # Use a proto_srcs() target, path is exposed as BUCK_PROTO_SRCS.
358+
proto_srcs = None,
359+
crate_name = None): # Use a proto_srcs() target, path is exposed as BUCK_PROTO_SRCS.
360+
_rust_protobuf_library(
361+
name,
362+
srcs,
363+
build_script,
364+
"buck2_protoc_dev",
365+
"prost",
366+
"prost-types",
367+
"tonic",
368+
protos,
369+
deps,
370+
test_deps,
371+
doctests,
372+
build_env,
373+
proto_srcs,
374+
crate_name,
375+
)
376+
377+
def rust_protobuf_library_prost_0134(
378+
name,
379+
srcs,
380+
build_script,
381+
protos = None, # Pass a list of files. They'll be placed in the cwd. Prefer using proto_srcs.
382+
deps = None,
383+
test_deps = None,
384+
doctests = True,
385+
build_env = None,
386+
proto_srcs = None,
387+
crate_name = None):
388+
# Use a proto_srcs() target, path is exposed as BUCK_PROTO_SRCS.
389+
_rust_protobuf_library(
390+
name,
391+
srcs,
392+
build_script,
393+
"buck2_protoc_dev-tonic-0-12-3",
394+
"prost-0-13-4",
395+
"prost-types-0-13-4",
396+
"tonic-0-12-3",
397+
protos,
398+
deps,
399+
test_deps,
400+
doctests,
401+
build_env,
402+
proto_srcs,
403+
crate_name,
404+
)
405+
406+
def _rust_protobuf_library(
407+
name,
408+
srcs,
409+
build_script,
410+
buck2_protoc_dev,
411+
versioned_prost_target,
412+
versioned_prost_types_target,
413+
versioned_tonic_target,
414+
protos, # Pass a list of files. They'll be placed in the cwd. Prefer using proto_srcs.
415+
deps,
416+
test_deps,
417+
doctests,
418+
build_env,
419+
proto_srcs,
420+
crate_name): # Use a proto_srcs() target, path is exposed as BUCK_PROTO_SRCS.
359421
build_name = name + "-build"
360422
proto_name = name + "-proto"
361423

424+
deps = (deps or []) + [
425+
"fbsource//third-party/rust:" + versioned_prost_target,
426+
"fbsource//third-party/rust:" + versioned_prost_types_target,
427+
"fbsource//third-party/rust:" + versioned_tonic_target,
428+
]
429+
362430
rust_binary(
363431
name = build_name,
364432
srcs = [build_script],
365433
crate_root = build_script,
366434
deps = [
367-
"fbsource//third-party/rust:tonic-build",
368-
"//buck2/app/buck2_protoc_dev:buck2_protoc_dev",
435+
"fbsource//third-party/rust:" + versioned_tonic_target,
436+
"//buck2/app/buck2_protoc_dev:" + buck2_protoc_dev,
369437
],
370438
)
371439

@@ -398,11 +466,8 @@ def rust_protobuf_library(
398466
"OUT_DIR": "$(location :{})".format(proto_name),
399467
},
400468
test_deps = test_deps,
401-
deps = [
402-
"fbsource//third-party/rust:prost",
403-
"fbsource//third-party/rust:prost-types",
404-
"fbsource//third-party/rust:tonic",
405-
] + (deps or []),
469+
deps = deps,
470+
crate = crate_name or name,
406471
)
407472

408473
ProtoSrcsInfo = provider(fields = ["srcs"])

shim/third-party/rust/Cargo.toml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,22 @@ hex = "0.4.3"
9797
higher-order-closure = "0.0.5"
9898
hostname = "0.3.1"
9999
http = "0.2"
100+
http-1 = { package = "http", version = "1.3.1" }
101+
http-body-util = "0.1.0"
100102
httparse = "1.7.1"
101103
httptest = "0.15"
104+
httptest-0-16 = { package = "httptest", version = "0.16" }
102105
humantime = "2.0.1"
103106
hyper-0-14 = { package = "hyper", version = "0.14.26", features = ["client", "http1", "http2", "stream"] }
107+
hyper-1-5-1 = { package = "hyper", version = "1.5.1", features = ["client", "http1", "http2"] }
108+
hyperlocal-0-9 = { package = "hyperlocal", version = "0.9", features = ["client"] }
104109
hyper-proxy = { git = "https://github.com/get9/hyper-proxy", rev = "80ac13e5bc89fa8e41c6155aa1bcc733242a158d", features = ["rustls"], default_features = false } # branch = tokio-rustls-0.23 Many PRs to bump versions (#28, #30, #31) are several years old, possibly abandoned crate. This fork contains changes from #28 + changes to upgrade rustls to 0.21.
110+
hyper-proxy2 = { version = "0.1", features = ["rustls"], default-features = false }
105111
hyper-rustls = { version = "0.24.0", features = ["http2"] }
112+
hyper-rustls-0-26 = { package = "hyper-rustls", version = "0.26.0", features = ["http2"] }
106113
hyper-timeout = "0.4"
107-
hyper-unix-connector = "0.2"
114+
hyper-timeout-0-5 = { package = "hyper-timeout", version = "0.5" }
115+
hyper-util = "0.1.10"
108116
indent_write = "2.2.0"
109117
indenter = "0.3.3"
110118
indexmap = { version = "2.9.0", features = ["arbitrary", "rayon", "serde"] }
@@ -136,6 +144,7 @@ memmap2 = "0.5.0"
136144
memoffset = "0.6.4"
137145
mimalloc = { version = "0.1.46", default-features = false }
138146
multimap = "0.8.2"
147+
native-tls = "0.2"
139148
nix = { version = "0.30.1", features = ["dir", "event", "hostname", "inotify", "ioctl", "mman", "mount", "net", "poll", "ptrace", "reboot", "resource", "sched", "signal", "term", "time", "user", "zerocopy"] }
140149
nom = "8"
141150
nom-language = "0.1"
@@ -158,10 +167,14 @@ plist = "0.5"
158167
pretty_assertions = "1.2.1"
159168
probminhash = { git = "https://github.com/krallin/probminhash", rev = "3d6b7a5315305c2893a7a04e0de9e23b305992c5", default-features = false } # WAITING_FOR_PR https://github.com/jean-pierreBoth/probminhash/pull/4
160169
proc-macro2 = { version = "1.0.70", features = ["span-locations"] }
161-
prost = "0.12"
162-
prost-build = "0.12"
170+
prost = { version = "0.12", default-features = false }
171+
prost-0-13-4 = { package = "prost", version = "0.13.4", default-features = false }
172+
prost-types = { version = "0.12", default-features = false }
173+
prost-types-0-13-4 = { package = "prost-types", version = "0.13.4", default-features = false }
174+
prost-build = { version = "0.12", features = ["cleanup-markdown"] }
175+
prost-build-0-13-4 = { package = "prost-build", version = "0.13.4", features = ["cleanup-markdown"] }
163176
prost-derive = "0.12"
164-
prost-types = "0.12"
177+
prost-derive-0-13-4 = { package = "prost-derive", version = "0.13.4" }
165178
protoc-bin-vendored = "3.0.0"
166179
psutil = "3.2"
167180
ptyprocess = "0.4"
@@ -177,6 +190,7 @@ ring = "=0.17.5" # Upgrading this is possible, but a pain, so we don't want to p
177190
rusqlite = { version = "0.33", features = ["bundled"] }
178191
rustc-hash = "2.1.0"
179192
rustls = "0.21.0"
193+
rustls-0-22 = { package = "rustls", version = "0.22" }
180194
rustls-native-certs = { package = "rustls-native-certs", version = "0.6.2" }
181195
rustls-native-certs-0-8-1 = { package = "rustls-native-certs", version = "0.8.1" }
182196
rustls-pemfile = { package = "rustls-pemfile", version = "1.0.0" }
@@ -217,15 +231,18 @@ textwrap = { version = "0.11", features = ["term_size"] }
217231
thiserror = "1.0.36"
218232
threadpool = "1.8.1"
219233
tokio = { version = "1.25.0", features = ["full", "test-util", "tracing"] }
220-
tokio-rustls = { package = "tokio-rustls", version = "0.24.1", features = ["dangerous_configuration"] }
234+
tokio-rustls = { version = "0.24.1", features = ["dangerous_configuration"] }
235+
tokio-rustls-0-25 = { package = "tokio-rustls", version = "0.25" }
221236
tokio-stream = { version = "0.1.14", features = ["fs", "io-util", "net", "signal", "sync", "time"] }
222237
tokio-util = { version = "0.6", features = ["full"] }
223238
toml = "0.5"
224239
tonic = { version = "0.10.2", features = ["tls", "tls-webpki-roots"] }
225-
tonic-build = { version = "0.10.2", features = ["cleanup-markdown", "prost"] }
240+
tonic-0-12-3 = { package = "tonic", version = "0.12.3", features = ["tls", "tls-webpki-roots"] }
241+
tonic-build = { version = "0.10.2", features = ["prost", "cleanup-markdown"] }
242+
tonic-build-0-12-3 = { package = "tonic-build", version = "0.12.3", features = ["prost", "cleanup-markdown"] }
226243
tower = "0.4"
227244
tower-layer = "0.3.1"
228-
tower-service = "0.3.2"
245+
tower-service = "0.3.3"
229246
tracing = "0.1.22"
230247
tracing-core = "0.1.32"
231248
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }

0 commit comments

Comments
 (0)