tests' started at 2025-01-11 10:32:02.229. Test Suite 'All tests' passed at 2025-01-11 10:32:02.230. Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.001) seconds ◇ Test run started. ↳ Testing Library Version: 6.1 (a9f21aa1a8cd486) ↳ Target Platform: arm64-apple-macosx ◇ Test example() started. ✔ Test example() passed after 0.001 seconds. ✔ Test run with 1 test passed after 0.001 seconds. 11
Suite 'All tests' started at 2025-01-11 10:32:24.621. Test Suite 'All tests' passed at 2025-01-11 10:32:24.622. Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.001) seconds ◇ Test run started. ↳ Testing Library Version: 6.1 (a9f21aa1a8cd486) ↳ Target Platform: arm64-apple-macosx ◇ Test example() started. Foo is enabled: using Collections' OrderedSet OrderedSet: ["Foo", "Bar", "Baz"] ✔ Test example() passed after 0.001 seconds. ✔ Test run with 1 test passed after 0.001 seconds. 12
Suite 'All tests' started at 2025-01-11 10:32:41.077. Test Suite 'All tests' passed at 2025-01-11 10:32:41.078. Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.001) seconds ◇ Test run started. ↳ Testing Library Version: 6.1 (a9f21aa1a8cd486) ↳ Target Platform: arm64-apple-macosx ◇ Test example() started. Bar is enabled: using Numerics' Complex Complex: (1.0, 1.0) ✔ Test example() passed after 0.001 seconds. ✔ Test run with 1 test passed after 0.001 seconds. 13
Suite 'All tests' started at 2025-01-11 10:32:54.602. Test Suite 'All tests' passed at 2025-01-11 10:32:54.603. Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.001) seconds ◇ Test run started. ↳ Testing Library Version: 6.1 (a9f21aa1a8cd486) ↳ Target Platform: arm64-apple-macosx ◇ Test example() started. Foo is enabled: using Collections' OrderedSet OrderedSet: ["Foo", "Bar", "Baz"] Bar is enabled: using Numerics' Complex Complex: (1.0, 1.0) FooBar is enabled ✔ Test example() passed after 0.001 seconds. ✔ Test run with 1 test passed after 0.001 seconds. 14
resolved/checkout even if some dependencies are not used for enabled traits • This is listed in Future directions of the proposal: Consider traits during dependency resolution The implementation to this proposal only considers traits after the dependency resolution when constructing the module graph. This is inline with how platform specific dependencies are currently handled. In the future, both platform specific dependencies and traits can be taken into consideration during dependency resolution to avoid fetching an optional dependency that is not enabled by a trait. Changing this doesn't require a Swift evolution proposal since it is just an implementation detail of how dependency resolution currently works. 18
of packages are using environment variables in their Package.swift to configure their package. This has various reasons such as optional dependencies or setting certain defines for local development. Using environment variables inside Package.swift is not officially supported and with stricter sandboxing rules might break in the future. For example: • https://github.com/firebase/firebase-ios-sdk/blob/52d9152e5ac3ae6d2fefc872a3a6c1697d26d3e7/ Package.swift#L1328-L1558 • https://github.com/groue/GRDB.swift/blob/3ecb5c54553559217592d21a6d9841becb891b38/ Package.swift#L13-L28 20
functionality without yet committing to a stable public API Currently, those modules and APIs are often underscored or specifically annotated. While this approach works it comes with downsides such as hiding the APIs in code completion. 21
6.1 / Xcode 16.3 • Xcode 16.3 may have traits specification GUI on Package Dependencies? • Packages can define traits and use them for conditional dependencies and conditional compilation • Can customize traits of its dependencies unconditionally, or conditionally depending of their own traits • Consumers can use default traits, disable default traits, or enable specific traits • swift build/run/test commands now accepts trait-related options • --traits Trait1,Trait2 • --enable-all-traits • --disable-default-traits 22