diff --git a/twoliter/Cargo.toml b/twoliter/Cargo.toml index fa245d5b..d852198a 100644 --- a/twoliter/Cargo.toml +++ b/twoliter/Cargo.toml @@ -43,7 +43,7 @@ which.workspace = true # Binary dependencies. These are binaries that we want to embed in the Twoliter binary buildsys = { workspace = true } pipesys = { workspace = true } -pubsys = { workspace = true } +pubsys = { workspace = true, optional = true } pubsys-setup = { workspace = true } testsys = { workspace = true } tuftool = { workspace = true } @@ -58,5 +58,6 @@ tar.workspace = true test-case.workspace = true [features] -default = ["integ-tests"] +default = ["integ-tests", "pubsys"] integ-tests = [] +pubsys = ["dep:pubsys"] diff --git a/twoliter/src/tools.rs b/twoliter/src/tools.rs index 09053db8..b22c8de0 100644 --- a/twoliter/src/tools.rs +++ b/twoliter/src/tools.rs @@ -12,6 +12,7 @@ use tracing::debug; const TAR_GZ_DATA: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/tools.tar.gz")); const BUILDSYS: &[u8] = include_bytes!(env!("CARGO_BIN_FILE_BUILDSYS")); const PIPESYS: &[u8] = include_bytes!(env!("CARGO_BIN_FILE_PIPESYS")); +#[cfg(feature = "pubsys")] const PUBSYS: &[u8] = include_bytes!(env!("CARGO_BIN_FILE_PUBSYS")); const PUBSYS_SETUP: &[u8] = include_bytes!(env!("CARGO_BIN_FILE_PUBSYS_SETUP")); const TESTSYS: &[u8] = include_bytes!(env!("CARGO_BIN_FILE_TESTSYS")); @@ -44,6 +45,7 @@ pub(crate) async fn install_tools(tools_dir: impl AsRef) -> Result<()> { write_bin("buildsys", BUILDSYS, &dir, mtime).await?; write_bin("pipesys", PIPESYS, &dir, mtime).await?; + #[cfg(feature = "pubsys")] write_bin("pubsys", PUBSYS, &dir, mtime).await?; write_bin("pubsys-setup", PUBSYS_SETUP, &dir, mtime).await?; write_bin("testsys", TESTSYS, &dir, mtime).await?;