Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Support Swift 5.7 dependencies #73

Merged
merged 5 commits into from
Aug 19, 2022
Merged

Conversation

giginet
Copy link
Contributor

@giginet giginet commented Aug 18, 2022

Context

Since Xcode 14.0 beta 5, swift-tools-support-core@release/5.6 doesn't build due to broken compatibilities.

I updated swift-tools-support-core and swift-package-manager to release/5.7.
This PR makes this project enable to build with the latest Xcode. (above Xcode 14 beta 5).

Description

Due to updated dependencies, some APIs are changed. So I changed some implementations.

Unfortunately, GitHub Action doesn't support the latest Xcode yet. So we can't update CI stacks.

@@ -106,6 +109,28 @@ struct Zipper {
func clean (file: Foundation.URL) throws {
try FileManager.default.removeItem(at: file)
}

#if swift(>=5.7)
private func checksum(forBinaryArtifactAt path: AbsolutePath) throws -> String {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checksum(forBinaryArtifactAt:) is moved from Workspace to Workspace.BinaryArtifactsManager.
Unfortunately, workspace.binaryArtifactsManager is concealed from externals.

So I ported the same implementation from the original SwiftPM codes.

https://github.com/apple/swift-package-manager/blob/release/5.7/Sources/Workspace/Workspace%2BBinaryArtifacts.swift#L390-L413

@@ -23,7 +23,7 @@ struct ProjectGenerator {

var projectPath: AbsolutePath {
let dir = AbsolutePath(self.package.projectBuildDirectory.path)
return buildXcodeprojPath(outputDir: dir, projectName: self.package.manifest.displayName)
return XcodeProject.makePath(outputDir: dir, projectName: self.package.manifest.displayName)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This global method is moved to a static method.

@bok-
Copy link
Contributor

bok- commented Aug 18, 2022

Thanks very much for raising this PR! The code itself looks fantastic to me, I'll run some tests here on my end as well but assuming CI passes we should be good to merge this pretty much straight away.

@bok- bok- added the minor A minor change according to semver label Aug 18, 2022
@bok- bok- self-assigned this Aug 18, 2022
@bok-
Copy link
Contributor

bok- commented Aug 19, 2022

Thanks very much for the PR! I appreciate the time you took to annotate your PR as well – the notes and reasoning made it a really easy one to review.

@bok- bok- merged commit efbe96f into unsignedapps:main Aug 19, 2022
@giginet giginet deleted the support5.7 branch August 19, 2022 11:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
minor A minor change according to semver
Projects
None yet
2 participants