Skip to content

Commit

Permalink
twoliter: conditionally compile pubsys
Browse files Browse the repository at this point in the history
While we do not publish twoliter without pubsys support built in, it can
speed up development compile times to avoid needing to compile pubsys
(which subsequently compiles the AWS SDK for Rust.)
  • Loading branch information
cbgbt committed Dec 23, 2024
1 parent 8f68127 commit 4793832
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions twoliter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -58,5 +58,6 @@ tar.workspace = true
test-case.workspace = true

[features]
default = ["integ-tests"]
default = ["integ-tests", "pubsys"]
integ-tests = []
pubsys = ["dep:pubsys"]
2 changes: 2 additions & 0 deletions twoliter/src/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -44,6 +45,7 @@ pub(crate) async fn install_tools(tools_dir: impl AsRef<Path>) -> 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?;
Expand Down

0 comments on commit 4793832

Please sign in to comment.