diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6dec204..a7ec6239 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,9 @@ jobs: with: key: ${{ matrix.TARGET }} + - run: cargo check --target ${{ matrix.TARGET }} --no-default-features + env: + RUSTFLAGS: -D warnings - run: cargo check --target ${{ matrix.TARGET }} env: RUSTFLAGS: -D warnings diff --git a/CHANGELOG.md b/CHANGELOG.md index 25439d50..942676c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Fix building without `yaml` feature - Compatibility with `riscv` 0.12 and `riscv-rt` 0.13 - Add `riscv_config` section in `settings.yaml` It uses `riscv-pac` traits and standard `riscv-peripheral` peripherals. diff --git a/src/generate/device.rs b/src/generate/device.rs index 9f0ff909..fdecb54b 100644 --- a/src/generate/device.rs +++ b/src/generate/device.rs @@ -29,10 +29,15 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result { let file = std::fs::read_to_string(settings).context("could not read settings file")?; Some(serde_yaml::from_str(&file).context("could not parse settings file")?) } + #[cfg(not(feature = "yaml"))] + Some(_) => { + return Err(anyhow::anyhow!("Support for yaml config files is not available because svd2rust was compiled without the yaml feature")); + } None => None, };