Skip to content
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

SwiftPM: Implement support for local dependencies #8267

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

fviernau
Copy link
Member

See individual commits.

Fixes #8194.

Reduce the diff of a following change (which will re-generate the
lockfile as well).

Signed-off-by: Frank Viernau <[email protected]>
Prepare for adding a `local` dependency, which requires tooling version
5.7. As that tooling version starts to fail with an error when
library projects contain `main.swift` files, simpliy rename these files.

Signed-off-by: Frank Viernau <[email protected]>
Add a synthetic package with one dependency and make it a `local`
dependency of the `project-with-localfile`. SwiftPM does not add an
entry for the local dependency to the lockfile, which is why the
functions which map from `PinV2` to ORT's model are not updated.

Signed-off-by: Frank Viernau <[email protected]>
@fviernau fviernau requested a review from a team as a code owner February 13, 2024 11:56
@fviernau fviernau changed the title Swiftpm local dependencies SwiftPM: Implement support for local dependencies Feb 13, 2024
@@ -0,0 +1,20 @@
// swift-tools-version:5.7
Copy link
Member

Choose a reason for hiding this comment

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

Commit message: project-with-localfile -> project-with-lockfile?

@@ -78,8 +78,8 @@
"repositoryURL": "https://github.com/apple/swift-collections.git",
"state": {
"branch": null,
"revision": "d029d9d39c87bed85b1c50adee7c41795261a192",
"version": "1.0.6"
"revision": "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb",
Copy link
Member

Choose a reason for hiding this comment

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

Hmm. This doesn't really reduce the diff with Package.resolved from the last commit, as that also seems to "unnested" the whole structure.

Copy link
Member Author

@fviernau fviernau Feb 13, 2024

Choose a reason for hiding this comment

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

It does reduce the diff with the expected output file, which was the intention of this commit.

Copy link
Member Author

Choose a reason for hiding this comment

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

The unnesting should have been probably part of the middle commit. I'll check that.

@@ -57,6 +57,9 @@ project:
- id: "Swift::github.com/apple/swift-atomics:1.2.0"
- id: "Swift::github.com/apple/swift-collections:1.1.0"
- id: "Swift::github.com/apple/swift-system:1.2.1"
- id: "Swift::github.com/oss-review-toolkit/ort:690a5087534c202b395d65f3262f52c98251c647"
Copy link
Member

Choose a reason for hiding this comment

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

Is this a Git commit SHA1 that needs to be "templatized"?

Copy link
Member

Choose a reason for hiding this comment

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

Similar below.

]
},
"version": 1
"pins" : [
Copy link
Member

Choose a reason for hiding this comment

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

See my comment on the first commit, the diff is still large due to the "unnesting" of "object" (and different order of pins).

@@ -17,6 +17,8 @@
* License-Filename: LICENSE
*/

@file:Suppress("TooManyFunctions")
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Maybe start to move out extension functions to a separate file in a follow-up commit?

@fviernau fviernau marked this pull request as draft February 15, 2024 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SwiftPM: Support local package dependencies
2 participants