apple/container

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

Open

#608 aperta il 13 set 2025

Vedi su GitHub
 (0 commenti) (0 reazioni) (1 assegnatario)Swift (752 fork)batch import
help wantednextux

Metriche repository

Star
 (26.498 star)
Metriche merge PR
 (Merge medio 3g 12h) (70 PR mergiate in 30 g)

Descrizione

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

Guida contributor