-
Notifications
You must be signed in to change notification settings - Fork 1.4k
implement archiving for registry publishing #6118
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
a6b2ec7
to
2046ae0
Compare
@swift-ci smoke test |
"Commands", | ||
"Workspace", | ||
"PackageModel", | ||
"PackageRegistryTool", |
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.
Should there be a PackageRegistryToolTests
module?
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.
PackageRegistryToolTests are under CommandTests module even before this PR. is there a concern?
) | ||
} | ||
|
||
// include metadata from non-standard location in the archive |
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 doing more than what the spec says--custom metadata file location is used for in-request
metadata only; it doesn't say SwiftPM would copy from custom metadata file location to the archive.
I don't have a strong opinion, just need to update the proposal accordingly.
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.
thanks for pointing this out. this feels like the more intuitive behavior to me.
e4df9f7
to
55c0ed4
Compare
motivation: progress on registry publishing implementationn changes: * implement compression using ZipArchiver * implement code flow to archive package for publishing per spec * add tests
55c0ed4
to
075750e
Compare
@swift-ci smoke test |
075750e
to
76f203a
Compare
@swift-ci smoke test |
@yim-lee this has been updated per feedback |
requires swiftlang/swift-docker#329 |
#if os(Windows) | ||
let process = TSCBasic.Process( | ||
// FIXME: are these the right arguments? | ||
arguments: ["tar.exe", "-a", "-c", "-f", destinationPath.pathString, directory.basename], |
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 tar really produce ZIP archives on Windows? That seems quite surprising to me.
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.
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.
Maybe we should add a precondition
on destinationPath
here? -a
detects the archive format from path extension (and sadly that’s the only option to create a zip archive for tar.exe
). We may want to make sure we’re actually creating a zip
archive.
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.
Ah that's nice, wish the macOS/Linux tar did the same :)
@@ -88,18 +88,18 @@ extension SwiftPackageRegistryTool { | |||
|
|||
// compute and validate registry URL | |||
guard let registryURL = self.registryURL ?? configuration.configuration.defaultRegistry?.url else { | |||
throw ConfigurationError.unknownRegistry | |||
throw ValidationError.unknownRegistry |
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.
ValidationError
will print command usage/help, which doesn't seem appropriate here? (same for the other changes in this file)
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 not ArgumentParser's ValidationError
so should be okay?
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.
Oh I see. Should we call it something different? Seems a little confusing especially in the context of the implementation of a CLI tool, so both ValidationError
types will be visible.
@swift-ci smoke test linux |
motivation: progress on registry publishing implementation
changes: