apple/container

[Request]: Use environment variables as system property source instead of UserDefaults.

Open

#608 aberto em 13 de set. de 2025

Ver no GitHub
 (0 comments) (0 reactions) (1 assignee)Swift (752 forks)batch import
help wantednextux

Métricas do repositório

Stars
 (26.498 stars)
Métricas de merge de PR
 (Mesclagem média 3d 12h) (70 fundiu PRs em 30d)

Description

Feature or enhancement request details

While UserDefaults are idiomatic for macOS, they apply globally to all sessions, and in some cases session-level control of a property may be desirable.

Environment variables are idiomatic for Unix/Linux developer tools and can apply globally (rc/profile files) and per session.

For this reason we should consider replacing UserDefaults with environment variables. While we could include both as property sources, it results in needless complexity and could create confusing scenarios.

We'd need to look at the variables we have and see which could be problematic if changed per session. Some variables are used only in helpers so the values they use would be established when the helper starts and immutable afterward (whereas a UserDefault could be updated while a helper runs).

It'd be great to get some opinions on this before proceeding. I was thinking that ideally we'd have a system for defining system properties, where each property is enumerable, generic, validated, type-safe, and defines a chain of command for its backing store.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Guia do colaborador