Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,49 @@ crate.spec(
package = "anyhow",
version = "1",
)
crate.spec(
features = ["alloc"],
package = "postcard",
version = "1",
)
crate.spec(
features = ["tokio"],
package = "command-fds",
version = "0.3",
)
crate.spec(
package = "googletest",
version = "0.14",
)
crate.spec(
features = [
"fs",
"mount",
"process",
"sched",
"signal",
],
package = "nix",
version = "0.29",
)
crate.spec(
features = [
"fs",
"io-util",
"macros",
"net",
"process",
"rt",
"rt-multi-thread",
"signal",
],
package = "tokio",
version = "1",
)
crate.spec(
package = "tokio-seqpacket",
version = "0.7",
)
crate.spec(
features = ["derive"],
package = "serde",
Expand Down
484 changes: 474 additions & 10 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions pktexec/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_test")

rust_library(
name = "wire",
srcs = ["wire.rs"],
visibility = ["//visibility:public"],
deps = [
"@crates//:anyhow",
"@crates//:postcard",
"@crates//:serde",
],
)

rust_binary(
name = "pktexecd",
srcs = ["pktexecd.rs"],
visibility = ["//visibility:public"],
deps = [
":wire",
"@crates//:anyhow",
"@crates//:clap",
"@crates//:command-fds",
"@crates//:libc",
"@crates//:nix",
"@crates//:tokio",
"@crates//:tokio-seqpacket",
],
)

rust_binary(
name = "pktexec",
srcs = ["pktexec.rs"],
visibility = ["//visibility:public"],
deps = [
":wire",
"@crates//:anyhow",
"@crates//:libc",
"@crates//:nix",
"@crates//:tokio",
"@crates//:tokio-seqpacket",
],
)

rust_test(
name = "wire_test",
crate = ":wire",
deps = [
"@crates//:googletest",
],
)

rust_test(
name = "pktexec_test",
srcs = ["pktexec_test.rs"],
data = [
":pktexec",
":pktexecd",
],
env = {
"PKTEXEC_BIN": "$(rootpath :pktexec)",
"PKTEXECD_BIN": "$(rootpath :pktexecd)",
},
tags = ["local"],
deps = [
"@crates//:googletest",
"@crates//:libc",
],
)
Loading
Loading