Skip to content

Load machine defaults from the daemon's configuration roots - #2547

Open
vincent-peng wants to merge 1 commit into
apple:mainfrom
vincent-peng:fix-machine-config-roots
Open

vincent-peng wants to merge 1 commit into
apple:mainfrom
vincent-peng:fix-machine-config-roots

Conversation

@vincent-peng

Copy link
Copy Markdown
Contributor

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

When the CLI and running daemon resolve different configuration roots, machine create can use the CLI's CPU, memory and home-mount defaults. Load configuration through ClientHealthCheck.loadContainerSystemConfig() so creation uses the daemon's app and installation roots. Explicit command-line flags retain precedence.

This addresses the MachineCreate follow-up identified in #2451. Add a CLI integration test with conflicting client roots that checks daemon defaults and explicit flag overrides without changing shared daemon configuration.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

Built all test products with swift build --build-tests --jobs 6 -Xswiftc -warnings-as-errors -Xswiftc -enable-testing.

With isolated services, the new regression fails all three default-value assertions on unchanged main and passes with this change. The focused CLI run passes all 5 tests:

swift test --skip-build --filter 'TestCLIMachineCommand/(testCreate\(\)|testCreateUsesDaemonConfiguration|testCreateRejectsDots|testCreateNameLongerThanMax|testCreateRejectsNonNumericUserGroup)' --experimental-maximum-parallelization-width 1

The 41 tests selected by MachineConfigTests|ConfigurationLoaderTests|HelpCommandTests also pass. Swift formatting checks pass. Tested on Apple Silicon, macOS 27.2.1, Swift 6.4.2. The selected machine tests use --no-boot; the full VM integration suite was not run locally.

@vincent-peng
vincent-peng marked this pull request as ready for review November 21, 2026 00:32

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant