Skip to content

Conversation

@tomerd
Copy link
Contributor

@tomerd tomerd commented Jul 23, 2021

motivation: with SE-0292 accepted, we can start implementing the SwiftPM side of it

the scope of this work only includes infrastructure to parse dependencies coming from registry, significant follow up work is required to complete the feature

changes:

  • add manifest support for dependencies coming from registry
  • add manifest parsing support for dependencies coming from registry
  • refactor relevant code to support new dependency type
  • add and adjust tests

@tomerd
Copy link
Contributor Author

tomerd commented Jul 23, 2021

cc @mattt @yim-lee

@tomerd
Copy link
Contributor Author

tomerd commented Jul 23, 2021

@swift-ci please smoke test

Copy link
Contributor

@mattt mattt left a comment

Choose a reason for hiding this comment

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

Thanks for digging into this, @tomerd. Just a few suggestions to get this aligned with the spec. Once we have this in, I should be able to wire up support with the registry client quickly.

@tomerd tomerd self-assigned this Jul 26, 2021
@tomerd tomerd force-pushed the feature/registry branch 6 times, most recently from 6d77a3c to 713a453 Compare July 27, 2021 01:22
@tomerd
Copy link
Contributor Author

tomerd commented Jul 27, 2021

thanks for the feedback @mattt addressed with 713a453

@tomerd
Copy link
Contributor Author

tomerd commented Jul 27, 2021

@swift-ci please smoke test

@tomerd
Copy link
Contributor Author

tomerd commented Jul 27, 2021

macOS self hosted uses 5.3 which does not support codable synthesis for enums with associated values. checking in with @shahmishal if we can update that to 5.4

@tomerd
Copy link
Contributor Author

tomerd commented Jul 27, 2021

@swift-ci please smoke test

@tomerd
Copy link
Contributor Author

tomerd commented Jul 27, 2021

@swift-ci please smoke test

@tomerd
Copy link
Contributor Author

tomerd commented Jul 27, 2021

@yim-lee please note this will change the output of swift package describe which may impact the collections generator?


case fileSystem(FileSystem)
case sourceControl(SourceControl)
case registry(Registry)
Copy link
Contributor Author

@tomerd tomerd Jul 27, 2021

Choose a reason for hiding this comment

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

@neonichu @abertelrud are you happy with these modified names? note local -> fileSystem and scm -> sourceControl

Copy link
Contributor

Choose a reason for hiding this comment

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

