Skip to content

Commit 76a7c19

Browse files
authored
Merge pull request #76 from nikomatsakis/main
add `symposium cargo`
2 parents 1ea55ef + e74ea11 commit 76a7c19

File tree

5 files changed

+50
-2
lines changed

5 files changed

+50
-2
lines changed

Cargo.lock

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/symposium-acp-agent/src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ struct Cli {
3939
#[arg(long, default_value = "crate_source", value_delimiter = ',')]
4040
ferris_tools: Vec<String>,
4141

42+
/// Enable or disable Cargo tools (default: yes)
43+
#[arg(long, default_value = "yes", value_parser = parse_yes_no)]
44+
cargo: bool,
45+
4246
/// Enable trace logging to the specified directory.
4347
/// Traces are written as timestamped .jsons files viewable with sacp-trace-viewer.
4448
#[arg(long)]
@@ -98,7 +102,8 @@ async fn main() -> Result<()> {
98102

99103
let mut symposium = symposium_acp_proxy::Symposium::new()
100104
.sparkle(cli.sparkle)
101-
.ferris(ferris_config);
105+
.ferris(ferris_config)
106+
.cargo(cli.cargo);
102107

103108
if let Some(trace_dir) = cli.trace_dir {
104109
symposium = symposium.trace_dir(trace_dir);

src/symposium-acp-proxy/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ tokio-util = { version = "0.7", features = ["compat"] }
3535

3636
# Proxy components
3737
symposium-ferris = { path = "../symposium-ferris", version = "1.0.0" }
38+
symposium-cargo = "0.2.0"
3839
sacp-tee.workspace = true
3940
sparkle.workspace = true

src/symposium-acp-proxy/src/lib.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use std::path::PathBuf;
2424
/// Shared configuration for Symposium proxy chains.
2525
struct SymposiumConfig {
2626
ferris: Option<symposium_ferris::Ferris>,
27+
cargo: bool,
2728
sparkle: bool,
2829
trace_dir: Option<PathBuf>,
2930
}
@@ -33,6 +34,7 @@ impl SymposiumConfig {
3334
SymposiumConfig {
3435
sparkle: true,
3536
ferris: Some(symposium_ferris::Ferris::default()),
37+
cargo: true,
3638
trace_dir: None,
3739
}
3840
}
@@ -64,6 +66,12 @@ impl Symposium {
6466
self
6567
}
6668

69+
/// Enable or disable Cargo tools.
70+
pub fn cargo(mut self, enable: bool) -> Self {
71+
self.config.cargo = enable;
72+
self
73+
}
74+
6775
/// Enable trace logging to a directory.
6876
/// Traces will be written as `<timestamp>.jsons` files.
6977
pub fn trace_dir(mut self, dir: impl Into<PathBuf>) -> Self {
@@ -84,6 +92,7 @@ impl Component<ProxyToConductor> for Symposium {
8492
let Self { config } = self;
8593

8694
let ferris = config.ferris;
95+
let cargo = config.cargo;
8796
let sparkle = config.sparkle;
8897
let trace_dir = config.trace_dir;
8998

@@ -101,6 +110,10 @@ impl Component<ProxyToConductor> for Symposium {
101110
)));
102111
}
103112

113+
if cargo {
114+
proxies.push(DynComponent::new(symposium_cargo::CargoProxy));
115+
}
116+
104117
if sparkle {
105118
proxies.push(DynComponent::new(sparkle::SparkleComponent::new()));
106119
}
@@ -153,6 +166,7 @@ impl Component<AgentToClient> for SymposiumAgent {
153166
let Self { config, agent } = self;
154167

155168
let ferris = config.ferris;
169+
let cargo = config.cargo;
156170
let sparkle = config.sparkle;
157171
let trace_dir = config.trace_dir;
158172

@@ -170,6 +184,10 @@ impl Component<AgentToClient> for SymposiumAgent {
170184
)));
171185
}
172186

187+
if cargo {
188+
proxies.push(DynComponent::new(symposium_cargo::CargoProxy));
189+
}
190+
173191
if sparkle {
174192
proxies.push(DynComponent::new(sparkle::SparkleComponent::new()));
175193
}

src/symposium-acp-proxy/src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ struct Cli {
2929
#[arg(long, default_value = "crate_source", value_delimiter = ',')]
3030
ferris_tools: Vec<String>,
3131

32+
/// Enable or disable Cargo tools (default: yes)
33+
#[arg(long, default_value = "yes", value_parser = parse_yes_no)]
34+
cargo: bool,
35+
3236
/// Enable trace logging to the specified directory.
3337
/// Traces are written as timestamped .jsons files viewable with sacp-trace-viewer.
3438
#[arg(long)]
@@ -80,7 +84,8 @@ async fn main() -> Result<()> {
8084

8185
let mut symposium = symposium_acp_proxy::Symposium::new()
8286
.sparkle(cli.sparkle)
83-
.ferris(ferris_config);
87+
.ferris(ferris_config)
88+
.cargo(cli.cargo);
8489

8590
if let Some(trace_dir) = cli.trace_dir {
8691
symposium = symposium.trace_dir(trace_dir);

0 commit comments

Comments
 (0)