Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RISC-V settings file is not applied when using [email protected] and settings_file #889

Open
jessebraham opened this issue Nov 15, 2024 · 1 comment

Comments

@jessebraham
Copy link
Member

When using [email protected] and Config.settings, the YAML configuration is loaded from the specified path and applied as expected. Upon updating to [email protected] and instead using Config.settings_file with the same path, the configuration is no longer applied to the generated PAC.

@burrbull
Copy link
Member

burrbull commented Nov 15, 2024

Sorry forgot about this. Reading settings file was moved out of render. See

svd2rust/src/lib.rs

Lines 632 to 645 in b6ef0b0

match config.settings_file.as_ref() {
#[cfg(feature = "yaml")]
Some(settings) => {
let file = std::fs::read_to_string(settings).context("could not read settings file")?;
config
.settings
.update_from(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 => {}
};

But as you do not use generate just copy-paste this.

P.S. Config part should be redesigned somehow to better support both cli and lib. But I'm not sure how to better do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants