[swift-build-dev] Test-only dependencies

Paul Cantrell cantrell at pobox.com
Tue Sep 6 22:13:02 CDT 2016


[resend; forgot to copy list]

> On Sep 6, 2016, at 4:27 PM, Daniel Dunbar <daniel_dunbar at apple.com <mailto:daniel_dunbar at apple.com>> wrote:
> 
>> 
>> On Sep 6, 2016, at 1:36 PM, Paul Cantrell <cantrell at pobox.com <mailto:cantrell at pobox.com>> wrote:
>> 
>>> 
>>> On Aug 29, 2016, at 11:10 AM, Daniel Dunbar <daniel_dunbar at apple.com <mailto:daniel_dunbar at apple.com>> wrote:
>>> 
>>>> 
>>>> On Aug 29, 2016, at 9:00 AM, Paul Cantrell <cantrell at pobox.com <mailto:cantrell at pobox.com>> wrote:
>>>> 
>>>>> On Aug 29, 2016, at 12:07 AM, Daniel Dunbar <daniel_dunbar at apple.com <mailto:daniel_dunbar at apple.com>> wrote:
>>>>> 
>>>>> I completely agree with your original email, and agree the target-access control proposal amounts to a variant of #2.
>>>>> 
>>>>> We definitely need a per-target dependency solution, and if we got one that included some kind of solution for managing the duplicate declaration, that would solve the con you list with #2. That might suggest that one approach here is to add it the list of reasons we should do a per-target dependency proposal.
>>>>> 
>>>>>>>>>> 
>>>>> My leaning here is towards trying to figure out a good approach for #2 first, and see where that leaves us
>>>> 
>>>> I’m not up on all the discussion, but that certainly seems to me like the right direction.
>> 
>> One way to remove the redundant declarations from #2:
>> 
>> (1) Allow virtual targets that have no corresponding source directory, but declare external dependencies.
>> 
>> (2) Allow other targets to depend on virtual targets.
> 
> This works, but would it be obvious to newcomers? It feels more like a hack rather than something we would explicitly want to be the definitive model for solving the sharing problem.
> 
> I do think that allowing such kinds of targets is something that may make sense, I'm just not sure it is the right answer to the redundant declaration.

It feels like the a natural solution to me. I mean, it is the first one that came to mind….

In particular, this syntax, likely to be copied around and posted on Stack Overflow more than once, strikes me as reasonably self-explanatory even if you don’t know how it generalizes to arbitrary virtual targets:

    targets: [
      Target(
        name: "Tests”,
        dependencies: [
          .Package(url: "https://github.com/Quick/Quick <https://github.com/Quick/Quick>", majorVersion: 0)
        ])
    ],

One small thing that might help with newcomer friendliness: allow (or require?) virtual targets to have a “group” arg instead of “name:”

    targets: [
      Target(
        group: "Tests”,
        dependencies: [
          .Package(url: "https://github.com/Quick/Quick <https://github.com/Quick/Quick>", majorVersion: 0)
        ])
    ],

That does feel a bit hackish to me, though. I’d rather the package manifest have as few constructs and as few twists as possible.

Cheers, P

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-build-dev/attachments/20160906/28c9a769/attachment.html>


More information about the swift-build-dev mailing list