Package Manager Conditional Target Dependencies

:partying_face: Yeah, so after you do that, "it just works".

Thanks a lot :slight_smile:

Cool.

I’ve recently been helping a developer who’s shipping a custom toolchain (s. 723651342), so I’ve spent a bunch of time looking into this. The issue here is that Xcode toolchains kinda look like a bundle but aren’t really, and that causes them to slip through a crack between Gatekeeper and the notary service. This is something that Apple needs to investigate (I don’t yet have a bug number because I only just asked the developer to file one).

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple

1 Like

Just to clarify — this will not allow me to declare an entire dependency only for debug, correct?

(I'm +1 either way, as I think it'll be useful)

Correct. You can't directly declare a dependency only for debug: it will just indirectly only be for debug if it is only depended on by targets with a conditional configuration of Debug.

Which only means nothing from it will be built when you do swift build --configuration debug.

Such a dependency will still be fetched and still participate in the resolution of the package graph; all its own version constraints will still be relevant. This is important so that Package.resolved plays nice, and so you cannot accidentally end up with a package graph that works in debug but is unsolvable in release.

2 Likes
Terms of Service

Privacy Policy

Cookie Policy