[swift-build-dev] Customizing location of source directory

Drew Crawford drew at sealedabstract.com
Sun Dec 27 22:52:27 CST 2015


I've been doing some dev in my tree.  I don't know if this is the "recommended workflow" for OSX but it works for me.

1.  Install binary snapshot from Swift.org
2.  Checkout swiftpm source
3.  cd /path/to/swiftpm
4.  ./Utilities/bootstrap --swiftc /Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/swiftc --sbt /Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/swift-build-tool --build-tests test

That builds and runs the tests.  The bootstrap script is the preferred build system at present AFAIK, since

1.  While swiftpm self-hosts, it can't be turtles all the way down
2.  swiftpm can't self-host its own tests; there is an ongoing proposal about this in this list.  So, if you want to run tests (spoiler alert: you do) the bootstrap script is critical.

Questions I have not researched in any detail:

1.  Whether building from inside Xcode is possible and/or simple
2.  Whether Xcode autocomplete can be made to work

I would file a motion to get a "so, you want a development workflow for this project" kind of guide in Documentation/Internals, and the information above is probably 70% complete for OSX, but some resolution on the questions I don't know the answer to would improve it.



> On Dec 27, 2015, at 5:37 PM, Misha Manulis via swift-build-dev <swift-build-dev at swift.org> wrote:
> 
> Hi Max,
> 
> Question on compiling.  So far, I've been using my local install of Swift, that comes with XCode.
> 
> The instructions in the README suggest using the latest master for Swift itself and building package manager as part of that.  I haven't been able to find instructions for how to compile package manager as part of Swift though.
> 
> I've set up the XCode project, but I can't find any CLI switches or docs on enabling building other components.  Is documented somewhere or can someone provide basic instructions and I'm happy to write up a How-To doc.
> 
> Thank you
> 
> Misha Manulis
> 
> On Wed, Dec 23, 2015 at 9:03 AM, Max Howell <max.howell at apple.com <mailto:max.howell at apple.com>> wrote:
>> Hello,
>> 
>> I'm working on a patch to make the location of the sources configurable.
>> 
>> I'd like to separate the work out into two separate patches.  The first patch will allow changing the default path to a custom one.  The second patch will allow adding multiple source directories.
>> 
>> The reason for this is that there are existing packages that use Cocoapods or Carthage and have their source placed in various folders that are not named as the default ones in package manager.  For example, https://github.com/izqui/Taylor <https://github.com/izqui/Taylor>, is a small webserver package that placed it's sources in Taylor/ directory.
>> 
>> If I can pass in a custom sources location to the package manager, I can add support for this package quite easily.
>> 
>> I wanted to ask the group some questions about this effort:
>> 
>> First of, is this something that you would support?
> 
> Yes. I feel it is necessary.
> 
>> Second, looking at the code, its seems like the changes are needed only in the package manager, is that correct?
> 
> Indeed.
> 
>> Lastly, anything I should watch out for as I'm working through this?
> 
> Please just add tests and check they continue to run, otherwise I don’t think there are any gotchas.
> 
>> Thank you,
> 
> Thank *you*!
> 
> 
>  _______________________________________________
> swift-build-dev mailing list
> swift-build-dev at swift.org <mailto:swift-build-dev at swift.org>
> https://lists.swift.org/mailman/listinfo/swift-build-dev <https://lists.swift.org/mailman/listinfo/swift-build-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-build-dev/attachments/20151227/847838b0/attachment.html>


More information about the swift-build-dev mailing list