<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>I assume that a lot of this stuff is coming. However, based on the current state of things, I'm actually really surprised we don't have a Package.lock file (or equivalent). Being able to reproduce the exact build on multiple machines or at multiple points in time is really important. I may specify that I want version 1.x of a package but everyone who checks out my project and builds it should get the exact same version (e.g. 1.0.2) of the dependency, even if there's a newer compatible version.<br></div>
<div>&nbsp;</div>
<div>-Kevin Ballard<br></div>
<div>&nbsp;</div>
<div>On Thu, Dec 3, 2015, at 11:48 PM, 王巍 wrote:<br></div>
<blockquote type="cite"><div>Hi, all<br></div>
<div>&nbsp;</div>
<div>It seems currently there is no way to update a dependency to a compatible version unless we remove the cloned dependency folder from Packages manually.<br></div>
<div>&nbsp;</div>
<div>Take example, consider the Package.swift file as follows:<br></div>
<div>&nbsp;</div>
<div><div>let package = Package(<br></div>
<div>&nbsp; &nbsp; name: "Dealer",<br></div>
<div>&nbsp; &nbsp; dependencies: [<br></div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; .Package(url: "<a href="https://github.com/apple/example-package-deckofplayingcards.git">https://github.com/apple/example-package-deckofplayingcards.git</a>", majorVersion: 1),<br></div>
<div>&nbsp; &nbsp; ]<br></div>
<div>)<br></div>
</div>
<div>&nbsp;</div>
<div>It will clone and build the latest 1.x.y (currently 1.0.2, <a href="https://github.com/apple/example-package-deckofplayingcards/releases">https://github.com/apple/example-package-deckofplayingcards/releases</a>) for me. Let’s assume later a new compatible version 1.0.3 is released. However, even I run `swift build` again, it seems the package manager will not update this dependency, since the existing version is already match the requirement. ( <a href="https://github.com/apple/swift-package-manager/blob/master/Sources/dep/get.swift#L260-L270">https://github.com/apple/swift-package-manager/blob/master/Sources/dep/get.swift#L260-L270</a> ).<br></div>
<div>&nbsp;</div>
<div>Even I run a `swift build -k` before building the package, the dependency wouldn’t get updated. The only way to update to a most recent compatible version seems to be a `rm -rf Packages` before build.<br></div>
<div>&nbsp;</div>
<div>As I specified the major version should be 1, IMO, it means I may want the latest version before 2.0.0. Is current behavior expected, or is there any plan to provide a better way to upgrade the dependencies? Maybe we need some options like `swift build —clean_all` or `swift build upgrade`?<br></div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><div style="color:rgb(0, 0, 0);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-line-break:after-white-space;"><div><div style="font-family:helvetica, Arial;font-size:13px;background-color:rgb(255, 255, 255);word-wrap:break-word;-webkit-line-break:after-white-space;"><span class="font" style="font-family:Helvetica"><span class="colour" style="color:rgb(81, 81, 81)"><span class="font" style="font-family:Tahoma"><span class="size" style="font-size:12px">Best&nbsp;regards.</span></span></span></span><br></div>
<div style="font-family:helvetica, Arial;font-size:13px;background-color:rgb(255, 255, 255);word-wrap:break-word;-webkit-line-break:after-white-space;"><span class="font" style="font-family:Helvetica">---</span><br></div>
<div style="font-size:13px;background-color:rgb(255, 255, 255);font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;word-wrap:break-word;-webkit-line-break:after-white-space;"><span class="colour" style="color:rgb(81, 81, 81)"><span class="font" style="font-family:Tahoma"><span class="size" style="font-size:12px"><span style="line-height:15px;">Sincerely,</span> <br style="line-height:15px;"><span style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:initial;border-right-style:initial;border-bottom-style:initial;border-left-style:initial;border-top-color:initial;border-right-color:initial;border-bottom-color:initial;border-left-color:initial;border-image-source:initial;border-image-slice:initial;border-image-width:initial;border-image-outset:initial;border-image-repeat:initial;outline-width:0px;outline-color:initial;outline-style:initial;vertical-align:baseline;">Wei Wang (王巍, @onevcat)<br></span></span></span></span><a style="font-family:Tahoma;font-size:12px;background-color:inherit;color:rgb(65, 131, 196);text-decoration:none;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:initial;border-right-style:initial;border-bottom-style:initial;border-left-style:initial;border-top-color:initial;border-right-color:initial;border-bottom-color:initial;border-left-color:initial;border-image-source:initial;border-image-slice:initial;border-image-width:initial;border-image-outset:initial;border-image-repeat:initial;outline-width:0px;outline-color:initial;outline-style:initial;vertical-align:baseline;" href="http://im.onevcat.com/">im.onevcat.com</a></div>
</div>
</div>
</div>
<div>&nbsp;</div>
<div> <img style="height:1px !important;width:1px !important;border-top-width:0px !important;border-right-width:0px !important;border-bottom-width:0px !important;border-left-width:0px !important;margin-top:0px !important;margin-bottom:0px !important;margin-right:0px !important;margin-left:0px !important;padding-top:0px !important;padding-bottom:0px !important;padding-right:0px !important;padding-left:0px !important;" border="0" height="1" width="1" alt="" src="https://www.fastmailusercontent.com/proxy/6b046178a8d92321f81f0ac61d5940ed0705fdbe89b1ed52c86d2868fda2f2fa/8647470737a3f2f25723030323431303e23647e23756e64676279646e2e65647f27766f2f60756e6f35707e6d3148765176786c673171614a7d2236454230345272776e475d2236423f49686875744638414f64503265663155383366537a7369314c44315859716a417f45414b44794f654a4a59555a48627930364144587244517f466f6e6439777a497d475966555b6742305a51736d4b63764d6a5465607b415035363169397f433465405d22364c436f6376754a6239646e6d4d223244614858456b465148333f6739695c68526360543d617b4935754849796335794440783960324944305161643d4a777d6e49595831576542587347354166486776343c6a72535d22324455644b677d23344d23344/open"><br></div>
<div><u>_______________________________________________</u><br></div>
<div>swift-build-dev mailing list<br></div>
<div><a href="mailto:swift-build-dev@swift.org">swift-build-dev@swift.org</a><br></div>
<div><a href="https://lists.swift.org/mailman/listinfo/swift-build-dev">https://lists.swift.org/mailman/listinfo/swift-build-dev</a><br></div>
</blockquote><div>&nbsp;</div>
</body>
</html>