Skip to content

Commit

Permalink
Hide test command in arm target architectures
Browse files Browse the repository at this point in the history
For  testing a  smartmodule we  need  cranelift as  a dependency,  but
cranelift does not have support for arm target architectures
  • Loading branch information
matheus-consoli committed Nov 10, 2023
1 parent 18389a8 commit a772ba3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
1 change: 0 additions & 1 deletion 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 crates/fluvio-cli-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ futures = { workspace = true, features = ["std", "io-compat"]}
home = { workspace = true }
hex = { workspace = true }
http = { workspace = true }


semver = { workspace = true }
sha2 = { workspace = true }
sysinfo = { workspace = true, optional = true }
Expand Down
5 changes: 4 additions & 1 deletion crates/fluvio-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fluvio-package-index = { workspace = true }
fluvio-extension-common = { workspace = true, features = ["target"] }
fluvio-channel = { workspace = true }
fluvio-hub-util = { workspace = true, features = ["connector-cmds"] }
fluvio-cli-common = { workspace = true, features = ["smartmodule-test"] }
fluvio-cli-common = { workspace = true }
fluvio-smartengine = { workspace = true, features = ["transformation"]}
fluvio-protocol = { workspace = true, features=["record","api"] }
fluvio-smartmodule = { workspace = true }
Expand All @@ -101,6 +101,9 @@ fluvio-future = { workspace = true, features = ["fs", "io", "subscriber", "nativ
fluvio-sc-schema = { workspace = true, features = ["use_serde"], optional = true }
fluvio-spu-schema = { workspace = true, optional = true }

# smartmodule depends on cranelift, which is not available for `arm`
[target.'cfg(not(target_arch = "arm"))'.dependencies]
fluvio-cli-common = { workspace = true, features = ["smartmodule-test"] }

[dev-dependencies]
fluvio-future = { workspace = true, features = ["fixture"] }
10 changes: 7 additions & 3 deletions crates/fluvio-cli/src/client/smartmodule/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ mod create;
mod list;
mod delete;
mod watch;

// testing a smartmodule depends on cranelift
// but cranelift is not available for arm architectures
#[cfg(not(target_arch = "arm"))]
mod test;

pub use cmd::SmartModuleCmd;

mod cmd {

use std::sync::Arc;
use std::fmt::Debug;

Expand All @@ -24,7 +27,6 @@ mod cmd {
use super::create::CreateSmartModuleOpt;
use super::list::ListSmartModuleOpt;
use super::delete::DeleteSmartModuleOpt;
use super::test::TestSmartModuleOpt;
use super::watch::WatchSmartModuleOpt;

#[derive(Debug, Subcommand)]
Expand All @@ -34,7 +36,8 @@ mod cmd {
Watch(WatchSmartModuleOpt),
/// Delete one or more SmartModules with the given name(s)
Delete(DeleteSmartModuleOpt),
Test(TestSmartModuleOpt),
#[cfg(not(target_arch = "arm"))]
Test(super::test::TestSmartModuleOpt),
}

#[async_trait]
Expand All @@ -57,6 +60,7 @@ mod cmd {
Self::Watch(opt) => {
opt.process(out, target).await?;
}
#[cfg(not(target_arch = "arm"))]
Self::Test(opt) => {
opt.process(out, target).await?;
}
Expand Down

0 comments on commit a772ba3

Please sign in to comment.