<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><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><br class=""><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><br class=""><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=""></body></html>