<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><br><div><br>On 6 Jan 2018, at 02:10, Daniel Dunbar via swift-build-dev <<a href="mailto:swift-build-dev@swift.org">swift-build-dev@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 5, 2018, at 1:00 PM, Ankit Agarwal <<a href="mailto:ankit@ankit.im" class="">ankit@ankit.im</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Fri, Jan 5, 2018 at 12:23 PM, Daniel Dunbar via swift-build-dev<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:swift-build-dev@swift.org" target="_blank" class="">swift-build-dev@swift.org</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-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word; line-break: after-white-space;" class="">I have recently been building up some relatively large package trees (for example, porting Boost to build with SwiftPM).<div class=""><br class=""></div><div class="">The way I do this is that locally I use remote URLs which are relative to the source package. This lets me iterate very quickly without needing to push to an origin. Of course, it doesn’t work when pushing them to an actual SCM server.</div><div class=""><br class=""></div><div class="">However, what if we allowed relative-path URLs to be resolved relative to the<span class="Apple-converted-space"> </span><b class="">origin</b> from which SwiftPM found them? Concretely:</div><div class=""><br class=""></div><div class="">If I have:</div><div class=""> <span class="Apple-converted-space"> </span><a href="http://github.com/ddunbar/foo" target="_blank" class="">github.com/ddunbar/foo</a></div><div class="">and it’s Package.swift has:</div><div class=""> dependencies: [.package(url: “../bar”, …)]</div><div class="">then the idea is to make SwiftPM resolve ../bar to be<span class="Apple-converted-space"> </span><a href="http://github.com/dunbar/bar" target="_blank" class="">github.com/dunbar/bar</a>, which happens to be exactly what I want.</div><div class=""><br class=""></div></div></blockquote><div class=""><br class=""></div><div class="">On top of my head, this could break in these cases:</div><div class="">1. I fork foo but not bar and now I can't build foo.</div></div></div></blockquote><div><br class=""></div>Yup. This is the flip side of the situation where you want to mirror a tree, when you actively want to only pull one part of a tree its more work. I don’t know which is more common and worth optimizing for.</div></div></blockquote><div><br></div><div>This seems like a very common situation. I fork many libraries to make modifications and open pull requests. I would be very surprised if the very act of forking broke my ability to build with SwiftPM.</div><br><blockquote type="cite"><div><div><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="">2. I "download" foo and have no origin/SCM.</div></div></div></blockquote><div><br class=""></div>I’m not sure how often this happens. That feels like it might be specific to particular projects (ones that distribute source tarballs, e.g.), and they could just choose not to use the feature.</div></div></blockquote><div><br></div><div>This is also very common IMHO. If I want to quickly test a new library, I don’t go through the trouble of cloning the repo: I simple use the button on GitHub to download the latest version of master and test the library from my downloaded folder. I do this because many libraries (on iOS) come with example executable that demo the library functionality.</div><br><blockquote type="cite"><div><div><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><br class=""></div><div class="">Maybe we should require a fallback base URL?</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word; line-break: after-white-space;" class=""><div class=""></div><div class="">This even works for absolute path URLs, the other URL components would come from the origin, so I could also reference:</div><div class=""> <span class="Apple-converted-space"> </span>dependencies: [.package(url: “/apple/swift-package-manager”<wbr class="">)]</div><div class="">if I wanted to depend on SwiftPM.</div></div></blockquote><div class=""><br class=""></div><div class="">I don't think I understand how would this work. We have no way of computing the canonical path using the origin in this case.</div></div></div></blockquote><div><br class=""></div>I don’t follow. This is the same as the other case, it only works if we do have an origin URL.</div><div><br class=""></div><div> - Daniel</div><div><br class=""></div><div><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word; line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">One really nice thing about this scheme is that it simplifies mirroring of trees of packages. For example, if I wanted to clone the above examples onto, say, an enterprise SCM server, then as long as I cloned all of them into the same relative organization, I wouldn’t need to rewrite any of the URL references in the packages themselves during the clone.</div><div class=""><br class=""></div><div class="">Thoughts?</div><span class="HOEnZb"><font color="#888888" class=""><div class=""><div class=""> - Daniel</div></div></font></span></div><br class="">______________________________<wbr class="">_________________<br class="">swift-build-dev mailing list<br class=""><a href="mailto:swift-build-dev@swift.org" 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/<wbr class="">mailman/listinfo/swift-build-<wbr class="">dev</a><br class=""><br class=""></blockquote></div><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br clear="all" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; 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-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_signature" data-smartmail="gmail_signature" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Ankit</div></div></blockquote></div><br class=""></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-build-dev mailing list</span><br><span><a href="mailto:swift-build-dev@swift.org">swift-build-dev@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-build-dev">https://lists.swift.org/mailman/listinfo/swift-build-dev</a></span><br></div></blockquote></body></html>