blob: 619119dfbf2a9e80a0cfe929c1120cf2a07168e9 [file] [log] [blame]
# Copyright 2018 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/package.gni")
import("//build/rust/rustc_binary.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
rustc_binary("bin") {
name = "netstack3"
edition = "2018"
with_unit_tests = true
deps = [
"core:netstack3-core",
"//garnet/lib/rust/ethernet",
"//garnet/lib/rust/fidl_fuchsia_hardware_ethernet_ext",
"//garnet/lib/rust/fidl_fuchsia_net_ext",
"//garnet/lib/rust/fidl_fuchsia_net_stack_ext",
"//garnet/lib/rust/never",
"//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet-rustc",
"//sdk/fidl/fuchsia.net.icmp:fuchsia.net.icmp-rustc",
"//sdk/fidl/fuchsia.net.icmp:fuchsia.net.icmp-rustc",
"//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack-rustc",
"//src/connectivity/lib/net-types",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/network/packet",
"//src/lib/syslog/rust:syslog",
"//src/lib/zerocopy",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:byteorder",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:libc",
"//third_party/rust_crates:log",
"//third_party/rust_crates:pin-utils",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:thiserror",
"//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc",
"//zircon/system/fidl/fuchsia-net:fuchsia-net-rustc",
"//zircon/system/fidl/fuchsia-posix-socket:fuchsia-posix-socket-rustc",
]
test_deps = [
"//src/connectivity/network/testing/netemul/lib/fidl:network-rustc",
"//src/connectivity/network/testing/netemul/lib/fidl:sandbox-rustc",
]
# TODO(48460): Fix the leaks and remove this.
non_rust_deps = [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ]
}
package("netstack3") {
deps = [ ":bin" ]
binaries = [
{
name = "netstack3"
},
]
meta = [
{
path = rebase_path("meta/netstack3.cmx")
dest = "netstack3.cmx"
},
]
}
test_package("netstack3_tests") {
deps = [
":bin_test",
"core:netstack3-core_test",
"core/specialize-ip-macro/test:lib_test",
]
tests = [
{
name = "netstack3_bin_test"
environments = [ qemu_env ]
},
{
name = "netstack3_core_lib_test"
environments = [ qemu_env ]
},
{
name = "specialize_ip_macro_test_lib_test"
environments = [ qemu_env ]
},
]
}
group("tests") {
testonly = true
deps = [
":netstack3",
":netstack3_tests",
"tools:netstack3_tools",
]
}