Skip to content

expand the information provided by swift package show-dependencies to include traits #9033

@heckj

Description

@heckj

Description

Noting this down as a feature request - and following up/re-iterating a request in the Swift Forums:

Right now it's hard to determine what features are exposed (and enabled) by dependencies you're using other than inspecting the relevant Package.swift.

It would be really useful to be able to get this information from swift package show-dependencies. The suggestion in the Swift forums post was to extend the information returned, and offer a --traits option on the show-dependencies command to allow you to specify an additional trait that's exposed to you:

$ 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>

Expected behavior

show-dependencies shows what traits are enabled for any dependencies that offer them, and have a default set enabled.
show-dependencies shows traits and dependencies included when you provide/activate a trait that the local package exposes.

Actual behavior

No traits information is exposed

Steps to reproduce

No response

Swift Package Manager version/commit hash

b6a3d95 (swift-DEVELOPMENT-SNAPSHOT-2025-08-14-a)

Swift & OS version (output of swift --version && uname -a)

swift-driver version: 1.127.11.2 Apple Swift version 6.2 (swiftlang-6.2.0.16.14 clang-1700.3.16.4)
Target: arm64-apple-macosx15.0
Darwin Joes-MacBook-Pro-3.local 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041 arm64

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions