<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 14, 2016, at 10:13 AM, orta therox &lt;<a href="mailto:orta.therox@gmail.com" class="">orta.therox@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Afraid it doesn’t convince me. Even if you have an index that has strict semver adherence, the idea that you can trust people / machines to actually understand whether something will break other people's build seems unreasonable. Updates to code ships bugs. Updates you don’t expect gives you bugs you didn’t expect</div></div></blockquote><div><br class=""></div>Updates you don't expect can also fix bugs you didn't find (or found but hadn't diagnosed). I'm not sure it is a one way street.</div><div><br class=""></div><div>I completely agree with you here though, you can't trust the tooling. However, we also have the ability to test things via running actual tests against downstream dependencies. The combination of those two may be quite powerful, even if the latter is naturally resource constrained.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class="">Alexis hits it on the head with the differentiation between a library and an app - libraries should define their own supported ranges, and they require far less locking than applications. An application should always have a lock so you have determinate builds and can update dependencies on purpose.</div></div></div></div></blockquote><div><br class=""></div>Yup, we agree here. I'll reply to this on Alexis's post.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><div class="">&gt; We generally agree that when you are simply the consumer of packages, pinning makes sense.</div><div class=""><br class=""></div><div class="">Isn’t this going to be the majority of the behaviour for the tool on the long run? So I would expect that to be where locking happens.</div></div></div></div></div></blockquote><div><br class=""></div>I don't think so.</div><div><br class=""></div><div>Consider the Xcode use case, for example: we are not actively planning on adding support for all the myriad kinds of top-level targets and app needs, so the packages used in that context will by nature be a package which was shared.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><div class="">Sidenote: FWIW not a fan of the name change from lockfile - it feels arbitrary, but I figured the change to a separate command was a bigger elephant in the room.</div></div></div></div></div></blockquote><div><br class=""></div>I agree keeping them in separate threads is handy. I'll reply to this on Max's post.</div><div><br class=""></div><div>&nbsp;- Daniel</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><div class="">
<div style="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; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; orphans: 2; widows: 2; font-size: 13px; margin: 0px;" class=""><span style="text-align: -webkit-auto;" class=""><br class="Apple-interchange-newline">--&nbsp;</span></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; orphans: 2; widows: 2; margin: 0px; color: rgb(35, 35, 35); min-height: 14px;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; color: rgb(35, 35, 35);" class=""><br class=""></div><div style="margin: 0px; color: rgb(35, 35, 35);" class="">[A.]<span class="Apple-tab-span" style="white-space: pre;">        </span>&nbsp; &nbsp;&nbsp;Orta Therox</div><div style="margin: 0px; color: rgb(35, 35, 35); min-height: 14px;" class=""><br class=""></div></div></div><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; color: rgb(35, 35, 35); min-height: 14px;" class=""><blockquote type="cite" style="background-color: rgb(255, 255, 255); border-left-color: rgb(0, 33, 98); color: rgb(0, 33, 98); border-width: 1px; margin-left: 0px; padding-left: 10px; padding-right: 0px; margin-right: 0px;" class=""><span style="border-collapse: collapse; color: rgb(34, 34, 34);" class=""><div style="margin: 0px;" class=""><span style="color: rgb(136, 136, 136);" class="">w/&nbsp;</span><a href="http://artsy.net/" class="">Artsy</a></div></span></blockquote><blockquote type="cite" style="background-color: rgb(255, 255, 255); border-left-color: rgb(0, 33, 98); color: rgb(0, 33, 98); border-width: 1px; margin-left: 0px; padding-left: 10px; padding-right: 0px; margin-right: 0px;" class=""><span style="border-collapse: collapse; color: rgb(34, 34, 34);" class=""><div style="margin: 0px;" class=""><a href="http://cocoapods.org/" class="">CocoaPods</a>&nbsp;/&nbsp;<a href="http://cocoadocs.org/" class="">CocoaDocs</a><span style="text-align: -webkit-auto;" class="">&nbsp;/&nbsp;</span><a href="https://itunes.apple.com/us/app/gifs/id961850017?l=en&amp;mt=12" style="text-align: -webkit-auto;" class="">GIFs.app</a></div></span></blockquote></div></div></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; color: rgb(35, 35, 35); min-height: 14px;" class=""><blockquote type="cite" style="background-color: rgb(255, 255, 255); border-left-color: rgb(0, 33, 98); color: rgb(0, 33, 98); border-width: 1px; margin-left: 0px; padding-left: 10px; padding-right: 0px; margin-right: 0px;" class=""><span style="border-collapse: collapse; color: rgb(34, 34, 34);" class=""><div style="margin: 0px;" class=""><a href="http://twitter.com/orta" class="">@orta</a>&nbsp;/&nbsp;<a href="http://orta.github.com/" class="">orta.github.com</a></div></span></blockquote></div></div></div></blockquote></div></div>
</div>
<br class=""><div class=""><blockquote type="cite" class=""><div class="">On 14 Oct 2016, at 17:43, Daniel Dunbar &lt;<a href="mailto:daniel_dunbar@apple.com" class="">daniel_dunbar@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Can you check my reply to Eloy and see how it weighs with you?<div class=""><br class=""></div><div class="">&nbsp;- Daniel</div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Oct 14, 2016, at 9:33 AM, Max Desiatov via swift-build-dev &lt;<a href="mailto:swift-build-dev@swift.org" class="">swift-build-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I also strongly agree with this, I'd prefer version pinning to happen by default, rather than with explicit command as it will make builds reproducible by default.&nbsp;<div class=""><br class=""></div><div class="">I totally agree that we can rely on past experience with other package managers (npm being the case), where pinning with a separate command caused more harm than good.</div><div class=""><br class=""></div><div class="">Overall, I think that it would be great if Package.lock was created by default when it's not present and be updated only with an explicit command for updating.</div><div class=""><br class=""></div><div class="">With best regards, Max.<br class=""><div class=""><br class=""></div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 14 Oct 2016, at 08:29, orta therox via swift-build-dev &lt;<a href="mailto:swift-build-dev@swift.org" class="">swift-build-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Please don’t make this a separate command, it should ideally be created at the end of an build (when there isn’t one already) or an update of your dependencies - most people will be expecting to get the same set of dependencies as the rest of their team. This pattern makes that harder.<div class=""><br class=""></div><div class="">NPM shrinkwrap is an example of this, and it’s a bad one - I’ve wasted a lot of time trying to keep that up to date for our npm projects. Facebook made a replacement for NPM with mainly the &nbsp;feature of “always locking” in&nbsp;<a href="https://yarnpkg.com/" class="">yarn</a>&nbsp;and I’d expect that to take a lot of the JS mindshare on this one feature alone.<div class=""><div class="">
<div style="font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; orphans: 2; widows: 2; font-size: 13px; margin: 0px;" class=""><span style="text-align: -webkit-auto;" class=""><br class="Apple-interchange-newline">--&nbsp;</span></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; orphans: 2; widows: 2; margin: 0px; color: rgb(35, 35, 35); min-height: 14px;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; color: rgb(35, 35, 35);" class=""><br class=""></div><div style="margin: 0px; color: rgb(35, 35, 35);" class="">[A.]<span class="Apple-tab-span" style="white-space: pre;">        </span>&nbsp; &nbsp;&nbsp;Orta Therox</div><div style="margin: 0px; color: rgb(35, 35, 35); min-height: 14px;" class=""><br class=""></div></div></div><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; color: rgb(35, 35, 35); min-height: 14px;" class=""><blockquote type="cite" style="background-color: rgb(255, 255, 255); border-left-color: rgb(0, 33, 98); color: rgb(0, 33, 98); border-width: 1px; margin-left: 0px; padding-left: 10px; padding-right: 0px; margin-right: 0px;" class=""><span style="border-collapse: collapse; color: rgb(34, 34, 34);" class=""><div style="margin: 0px;" class=""><span style="color: rgb(136, 136, 136);" class="">w/&nbsp;</span><a href="http://artsy.net/" class="">Artsy</a></div></span></blockquote><blockquote type="cite" style="background-color: rgb(255, 255, 255); border-left-color: rgb(0, 33, 98); color: rgb(0, 33, 98); border-width: 1px; margin-left: 0px; padding-left: 10px; padding-right: 0px; margin-right: 0px;" class=""><span style="border-collapse: collapse; color: rgb(34, 34, 34);" class=""><div style="margin: 0px;" class=""><a href="http://cocoapods.org/" class="">CocoaPods</a>&nbsp;/&nbsp;<a href="http://cocoadocs.org/" class="">CocoaDocs</a><span style="text-align: -webkit-auto;" class="">&nbsp;/&nbsp;</span><a href="https://itunes.apple.com/us/app/gifs/id961850017?l=en&amp;mt=12" style="text-align: -webkit-auto;" class="">GIFs.app</a></div></span></blockquote></div></div></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; color: rgb(35, 35, 35); min-height: 14px;" class=""><blockquote type="cite" style="background-color: rgb(255, 255, 255); border-left-color: rgb(0, 33, 98); color: rgb(0, 33, 98); border-width: 1px; margin-left: 0px; padding-left: 10px; padding-right: 0px; margin-right: 0px;" class=""><span style="border-collapse: collapse; color: rgb(34, 34, 34);" class=""><div style="margin: 0px;" class=""><a href="http://twitter.com/orta" class="">@orta</a>&nbsp;/&nbsp;<a href="http://orta.github.com/" class="">orta.github.com</a></div></span></blockquote></div></div></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; color: rgb(35, 35, 35); min-height: 14px;" class=""><blockquote type="cite" style="background-color: rgb(255, 255, 255); border-left-color: rgb(0, 33, 98); color: rgb(0, 33, 98); border-width: 1px; margin-left: 0px; padding-left: 10px; padding-right: 0px; margin-right: 0px;" class=""><span style="border-collapse: collapse; color: rgb(34, 34, 34);" class="">Artsy is totally hiring&nbsp;<a href="https://artsy.net/job/mobile-engineer" style="text-align: -webkit-auto;" class="">iOS Devs</a>&nbsp;ATM</span></blockquote></div></div></div></blockquote></div>
</div>
<br class=""><div class=""><blockquote type="cite" class=""><div class="">On 14 Oct 2016, at 07:01, Ankit Aggarwal via swift-build-dev &lt;<a href="mailto:swift-build-dev@swift.org" class="">swift-build-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">We're proposing version pinning feature in Swift Package Manager. The proposal is available&nbsp;<a href="https://github.com/aciidb0mb3r/swift-evolution/blob/version-pinning/proposals/NNNN-Version-Pinning.md" class="">here</a>&nbsp;and also in this email:</div><div class=""><br class=""></div><div class="">Feedback welcomed!</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Ankit</div><div class=""><br class=""></div><div class="">--------</div><div class=""><br class=""></div><div class=""><h1 id="toc_0" style="-webkit-print-color-adjust: exact; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 28px; font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255); margin-top: 0px !important;" class="">Package Manager Version Pinning</h1><ul style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">Proposal: SE-XXXX</li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">Author:&nbsp;<a href="https://github.com/ddunbar" style="-webkit-print-color-adjust: exact; color: rgb(65, 131, 196); margin-top: 0px;" class="">Daniel Dunbar</a>,&nbsp;<a href="https://github.com/aciidb0mb3r" style="-webkit-print-color-adjust: exact; color: rgb(65, 131, 196);" class="">Ankit Aggarwal</a></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">Review Manager: TBD</li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class="">Status: Discussion</li></ul><h2 id="toc_1" style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(204, 204, 204); font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class="">Introduction</h2><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">This is a proposal for adding package manager features to "pin" or "lock" package dependencies to particular versions.</p><h2 id="toc_2" style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(204, 204, 204); font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class="">Motivation</h2><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">As used in this proposal, version pinning refers to the practice of controlling&nbsp;<em style="-webkit-print-color-adjust: exact;" class="">exactly</em>&nbsp;which specific version of a dependency is selected by the dependency resolution algorithm,&nbsp;<em style="-webkit-print-color-adjust: exact;" class="">independent from</em>&nbsp;the semantic versioning specification. Thus, it is a way of instructing the package manager to select a particular version from among all of the versions of a package which could be chosen while honoring the dependency constraints.</p><h3 id="toc_3" style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 18px; font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class="">Terminology</h3><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class=""><em style="-webkit-print-color-adjust: exact;" class="">We have chosen to use "pinning" to refer to this feature, over "lockfiles", since the term "lock" is already overloaded between POSIX file locks and locks in concurrent programming.</em></p><h3 id="toc_4" style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 18px; font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class="">Philosophy</h3><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">Our philosophy with regard to pinning is that we actively want to encourage packages to develop against the latest semantically appropriate versions of their dependencies, in order to foster rapid development amongst the ecosystem and strong reliance on the semantic versioning concept. Our design for version pinning is thus intended to be a feature for package authors and users to use in crafting&nbsp;<em style="-webkit-print-color-adjust: exact;" class="">specific</em>&nbsp;workflows, not be a mechanism by which most of the packages in the ecosystem pin themselves to specific versions of each other.</p><h3 id="toc_5" style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 18px; font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class="">Use Cases</h3><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">Our proposal is designed to satisfy several different use cases for such a behavior:</p><ol style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">Standardizing team workflows</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px;" class="">When collaborating on a package, it can be valuable for team members (and continuous integration) to all know they are using the same exact version of dependencies, to avoid "works for me" situations.</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px;" class="">This can be particularly important for certain kinds of open source projects which are actively being cloned by new users, and which want to have some measure of control around exactly which available version of a dependency is selected.</p></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">Difficult to test packages or dependencies</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px;" class="">Complex packages which have dependencies which may be hard to test, or hard to analyze when they break, may choose to maintain careful control over what versions of their upstream dependencies they recommend -- even if conceptually they regularly update those recommendations following the true semantic version specification of the dependency.</p></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">Dependency locking w.r.t. deployment</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px;" class="">When stabilizing a release for deployment, or building a version of a package for deployment, it is important to be able to lock down the exact versions of dependencies in use, so that the resulting product can be exactly recreated later if necessary.</p></li></ol><h2 id="toc_6" style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(204, 204, 204); font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class="">Proposed solution</h2><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">We will introduce support for an&nbsp;<strong style="-webkit-print-color-adjust: exact;" class="">optional</strong>&nbsp;new file&nbsp;<code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Package.pins</code>&nbsp;adjacent to the&nbsp;<code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Package.swift</code>&nbsp;manifest, called the "pins file". We will also introduce a number of new commands (see below) for maintaining the pins file.</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">This file will record the active version pin information for the package, including data such as the package identifier, the pinned version, and explicit information on the pinned version (e.g., the commit hash/SHA for the resolved tag).</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">The exact file format is unspecified/implementation defined, however, in practice it will be a JSON data file.</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">This file&nbsp;<em style="-webkit-print-color-adjust: exact;" class="">may</em>&nbsp;be checked into SCM by the user, so that its effects apply to all users of the package. However, it may also be maintained only locally (e.g., placed in the&nbsp;<code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">.gitignore</code>&nbsp;file). We intend to leave it to package authors to decide which use case is best for their project.</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">In the presence of a&nbsp;<code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Package.pins</code>&nbsp;file, the package manager will respect the pinned dependencies recorded in the file whenever it needs to do dependency resolution (e.g., on the initial checkout or when updating).</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">The pins file will not override Manifest specified version requirements and it will be an error (with proper diagnostics) if there is a conflict between the pins and the manifest specification.</p><h2 id="toc_7" style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(204, 204, 204); font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class="">Detailed Design</h2><ol style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">We will add a new command&nbsp;<code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">pin</code>&nbsp;to&nbsp;<code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">swift package</code>&nbsp;tool with following semantics:</p><div style="-webkit-print-color-adjust: exact;" class=""><pre style="-webkit-print-color-adjust: exact; margin-top: 0px; margin-bottom: 15px; background-color: rgb(248, 248, 248); border: 1px solid rgb(204, 204, 204); font-size: 13px; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class=""><code class="language-none" style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">$ swift package pin ( [--all] | [&lt;package-name&gt;] [&lt;version&gt;] ) [--message &lt;message&gt;]</code></pre></div><p style="-webkit-print-color-adjust: exact; margin: 15px 0px;" class="">The&nbsp;<code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">package-name</code>&nbsp;refers to the name of the package as specified in its manifest.</p><p style="-webkit-print-color-adjust: exact; margin: 15px 0px;" class="">This command pins one or all dependencies. The command which pins a single version can optionally take a specific version to pin to, if unspecified (or with --all) the behaviour is to pin to the current package version in use. Examples:&nbsp;</p><ul style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px;" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">$ swift package pin --all</code>&nbsp;- pins all the dependencies.</li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">$ swift package pin Foo</code>&nbsp;- pins&nbsp;<code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Foo</code>&nbsp;at current resolved version.</li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">$ swift package pin Foo 1.2.3</code>&nbsp;- pins&nbsp;<code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Foo</code>&nbsp;at 1.2.3. The specified version should be valid and resolvable.</li></ul><p style="-webkit-print-color-adjust: exact; margin: 15px 0px;" class="">The&nbsp;<code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">--reason</code>&nbsp;option is an optional argument to document the reason for pinning a dependency. This could be helpful for user to later remember why a dependency was pinned. Example:&nbsp;</p><div style="-webkit-print-color-adjust: exact;" class=""><pre style="-webkit-print-color-adjust: exact; margin-top: 0px; margin-bottom: 15px; background-color: rgb(248, 248, 248); border: 1px solid rgb(204, 204, 204); font-size: 13px; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class=""><code class="language-none" style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">$ swift package pin Foo --reason "The patch updates for Foo are really unstable and need screening."</code></pre></div></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">Dependencies are never automatically pinned, pinning is only ever taken as a result of an explicit user action.</p></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">We will add a new command&nbsp;<code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">unpin</code>:</p><div style="-webkit-print-color-adjust: exact;" class=""><pre style="-webkit-print-color-adjust: exact; margin-top: 0px; margin-bottom: 15px; background-color: rgb(248, 248, 248); border: 1px solid rgb(204, 204, 204); font-size: 13px; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class=""><code class="language-none" style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">$ swift package unpin ( [--all] | [&lt;package-name&gt;] )</code></pre></div><p style="-webkit-print-color-adjust: exact; margin: 15px 0px;" class="">This is the counterpart to the pin command, and unpins one or all packages.</p></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">We will fetch and resolve the dependencies when running the pin commands, in case we don't have the complete dependency graph yet.</p></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">We will extend the workflow for update to honour version pinning, that is, it will only update packages which are unpinned, and it will only update to versions which can satisfy the existing pins. The update command will, however, also take an optional argument&nbsp;<code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">--repin</code>:</p><div style="-webkit-print-color-adjust: exact;" class=""><pre style="-webkit-print-color-adjust: exact; margin-top: 0px; margin-bottom: 15px; background-color: rgb(248, 248, 248); border: 1px solid rgb(204, 204, 204); font-size: 13px; line-height: 19px; overflow: auto; padding: 6px 10px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class=""><code class="language-none" style="-webkit-print-color-adjust: exact; margin: 0px; padding: 0px; border: none; background-color: transparent; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">$ swift package update [--repin]</code></pre></div><ul style="-webkit-print-color-adjust: exact; margin: 15px 0px; padding-left: 30px;" class=""><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">Update command errors if there are no unpinned packages which can be updated.</p></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">Otherwise, the behaviour is to update all unpinned packages to the latest possible versions which can be resolved while respecting the existing pins.</p></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">The&nbsp;<code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">[--repin]</code>&nbsp;argument can be used to lift the version pinning restrictions. In this case, the behaviour is that all packages are updated, and packages which were previously pinned are then repinned to the latest resolved versions.</p></li></ul></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">The update and checkout will both emit logs, notifying the user that pinning is in effect.</p></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">The&nbsp;<code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">swift package show-dependencies</code>&nbsp;subcommand will be updated to indicate if a dependency is pinned.</p></li><li style="-webkit-print-color-adjust: exact; margin: 0px;" class=""><p style="-webkit-print-color-adjust: exact; margin: 0px 0px 15px;" class="">As a future extension, we anticipate using the SHA information recorded in a pins file as a security feature, to prevent man-in-the-middle attacks on parts of the package graph.</p></li></ol><h2 id="toc_8" style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(204, 204, 204); font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class="">Impact on existing code</h2><p style="-webkit-print-color-adjust: exact; margin: 15px 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);" class="">There will be change in the behaviours of&nbsp;<code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">swift build</code>&nbsp;and&nbsp;<code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">swift package update</code>&nbsp;in presence of the pins file, as noted in the proposal however the existing package will continue to build without any modifications.</p><h2 id="toc_9" style="-webkit-print-color-adjust: exact; margin: 20px 0px 10px; padding: 0px; -webkit-font-smoothing: antialiased; cursor: text; position: relative; font-size: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(204, 204, 204); font-family: Helvetica, arial, sans-serif; background-color: rgb(255, 255, 255);" class="">Alternative considered</h2><p style="-webkit-print-color-adjust: exact; margin-top: 15px; margin-right: 0px; margin-left: 0px; font-family: Helvetica, arial, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); margin-bottom: 0px !important;" class="">We considered making the pinning behavior default on running&nbsp;<code style="-webkit-print-color-adjust: exact; margin: 0px 2px; padding: 0px 5px; white-space: nowrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">swift build</code>, however we think that pinning by default is likely to make the package graph more constrained than it should be. It drives the user away from taking full advantage of semantic versioning. We think it will be good for the package ecosystem if such a restriction is not the default behavior and that this design will lead to faster discovery of bugs and fixes in the upstream.</p></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div>_______________________________________________<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" class="">https://lists.swift.org/mailman/listinfo/swift-build-dev</a><br class=""></div></blockquote></div><br class=""></div></div></div>_______________________________________________<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" class="">https://lists.swift.org/mailman/listinfo/swift-build-dev</a><br class=""></div></blockquote></div><br class=""></div></div></div>_______________________________________________<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" class="">https://lists.swift.org/mailman/listinfo/swift-build-dev</a><br class=""></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></body></html>