From ff104ddc49df295d1c00d2e5923cb345c39b6eee Mon Sep 17 00:00:00 2001 From: Phoebus Date: Sat, 26 Sep 2026 18:59:53 -0700 Subject: [PATCH] fix(install): scoped keywords for zsh plugin lane --- .../crates/phoebus-core/src/system.rs | 32 +++++++++++++++++++ .../crates/phoebus-executor/src/portage.rs | 5 +++ 2 files changed, 37 insertions(+) diff --git a/installer-rs/crates/phoebus-core/src/system.rs b/installer-rs/crates/phoebus-core/src/system.rs index 58fbca7..25bd6b4 100644 --- a/installer-rs/crates/phoebus-core/src/system.rs +++ b/installer-rs/crates/phoebus-core/src/system.rs @@ -908,6 +908,23 @@ pub fn accept_keywords_mango() -> String { o } +/// The reviewed `~amd64` keyword set for the shell lane. +/// +/// `app-shells/zsh` itself is stable; the packaged plugins +/// (`zsh-autosuggestions` proven `~amd64`-only in GURU by VM install run 3, +/// the other two scoped alongside it) ship testing-only. The login shell is +/// a base package, so these keywords are written with the base Portage +/// configuration whenever GURU is enabled — not only for the Mango profile. +/// This is NOT a global `~amd64` switch. +pub fn accept_keywords_shell() -> String { + let mut o = String::new(); + o.push_str("# Zsh plugins: reviewed, scoped testing keywords (GURU ships these as ~amd64).\n"); + o.push_str("app-shells/zsh-completions\n"); + o.push_str("app-shells/zsh-autosuggestions\n"); + o.push_str("app-shells/zsh-syntax-highlighting\n"); + o +} + pub const BINHOST_OPENRC: &str = "https://distfiles.gentoo.org/releases/amd64/binpackages/23.0/x86-64"; pub const BINHOST_HARDENED: &str = @@ -2532,6 +2549,21 @@ mod tests { assert!(repos.contains("anongit.gentoo.org")); } + #[test] + fn shell_keywords_are_scoped_not_global() { + let text = accept_keywords_shell(); + for atom in [ + "app-shells/zsh-completions", + "app-shells/zsh-autosuggestions", + "app-shells/zsh-syntax-highlighting", + ] { + assert!(text.contains(atom), "missing {atom}"); + } + assert!(!text.contains("*/*")); + assert!(!text.lines().any(|l| l.trim() == "~amd64")); + assert!(!text.contains("ACCEPT_KEYWORDS")); + } + #[test] fn mango_session_contract() { let script = PHOEBUS_MANGO_SESSION_SCRIPT; diff --git a/installer-rs/crates/phoebus-executor/src/portage.rs b/installer-rs/crates/phoebus-executor/src/portage.rs index ea67503..b815303 100644 --- a/installer-rs/crates/phoebus-executor/src/portage.rs +++ b/installer-rs/crates/phoebus-executor/src/portage.rs @@ -41,6 +41,11 @@ pub fn write_config(exec: &Exec, config: &InstallConfig, hardware: &HardwareRepo )?; keywords.push('\n'); keywords.push_str(&sysgen::accept_keywords_mango()); + // The login shell is a base package (validated by `users_configure` + // before the desktop stage); its GURU plugins need the same scoped + // keywords in the same condition. + keywords.push('\n'); + keywords.push_str(&sysgen::accept_keywords_shell()); } // Brave (stable only) via another-brave-overlay, scoped so unrelated // packages cannot override Gentoo. The pin is written into the conf