Skip to content

Commit

Permalink
Remove some unused xtask code
Browse files Browse the repository at this point in the history
Change-Id: I44cc215fced9f275d1f8d38b45450bd9c044d257
  • Loading branch information
jblebrun committed Jun 27, 2024
1 parent eecf436 commit 77953fc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 126 deletions.
32 changes: 12 additions & 20 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ once_cell = "*"
portpicker = "*"
regex = "*"
serde = { version = "*", features = ["derive"] }
strum = "0.24"
strum_macros = "0.25"
tokio = { version = "*", features = [
"fs",
"io-util",
Expand Down
34 changes: 0 additions & 34 deletions xtask/src/examples.rs

This file was deleted.

69 changes: 0 additions & 69 deletions xtask/src/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use async_trait::async_trait;
use clap::{Parser, Subcommand};
use colored::*;
use nix::sys::signal::Signal;
use strum_macros::EnumIter;
use tokio::io::{empty, AsyncRead, AsyncReadExt};

use crate::PROCESSES;
Expand Down Expand Up @@ -65,74 +64,6 @@ pub struct Completion {
pub file_name: PathBuf,
}

/// Holds the options for running the example.
#[derive(Parser, Clone, Debug)]
pub struct RunOakExampleOpt {
#[arg(
long,
help = "name of a single example to run (i.e. the Rust crate name of the Wasm module)"
)]
pub example_name: String,
#[arg(long, help = "path to the lookup data file")]
pub lookup_data_path: Option<String>,
}

#[derive(Parser, Clone, Debug)]
pub struct BuildClient {
#[arg(
long,
help = "client variant: [all, rust, cpp, go, nodejs, none] [default: all]",
default_value = "all"
)]
pub client_variant: String,
#[arg(
long,
help = "rust toolchain override to use for the client compilation [e.g. stable, nightly, stage2]"
)]
pub client_rust_toolchain: Option<String>,
#[arg(
long,
help = "rust target to use for the client compilation [e.g. x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl, x86_64-apple-darwin]"
)]
pub client_rust_target: Option<String>,
}

#[derive(serde::Deserialize, Default, Debug, Clone, PartialEq, EnumIter)]
pub enum ServerVariant {
/// Production-like server variant, without logging or any of the
/// experimental features enabled
#[default]
Base,
}

impl std::str::FromStr for ServerVariant {
type Err = String;
fn from_str(variant: &str) -> Result<Self, Self::Err> {
match variant {
"base" => Ok(ServerVariant::Base),
_ => Err(format!("couldn't parse functions server variant {}", variant)),
}
}
}

impl ServerVariant {
// Get path to manifest for the variant.
pub fn path_to_manifest(&self) -> &'static str {
match self {
ServerVariant::Base => "./oak_functions_launcher",
}
}

/// Get path to the executable server binary for the server variant.
pub fn path_to_executable(&self) -> &'static str {
match self {
ServerVariant::Base => {
"./target/x86_64-unknown-linux-musl/release/oak_functions_launcher"
}
}
}
}

#[derive(Parser, Clone, Debug)]
pub struct RunTestsOpt {
#[arg(long, help = "Remove generated files after running tests for each crate")]
Expand Down
1 change: 0 additions & 1 deletion xtask/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pub mod check_build_licenses;
pub mod check_license;
pub mod check_todo;
pub mod containers;
pub mod examples;
pub mod files;
pub mod internal;
pub mod launcher;
Expand Down

0 comments on commit 77953fc

Please sign in to comment.