From 131464787d32ab9406dbac87db419a2a80a3db83 Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Thu, 23 Dec 2021 13:15:11 +0530 Subject: [PATCH] gpio: Skip musl builds Disable builds for musl, where libgpiod build fails on rust-vmm-container due to missing tools and headers. Signed-off-by: Viresh Kumar --- gpio/Cargo.toml | 1 + gpio/src/main.rs | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/gpio/Cargo.toml b/gpio/Cargo.toml index 28ae5c2..07cc8b2 100644 --- a/gpio/Cargo.toml +++ b/gpio/Cargo.toml @@ -24,6 +24,7 @@ virtio-queue = "0.2" vm-memory = "0.7" vmm-sys-util = "=0.9.0" +[target.'cfg(target_env = "gnu")'.dependencies] libgpiod = { git = "https://github.com/vireshk/libgpiod" } [dev-dependencies] diff --git a/gpio/src/main.rs b/gpio/src/main.rs index 3531af3..045cea3 100644 --- a/gpio/src/main.rs +++ b/gpio/src/main.rs @@ -5,10 +5,21 @@ // // SPDX-License-Identifier: Apache-2.0 +#[cfg(target_env = "gnu")] mod backend; +#[cfg(target_env = "gnu")] mod gpio; +#[cfg(target_env = "gnu")] mod vhu_gpio; +#[cfg(target_env = "gnu")] fn main() -> backend::Result<()> { backend::gpio_init() } + +// Rust vmm container (https://github.com/rust-vmm/rust-vmm-container) doesn't +// have tools to do a musl build at the moment, and adding that support is +// tricky as well to the container. Skip musl builds until the time pre-built +// libgpiod library is available for musl. +#[cfg(target_env = "musl")] +fn main() {}