New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-14647] swift build
incorrectly downgrading dependencies in Package.resolved
#4418
Comments
@swift-ci create |
I've attached a simpler version of the sample project that reproduces that issue
The steps are the same to reproduce. The main difference it the package only has on dependency (Starscream from:4.0.3). The issue occurs when switching from a branch that had build 4.0.3 to a branch where Package.resolved contains 4.0.4. Between those two versions a sub-dependency was removed which seems to cause the Package.resoved to be ignored and reset to match the versions in the .build folder. |
Same still doesn't work on 5.5 and it also affects other commands, like `swift package resolve` |
same |
This behaviour is horrible when you try to use |
Untested, but |
No, it doesn't. The resolve should honor the |
I think that #6578 fixes this issue. |
Attachment: Download
Environment
Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)
Target: x86_64-apple-darwin20.4.0
Additional Detail from JIRA
md5: 3df0eb42ba22271c1e8a7b759fa20f63
is duplicated by:
swift package resolve
overwritesPackage.resolved
Issue Description:
Introduction
swift build
will not respect the versions inPackage.swift
and instead changePackage.resolved
to match the dependency versions currently checked out in the.build
folder.Seems to be related to SR-10718
Example project
SomePackage
is a Swift Package with a git repo, the commits are the following.* b6ee888 (update-dependencies) Updated dependencies
* ee23dfe (HEAD -> main) Added dependencies
* 6715449 Initial commit
main
is the commit where some dependencies were addedupdate-dependencies
is a branch that has updated the dependencies.Steps to reproduce
`cd SomePackage`
`git checkout main`
`swift build`
`git checkout update-dependencies`
`swift build`
Expected behaviour
It should build the updated dependencies based on what's in
Package.resolved
Actual behaviour
The
Package.resolved
is updated to match the version of the dependencies that is currently checked out.Running
swift package reset
beforeswift build
uses the dependency versions fromPackage.resolved
Additional notes
There is a warning cause Apollo isn't added to a target, this is just to speed up building. Adding the dependency as a dependency of a target has no affect.
There is a warning about
swift-nio-zlib-support
but I was unable to reproduce the issue with justswift-nio-zlib-support
orStarscream
(the subdependecy that pulls inswift-nio-zlib-support
)The text was updated successfully, but these errors were encountered: