<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Ankit,<div class=""><br class=""></div><div class="">Thanks for starting work on this proposal, I agree this is a feature we sorely need. I think there are two problems this proposal is tackling, and it may be worth to call them out separately:</div><div class=""><br class=""></div><div class="">1. It may be necessary to point at an alternate "namespace" for pulling a dependency from (branch, etc.), because swiftpm support is not in the mainline.</div><div class=""><br class=""></div><div class="">2. It is useful when developing packages and hierarchies of packages to be able to point to non-tagged commits.</div><div class=""><br class=""></div><div class="">The reason I think it makes sense to separate these is that #1 is a problem which applies to all of the packages in a dependency tree. For example, some popular Swift projects may want to add support for swiftpm + Swift 2.2, but they can't put that into their mainline, or their mainline tags. One natural way to support that use case would be to have "namespace tags", like "swiftpm-1.2". That is something which deserves its own proposal, if anyone wants to tackle it.</div><div class=""><br class=""></div><div class="">For #2, I think we should encourage a usage model where the "Package.swift is the thing you should check in". We want to always encourage people to write manifests appropriate for sharing. The need to *override* the behavior strikes me as a mostly local issue, which should be addressed by a mechanism outside of the Package.swift.</div><div class=""><br class=""></div><div class="">Max and I just discussed this briefly, and came up with what I think is a pretty good strategy here:</div><div class=""><br class=""></div><div class="">1. Instead of tackling this problem in the manifest, start by coming up with a proposal for supporting "lock files". Something like:</div><div class=""> - Support a Packages.lock file in the root folder.</div><div class=""> - Define a simple syntax for associating package URLs with locked versions.</div><div class=""> - Implement package manager support for using that file.</div><div class=""><br class=""></div><div class="">Once that is in place, you will already be able to use that file to solve this particular problem (you can just edit the lock file to point at a branch or at a commit). We already know we need "lock file" support, so this is also handy in that it is solving this problem with a generally useful feature.</div><div class=""><br class=""></div><div class="">2. Max had a great suggestion for how "locking" should work:</div><div class=""> - "swift build --lock" (or however it is spelled) would simply create the .lock file based on the current state of your Packages tree.</div><div class=""><br class=""></div><div class="">This simple idea gives a great workflow for developing packages: you start by declaring your dependencies in your Package.swift, you use `swift build` to pull them down for you, then you start hacking on them (in your local checkout) to get the changes you need, iterating using `swift build --lock && swift build`, and then once you have something that works you can move to pushing those changes back and you already have the right .lock file</div><div class=""><br class=""></div><div class="">That is another feature to be proposed and implemented, but I think can be decoupled from the basic initial Packages.lock support.</div><div class=""><br class=""></div><div class="">What do you think?</div><div class=""><br class=""></div><div class=""> - Daniel</div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On Dec 15, 2015, at 6:09 AM, Ankit Agarwal via swift-build-dev <<a href="mailto:swift-build-dev@swift.org" class="">swift-build-dev@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">I think even the source URL will also work on tags </div><div class="gmail_extra" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""><div class="gmail_quote">On Tue, Dec 15, 2015 at 1:33 PM, Kostiantyn Koval<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:konstantin.koval1@gmail.com" target="_blank" class="">konstantin.koval1@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class="">There is a plan to add ability to support fetching packages by url for development purpose described here</div><div class="">Importing Dependencies by Source URL form "PackageManagerCommunityProposal" </div><div class=""><a href="https://github.com/apple/swift-package-manager/blob/master/Documentation/PackageManagerCommunityProposal.md#importing-dependencies-by-source-url" target="_blank" class="">https://github.com/apple/swift-package-manager/blob/master/Documentation/PackageManagerCommunityProposal.md#importing-dependencies-by-source-url</a></div><div class=""><span class="HOEnZb"><font color="#888888" class=""><div class=""><div class=""><div class=""><br class=""></div><div class="">Kostiantyn</div></div></div></font></span><div class=""><div class="h5"><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 14 Dec 2015, at 22:36, Kostiantyn Koval <<a href="mailto:konstantin.koval1@gmail.com" target="_blank" class="">konstantin.koval1@gmail.com</a>> wrote:</div><br class=""><div class=""><div style="word-wrap: break-word;" class=""><div class="">+1 for adding this.</div><div class=""><br class=""></div>Ability to point to commit instead of a tag is crucial. <div class="">Often happens that a bug was fixed in the depended library but it wasn't released/tagged.</div><div class="">As well it helps during development.</div><div class=""><br class=""></div><div class=""><div class=""><div class=""><div class=""><div class="">Kostiantyn</div></div></div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 14 Dec 2015, at 20:14, Marc Knaup via swift-build-dev <<a href="mailto:swift-build-dev@swift.org" target="_blank" class="">swift-build-dev@swift.org</a>> wrote:</div><br class=""><div class=""><p dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">+1 since I had to do exactly that a couple of times with CocoaPods.<br class="">There were issue in third party Pods which were fixed in a specific commit or branch but the official release would still take a while. Delaying our app release because of that was not an option and referring to a fixed yet unreleased version the best solution.<span class=""> </span></p><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">On Dec 14, 2015 8:04 PM, "Ankit Agarwal via swift-build-dev" <<a href="mailto:swift-build-dev@swift.org" target="_blank" class="">swift-build-dev@swift.org</a>> wrote:<br type="attribution" class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class="">Correcting one of the sentences in the Detailed design section</div><div class=""><br class=""></div><div class="">* If pointed to a branch, there might be two broad use cases</div><div class="">1. User wants to point a branch due to active development of that dep and wants latest ref available in that branch</div><div class="">2. User is actively developing a dep in that branch and want to test it out in the current package</div><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Dec 15, 2015 at 12:13 AM, Ankit Agarwal<span class=""> </span><span dir="ltr" class=""><<a href="mailto:ankit@ankit.im" target="_blank" class="">ankit@ankit.im</a>></span><span class=""> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class=""><br class=""></div><div class="">Hi,</div><div class=""><br class=""></div><div class="">Here is a proposal of the adding git branch support feature in SPM</div><div class=""><br class=""></div><div class=""><b class="">Introduction</b></div><div class=""><br class=""></div><div class="">Pointing to branch or a commit ref for dependencies in Package.swift as opposed to only a tagged release.</div><div class=""><br class=""></div><div class=""><b class="">Motivation</b></div><div class=""><br class=""></div><div class="">* Try a package which is almost stable or useable but not yet ready for a release/pre-release so not tagged (eg: new feature being introduced by a library)</div><div class="">* While developing packages, one would want to point a package that uses the package to a develop branch (eg: Developing Foo package, Bar uses Foo and wants to point Foo dep to develop branch)</div><div class="">* One would want to point to his own fork but not create a release while developing/testing (eg: Fork a library not compatible with SPM to make it compatible)</div><div class="">* One wants to point to some commit but doesn't have a branch/tag created for that</div><div class=""><br class=""></div><div class=""><b class="">Proposed solution</b></div><div class=""><br class=""></div><div class="">Allow refs and branch in Package.swift</div><div class=""><br class=""></div><div class="">let package = Package(</div><div class=""> <span class=""> </span>name: "Hello",</div><div class=""> <span class=""> </span>dependencies: [</div><div class=""> <span class=""> </span>.Package(url: "ssh://<a href="http://git@example.com/Greeter.git" target="_blank" class="">git@example.com/Greeter.git</a>", branch: "develop", shouldFastForward: true),</div><div class=""> <span class=""> </span>.Package(url: "ssh://<a href="http://git@example.com/FooBar.git" target="_blank" class="">git@example.com/FooBar.git</a>", commit: "d8ec7ca398a3ac3990477028117384d05ca7734e"),</div><div class=""> <span class=""> </span>]</div><div class="">)</div><div class=""><br class=""></div><div class=""><b class="">Detailed design</b></div><div class=""><br class=""></div><div class="">* Only the root Package.swift would be able to use branch/ref feature to avoid dependency hell, any other dependency fetched in current Package should not compile if that dependency contains another dependency pointing to a branch/ref</div><div class="">* This feature should strictly be used for testing/developing purpose and should not be deployed to production environments</div><div class=""><br class=""></div><div class="">SPM could have the following behavior when running `swift build` :</div><div class=""><br class=""></div><div class="">* If pointed to a branch, there might be two use cases </div><div class="">Since there is a high probability that user wants to point a branch due to active development of that dep and wants latest ref available in that branch</div><div class="">If a dependency is not cloned, clone it and checkout that branch</div><div class="">If shouldFastForward is on -> Always try to be on the latest ref, disregard any local changes made to the checked out package</div><div class="">If shouldFastForward is false -> Always try to be on the latest ref unless any local changes made to the checked out package</div><div class=""><br class=""></div><div class="">* If pointed to a ref : </div><div class="">If that dependency is not cloned, clone it and checkout that ref.</div><div class="">Consecutive `swift build` will not affect the cloned package</div><div class="">If changes are made in the cloned repo, rebuild that package with those changes</div><div class=""><br class=""></div><div class=""><b class="">Impact on existing code</b></div><div class=""><br class=""></div><div class="">None as this will be a new functionality</div><div class=""><br class=""></div><div class=""><b class="">Alternatives considered</b></div><div class=""><br class=""></div><div class="">One option is to only allow a commit ref and not a branch so SPM will not have to worry about fast forwarding but this is a desired feature.</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Dec 8, 2015 at 4:24 AM, Rick Ballard<span class=""> </span><span dir="ltr" class=""><<a href="mailto:rballard@apple.com" target="_blank" class="">rballard@apple.com</a>></span><span class=""> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><span class="">> On Dec 5, 2015, at 5:59 AM, Ankit Agarwal <<a href="mailto:ankit@ankit.im" target="_blank" class="">ankit@ankit.im</a>> wrote:<br class="">><br class="">> Hi,<br class="">><br class="">> Is pointing to a branch instead of version for a package in scope of SPM?<br class="">> if it is, I'd love to try to implement it<br class=""><br class=""></span>Hi Ankit,<br class=""><br class="">This is in scope, though not yet designed. Prior to anyone working on an implementation, we should agree on a design for how you'd do this. While this isn't at the top of our priority list at the moment, we'd welcome both design contributions and eventual implementation.<br class=""><br class="">If you'd like to put a proposal together for this, please see the Swift evolution process at<span class=""> </span><a href="https://github.com/apple/swift-evolution/blob/master/process.md" rel="noreferrer" target="_blank" class="">https://github.com/apple/swift-evolution/blob/master/process.md</a>. We'd be happy to discuss this here as part of your process for putting a proposal together. Some things to think about in this area are:<br class=""><br class="">– How should refs (branches or tags) that aren't simple version numbers be specified?<br class=""><br class="">– Right now we require you to tag something as a versioned "release". Should we require that you tag a branch before someone can make a package depend on it? It could be convenient to be able to just depend on a branch, but the meaning of depending on a branch changes over time as more commits come in. Is it harmful to allow packages to depend on something that's not an identified commit?<br class=""><br class=""> <span class=""> </span>– Note that we have yet to design our security story (<a href="https://github.com/apple/swift-package-manager/blob/master/Documentation/PackageManagerCommunityProposal.md#security-and-signing" rel="noreferrer" target="_blank" class="">https://github.com/apple/swift-package-manager/blob/master/Documentation/PackageManagerCommunityProposal.md#security-and-signing</a>); what we settle on there might require dependencies to be specified as a specific tagged commit, so that it can be signed.<br class=""><br class="">– Should it be possible to override a package's dependency to use a different branch, without having to modify and commit a change to that package's Package.swift?<br class=""><br class="">– We may want to design a way for packages to support different versions of the Swift language, as the language continues to change – e.g. a branch of the package for the last released swift vs the current under development swift snapshot. Is supporting dependencies on package branches a part of how we'll do that?<br class=""><br class="">Thanks,<br class=""><br class=""> <span class=""> </span>- Rick<br class=""><br class=""><span class=""><font color="#888888" class=""></font></span></blockquote></div><span class=""><font color="#888888" class=""><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class=""> </span><br class=""><div class="">Ankit<br class=""><br class=""></div></font></span></div></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class=""> </span><br class=""><div class="">Ankit<br class=""><br class=""></div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=6ZGE61OxINd5lLe2xYh9Ku-2BXbixWNr2nvfzp2IB1sZitVEVOLMb3PkOgG1oZLriinC-2FhjxzCJITVIxLERxmQg9GykePbiPlZ-2B6zOplZh-2BPGWS-2BgsCVN3Gu5wBtRYUFte73OobYkI8ehlI2z5kWfJRDEEI6SdysmehMyAnR3lsQ16729oOKy-2FUKXtBMRU5ITlM8QMd-2Fn-2Fi47oO2o1t7dhfG7SaMCEoAD7K1rzQQnU2Js-3D" alt="" width="1" height="1" border="0" style="min-height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span class=""> </span><br class="">_______________________________________________<br class="">swift-build-dev mailing list<br class=""><a href="mailto:swift-build-dev@swift.org" target="_blank" class="">swift-build-dev@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-build-dev" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-build-dev</a><br class=""><br class=""></blockquote></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=n3jPUXkT5YFxadHQEoaOww8U5ADISS-2FbZlg0rksvZj78wabIoZVrI-2FgONKOZ7HZugOnFJCUauHc2MU6Fiofd-2BtS9Lxq4mTyiXjcTLjyIZBXTLahqTlU3WlQfewKvoBu3pEZ0x6-2BpmPgPf6bcemqi3ZRi-2BgiXfU4dtVUT-2FdceRVxq1A0Si09YAAWXMu3NKKM5CbFrvYBu-2BBlqzUt0Ob-2FmLVmrTqGkqPPvimCHrscYiTo-3D" alt="" width="1" height="1" border="0" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; min-height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline !important;" class=""><span class=""> </span>_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline !important;" class="">swift-build-dev mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><a href="mailto:swift-build-dev@swift.org" target="_blank" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">swift-build-dev@swift.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-build-dev" target="_blank" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-build-dev</a></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div class="gmail_signature">Ankit<br class=""><br class=""></div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=AdkfTiApI80cNEyortTzHbERtY5det-2FDBvSxuhs4q2MkkkOxUeEihDWY84lUjZkjNedkB65lCWuzwHo0KYUsFvr5IQ-2BteNQim5ECXB-2Bf0JM9mGm0tRs6aa-2FWDckQlASW68wfHXG8WFaPIQ6W-2FcFiXP5XLRiGuQMrM8lk0d-2BDRYsQMn0RisefOrRtCJaqX60F9rxvuK6uQjSIvyjvLvKY5c9Tp27mLrGXD1B5yuzxAVU-3D" alt="" width="1" height="1" border="0" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><span class="Apple-converted-space"> </span>_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">swift-build-dev mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:swift-build-dev@swift.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-build-dev@swift.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-build-dev" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-build-dev</a></div></blockquote></div><br class=""></div></body></html>