The names seem good, and in general, this PR is an improvement. I'm a bit concerned about the absolute path being stored for the path, which isn't easily round-trippable when generating the source for a package manifest, but it looks as if that was already the case. That might be a bug that we have today (I think I've seen the same thing when describing a package, i.e. that the absolute path is emitted rather than the one that had been specified). Since it isn't new in this PR, that can be fixed later.

@yim-lee
Copy link
Contributor

yim-lee commented Jul 27, 2021

please note this will change the output of swift package describe which may impact the collections generator?

Currently the generator has minimal usage of describe and only extracts name and targets (name and c99name) from the output. AFAICT this PR doesn't change that part of the code, so I think we are ok.

@mattt
Copy link
Contributor

mattt commented Jul 27, 2021

Please note this will change the output of swift package describe which may impact the collections generator?

I'm relying on the output of swift package describe for a few different tools that integrate with Swift Package Manager, including https://github.com/spdx/spdx-sbom-generator. While we're making changes, would you be interested in a PR / proposal to expand and stabilize the format of this command?

@tomerd
Copy link
Contributor Author

tomerd commented Jul 27, 2021

I'm relying on the output of swift package describe for a few different tools that integrate with Swift Package Manager, including https://github.com/spdx/spdx-sbom-generator. While we're making changes, would you be interested in a PR / proposal to expand and stabilize the format of this command?

that sounds great! probably material for follow up PR tho?

@tomerd
Copy link
Contributor Author

tomerd commented Jul 27, 2021

@shahmishal macOS Platform (self hosted) still on 5.3 causing this PR test failure

@mattt
Copy link
Contributor

mattt commented Jul 27, 2021

I'm relying on the output of swift package describe for a few different tools that integrate with Swift Package Manager, including https://github.com/spdx/spdx-sbom-generator. While we're making changes, would you be interested in a PR / proposal to expand and stabilize the format of this command?

that sounds great! probably material for follow up PR tho?

Yes, definitely. Not at all a blocker for this PR or the registry feature generally.

@tomerd
Copy link
Contributor Author

tomerd commented Jul 31, 2021

@swift-ci please smoke test

@abertelrud
Copy link
Contributor

I'm relying on the output of swift package describe for a few different tools that integrate with Swift Package Manager, including https://github.com/spdx/spdx-sbom-generator. While we're making changes, would you be interested in a PR / proposal to expand and stabilize the format of this command?

that sounds great! probably material for follow up PR tho?

I agree, that would be fantastic (as follow-on PR). There are some quirks to the describe command that are a bit unfortunate, especially around how dependencies are represented, and it could also use some control over how much details is provided. I'd love to see what you had in mind.

Copy link
Contributor

@abertelrud abertelrud left a comment

Choose a reason for hiding this comment

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

Thanks for these changes, this looks like good cleanup!

@available(_PackageDescription, obsoleted: 5.2)
/// The following example instruct the Swift Package Manager to use version `1.2.3`.
///
/// .package(identity: "scope.name", exact: "1.2.3"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is the documentation for the URL version, should the example use URL and not identity?

@available(_PackageDescription, introduced: 5.2)
/// The following example instruct the Swift Package Manager to use version `1.2.3`.
///
/// .package(identity: "scope.name", exact: "1.2.3"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment about URL and identity.


case fileSystem(FileSystem)
case sourceControl(SourceControl)
case registry(Registry)
Copy link
Contributor

Choose a reason for hiding this comment

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

The names seem good, and in general, this PR is an improvement. I'm a bit concerned about the absolute path being stored for the path, which isn't easily round-trippable when generating the source for a package manifest, but it looks as if that was already the case. That might be a bug that we have today (I think I've seen the same thing when describing a package, i.e. that the absolute path is emitted rather than the one that had been specified). Since it isn't new in this PR, that can be fixed later.

tomerd added 8 commits August 3, 2021 14:14
motivation: with SE-0292 accepted, we can start implementing the SwiftPM side of it

the scope of this work only includes basic infrastrucuture to parse dependencies coming from registry, follow up work is reauired to complete the feature

changes:
* add manifest support for dependencies coming from registry
* add manifest parsing support for dependencies coming from registry
* refactor relevant code to support new dependency type
* add and adjust tests
* refactor manifet encoding and parsing to more clearly define dependency type and associated metadata
* make .upToNextMajor and .upToNextMinor extensions on Range<Version> to reuse across new requirment types
* adjust tests
@tomerd tomerd force-pushed the feature/registry branch from 41b4bc0 to 7e7c9ba Compare August 3, 2021 22:30
@tomerd
Copy link
Contributor Author

tomerd commented Aug 3, 2021

@swift-ci please smoke test

@tomerd
Copy link
Contributor Author

tomerd commented Aug 3, 2021

@swift-ci please smoke test

@tomerd tomerd merged commit 8dd0202 into swiftlang:main Aug 4, 2021
@compnerd
Copy link
Member

compnerd commented Aug 4, 2021

This seems to have regressed the Windows build: https://ci-external.swift.org/job/oss-swift-windows-toolchain-x86_64-vs2019/93/consoleText

compnerd added a commit that referenced this pull request Aug 4, 2021
compnerd added a commit to compnerd/swift-package-manager that referenced this pull request Aug 4, 2021
The C imports are important, particularly on Windows, where `HANDLE` is
not available without the platform SDK (`WinSDK` is roughly synonymous
to `Darwin`).
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.

6 participants