Skip to content

Commit

Permalink
EDGAR -> Re-enable plugin support on ARM32.
Browse files Browse the repository at this point in the history
Wasmtime now automatically runs with the Pulley interpreter on platforms not supported by Cranelift.

https://docs.wasmtime.dev/examples-pulley.html
  • Loading branch information
mbfm committed Feb 7, 2025
1 parent bf5eb29 commit ebcd1c7
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 17 deletions.
9 changes: 3 additions & 6 deletions opendut-edgar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ license.workspace = true
[dependencies]
opendut-carl-api = { workspace = true, features = ["client"] }
opendut-edgar-kernel-modules = { workspace = true }
opendut-edgar-plugin-api = { workspace = true, features = ["host"] }
opendut-netbird-client-api = { workspace = true }
opendut-types = { workspace = true }
opendut-util = { workspace = true, features = ["crypto"] }
Expand Down Expand Up @@ -49,15 +50,11 @@ tracing-opentelemetry = { workspace = true }
uuid = { workspace = true, features = ["v4"] }
url = { workspace = true }
walkdir = { workspace = true }
wasmtime = { workspace = true }
wasmtime-wasi = { workspace = true }
which = { workspace = true }
zip = { workspace = true }

# Wasmtime is not available for armv7 so plugin support needs to be disabled
# https://docs.wasmtime.dev/stability-tiers.html#unsupported-features-and-platforms
[target.'cfg(not(target_arch = "arm"))'.dependencies]
opendut-edgar-plugin-api = { workspace = true, features = ["host"] }
wasmtime = { workspace = true }
wasmtime-wasi = { workspace = true }

[dev-dependencies]
assert_fs = { workspace = true }
Expand Down
6 changes: 0 additions & 6 deletions opendut-edgar/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ pub async fn cli() -> anyhow::Result<()> {
.expect("Failed to request sudo privileges.");
}

#[cfg(target_arch = "arm")]
{
println!("Running on ARMv7 / ARM32. Plugins cannot be used on this architecture.");
info!("Running on ARMv7 / ARM32. Plugins cannot be used on this architecture. For more information, see: https://github.com/bytecodealliance/wasmtime/issues/1173")
}

match setup_mode {
SetupMode::Managed { setup_string } => {
setup::start::managed(dry_run, no_confirm, setup_string, mtu).await?;
Expand Down
1 change: 0 additions & 1 deletion opendut-edgar/src/setup/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ mod constants;

pub mod start;

#[cfg(not(target_arch = "arm"))]
mod plugin;

#[allow(non_camel_case_types)]
Expand Down
2 changes: 1 addition & 1 deletion opendut-edgar/src/setup/plugin/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fn read_plugin_order(plugins_dir: &Path) -> anyhow::Result<Vec<PathBuf>> {
let config = fs::read_to_string(&config_path)?;
let potential_plugin_paths = config.lines()
.map(|line| line.trim())
.filter(|line| line.is_empty().not()) //FIXME
.filter(|line| line.is_empty().not())
.map(PathBuf::from);

let mut paths: Vec<PathBuf> = vec![];
Expand Down
4 changes: 1 addition & 3 deletions opendut-edgar/src/setup/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ pub async fn managed(dry_run: DryRun, no_confirm: bool, setup_string: String, mt

let mut tasks: Vec<Box<dyn Task>> = vec![];

#[cfg(not(target_arch = "arm"))]
let _ = crate::setup::plugin::init::create_plugin_runtime(&mut tasks)?;


Expand Down Expand Up @@ -126,8 +125,7 @@ pub async fn unmanaged(
let network_interface_manager = NetworkInterfaceManager::create()?;

let mut tasks: Vec<Box<dyn Task>> = vec![];

#[cfg(not(target_arch = "arm"))]

let _ = crate::setup::plugin::init::create_plugin_runtime(&mut tasks)?;

tasks.append(&mut vec![
Expand Down

0 comments on commit ebcd1c7

Please sign in to comment.