blob: bc3aaa09b34b485ac34769e8acd60e6cbdc4506d [file]
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/components.gni")
import("//build/rust/rustc_binary.gni")
import("//src/connectivity/network/unified_binary/network_unified_binary.gni")
group("tests") {
testonly = true
deps = [
":http-client-test",
"integration:tests",
]
}
network_unified_binary("http_client") {
edition = "2024"
with_unit_tests = true
deps = [
":http_client_config",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/fidl/fuchsia.net.http:fuchsia.net.http_rust",
"//sdk/fidl/fuchsia.pkg.http:fuchsia.pkg.http_rust",
"//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle_rust",
"//sdk/rust/zx",
"//src/lib/detect-stall",
"//src/lib/diagnostics/inspect/runtime/rust",
"//src/lib/diagnostics/inspect/rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-hyper",
"//src/lib/fuchsia-runtime",
"//src/lib/trace/rust:trace",
"//src/lib/trace/rust:trace-provider",
"//src/storage/fxfs/fidl/fuchsia.fxfs:fuchsia.fxfs_rust",
"//src/storage/lib/blob_writer:blob-writer",
"//src/storage/lib/vfs/rust:vfs",
"//src/sys/pkg/lib/async-generator",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:http",
"//third_party/rust_crates:hyper",
"//third_party/rust_crates:log",
"//third_party/rust_crates:thiserror",
]
sources = [
"src/main.rs",
"src/pkg.rs",
"src/resuming_get.rs",
]
test_deps = [ "//third_party/rust_crates:assert_matches" ]
}
fuchsia_component_manifest("manifest") {
component_name = "http-client"
manifest = "meta/http_client.cml"
restricted_features = [ "delivery_type" ]
}
network_unified_binary_regular_and_gub_components("component") {
component_name = "http-client"
cm_label = ":manifest"
gub_deps = [ ":http_client" ]
}
fuchsia_structured_config_rust_lib("http_client_config") {
cm_label = ":manifest"
}
network_unified_binary_regular_and_gub_packages("package") {
package_name = "http-client"
gub_deps = [ ":component" ]
visibility = [ "//bundles/assembly/*" ]
}
# fuchsia_hyper::new_https_client fails if there isn't a file at
# /config/ssl/cert.pem, but the unit tests don't actually make https connections
# and so don't need any certs, so we can just give them an empty file instead of
# making them a system test and giving them the system certs.
resource("fake-ssl-certs") {
sources = [ "fake_cert_for_test.pem" ]
outputs = [ "fake-ssl-certs/cert.pem" ]
visibility = [ ":*" ]
}
fuchsia_unittest_package("http-client-test") {
manifest = "meta/http_client_test.cml"
deps = [
":fake-ssl-certs",
":http_client_test",
"//src/connectivity/network:netstack-for-tests",
"//src/connectivity/network/dns:component",
]
}