Remove Package.resolved to reveal build errors caused by upstream changes #299
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checking in
Package.resolvedfor library packages is discouraged because it can mask failures caused by new versions of upstream dependencies.https://docs.swift.org/swiftpm/documentation/packagemanagerdocs/resolvingpackageversions#Coordinating-versions-of-dependencies-for-your-package
When
containerizationis built in CI, or when tests are run inside a checked-out local copy of the repository,Package.resolvedpins all its dependencies to fixed versions. New versions of upstream dependencies wil not be tested unlessPackage.resolvedis explicitly updated.When
containerizationis built as a dependency of a end-userproject, its
Package.resolvedfile is ignored. Instead, thedependency constraints from
containerization'sPackage.swiftfile are combined with those of the project and any other library
dependencies, so SwiftPM or Xcode can find a set of mutually compatible
packages. This can lead to new versions of
containerization's upstreamdependencies being used, even though those versions have never been tested
in CI.
The effects of this could be seen before #298 was merged, because
swift-niohad changed upstream, breaking packages which depend oncontainerizationbut not breaking
containerization's own CI.swift-nio2.86.1removed the
NIOFileSystemproduct (apple/swift-nio#3370)which is not yet ready to be public. CI builds of
containerizationwerenot affected by this change because
Package.resolvedpinnedswift-niotoan older version:
In comparison, creating a new package which used
containerizationshowed that the library could no longer be built:Removing
Package.resolvedwould cause the same error to occur in a clean build ofcontainerizationand be picked up in CI.