Overall I'm a fan of this proposal. It is a great replacement for the current env var based hacks.
Just putting my two cents: Given that it's not clear which traits are enabled through the unification process in the whole graph for an executable target author, it would be a nice bonus if we provide a way to show such information.
For example, how about accepting --traits
option in swift package show-dependencies
as well and show enabled traits per package after the unification process. e.g.:
$ swift package show-dependencies --traits traitX
.
├── swift-argument-parser<https://github.com/apple/swift-argument-parser@1.3.0> (traits: default,traitX)
└── swift-system<https://github.com/apple/swift-system@1.3.2>
It's not a modification but a purely additive functionality, so it's ok to say it's out of the scope of this proposal.