Skip to content

chore: simplify loading of Mac-specific logic in config_loader#8248

Merged
bolinfest merged 1 commit intomainfrom
pr8248
Dec 18, 2025
Merged

chore: simplify loading of Mac-specific logic in config_loader#8248
bolinfest merged 1 commit intomainfrom
pr8248

Conversation

@bolinfest
Copy link
Collaborator

@bolinfest bolinfest commented Dec 18, 2025

Over in config_loader/macos.rs, we were doing this complicated mod thing to expose one version of load_managed_admin_config_layer() for Mac:

#[cfg(target_os = "macos")]
mod native {

While exposing a trivial implementation for non-Mac:

#[cfg(target_os = "macos")]
pub(crate) use native::load_managed_admin_config_layer;
#[cfg(not(target_os = "macos"))]
pub(crate) async fn load_managed_admin_config_layer(
_override_base64: Option<&str>,
) -> io::Result<Option<TomlValue>> {
Ok(None)

That was being used like this:

#[cfg(not(target_os = "macos"))]
let managed_preferences = load_managed_admin_config_layer(None).await?;

This PR simplifies that callsite in layer_io.rs to just be:

    #[cfg(not(target_os = "macos"))]
    let managed_preferences = None;

And updates config_loader/mod.rs so we only pull in macos.rs on Mac:

#[cfg(target_os = "macos")]
mod macos;

This simplifies macos.rs considerably, though it looks like a big change because everything gets unindented and reformatted because we can drop the whole mod native thing now.


Stack created with Sapling. Best reviewed with ReviewStack.

@jif-oai
Copy link
Collaborator

jif-oai commented Dec 18, 2025

@codex review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Another round soon, please!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@bolinfest bolinfest merged commit 9bf41e9 into main Dec 18, 2025
52 checks passed
@bolinfest bolinfest deleted the pr8248 branch December 18, 2025 15:35
@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants