-
Notifications
You must be signed in to change notification settings - Fork 1.4k
initial integration of registry dependencies #3863
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
Conversation
@swift-ci please smoke test |
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Do we need both
CheckoutState
andPinState
? - The code around
PinState
seems repetitive (e.g., there are twoPinStateInfo
) but not sure if it can be DRYer.
Sources/PackageGraph/PinsStore.swift
Outdated
@@ -272,6 +314,9 @@ fileprivate struct PinsStorage { | |||
case .remoteSourceControl(let url): | |||
kind = .remoteSourceControl | |||
location = url.absoluteString | |||
case .registry: | |||
kind = .registry | |||
location = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nil
is more appropriate but it's probably a big change to make location
optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I will also add a FIXME here as we may need to revisit this
Sources/Workspace/Workspace.swift
Outdated
let downloadPath = self.location.registryDownloadDirectory.appending(components: package.identity.description, version.description) | ||
if !self.fileSystem.exists(downloadPath) { | ||
_ = try temp_await { | ||
registryManager.downloadSourceArchive( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will need to pass workspace.checksumAlgorithm
@swift-ci please smoke test |
f2db564
to
d291a81
Compare
@swift-ci please smoke test |
@yim-lee rebased on your changes ptal |
@@ -135,9 +134,9 @@ public final class RegistryManager { | |||
var components = URLComponents(url: registry.url, resolvingAgainstBaseURL: true) | |||
components?.appendPathComponents("\(scope)", "\(name)", "\(version)", "Package.swift") | |||
|
|||
if let swiftLanguageVersion = swiftLanguageVersion { | |||
if let toolsVersion = toolsVersion { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it's the tools version, not Swift version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it should be tools version based afaik
@@ -185,7 +184,7 @@ public final class RegistryManager { | |||
packageLocation: package.description, // FIXME: was originally PackageReference.locationString | |||
version: version, | |||
revision: nil, | |||
toolsVersion: .currentToolsVersion, | |||
toolsVersion: toolsVersion ?? .currentToolsVersion, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the FIXME on L180 then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is still not working quite right, and looks like it may require larger change :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -157,20 +164,20 @@ final class RegistryManagerTests: XCTestCase { | |||
|
|||
// FIXME: this fails with error "the package manifest at '/Package.swift' cannot be accessed (/Package.swift doesn't exist in file system)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we uncomment the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tried to fix it but this is still not working correctly. i plan to address in a separate pr to control scope of this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
} | ||
|
||
try temp_await { | ||
registryManager.downloadSourceArchive( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
motivation: support registry dependencies changes: * make PinStore::state more generic (instead of CheckoutState) so it can handle non-checkout dependencies state * clean up CheckoutState and move it to the Workspace module where it belongs * wire calls to fetch and delete registry dependencies as part of dependency resolution in Workspace * adjust call-sites tests
7105157
to
5f99c14
Compare
5f99c14
to
e0e29cf
Compare
@swift-ci please smoke test |
motivation: support registry dependencies
changes: