feat(doom): add doom.aot option (#1214)

This commit is contained in:
Gideon
2025-11-08 11:03:08 +01:00
committed by GitHub
parent ea1b286c98
commit 28f5754efd
3 changed files with 28 additions and 1 deletions

View File

@@ -382,6 +382,12 @@
# (default: false) # (default: false)
# include_release_notes = false # include_release_notes = false
[doom]
# If this is set to true, the `--aot` flag is added to `doom upgrade`,
# which enables ahead-of-time native compilation of packages.
# (default: false)
# aot = true
[rustup] [rustup]
# If set, updates only these channels. # If set, updates only these channels.
# (default: [] (all channels)) # (default: [] (all channels))

View File

@@ -391,6 +391,12 @@ pub struct VscodeConfig {
profile: Option<String>, profile: Option<String>,
} }
#[derive(Deserialize, Default, Debug, Merge)]
#[serde(deny_unknown_fields)]
pub struct DoomConfig {
aot: Option<bool>,
}
#[derive(Deserialize, Default, Debug, Merge)] #[derive(Deserialize, Default, Debug, Merge)]
#[serde(deny_unknown_fields)] #[serde(deny_unknown_fields)]
pub struct Rustup { pub struct Rustup {
@@ -482,6 +488,9 @@ pub struct ConfigFile {
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)] #[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
vscode: Option<VscodeConfig>, vscode: Option<VscodeConfig>,
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
doom: Option<DoomConfig>,
#[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)] #[merge(strategy = crate::utils::merge_strategies::inner_merge_opt)]
rustup: Option<Rustup>, rustup: Option<Rustup>,
} }
@@ -1772,6 +1781,14 @@ impl Config {
Some(profile.as_str()) Some(profile.as_str())
} }
} }
pub fn doom_aot(&self) -> bool {
self.config_file
.doom
.as_ref()
.and_then(|doom| doom.aot)
.unwrap_or(false)
}
} }
#[cfg(test)] #[cfg(test)]

View File

@@ -65,7 +65,11 @@ impl Emacs {
command.arg("--force"); command.arg("--force");
} }
command.args(["upgrade"]); command.arg("upgrade");
if ctx.config().doom_aot() {
command.arg("--aot");
}
command.status_checked() command.status_checked()
} }