Skip to content

[Collections] Tighten import conditions #3296

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

Merged
merged 3 commits into from
Feb 25, 2021

Conversation

yim-lee
Copy link
Contributor

@yim-lee yim-lee commented Feb 20, 2021

Some Security framework APIs are available on macOS only

@yim-lee
Copy link
Contributor Author

yim-lee commented Feb 20, 2021

@swift-ci please smoke test

1 similar comment
@yim-lee
Copy link
Contributor Author

yim-lee commented Feb 20, 2021

@swift-ci please smoke test

@@ -1224,6 +1328,10 @@ final class PackageCollectionsTests: XCTestCase {
try XCTSkipIf(true)
#endif

if !PackageCollections.isSupportedPlatform {
try XCTSkipIf(true)
Copy link
Contributor

Choose a reason for hiding this comment

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

try XCTSkipIf(!PackageCollections.isSupportedPlatform)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is a way in XCTest to apply such rules to all tests in the class, which may be easier. @neonichu do you remember how?

Copy link
Contributor

Choose a reason for hiding this comment

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

Not aware of anything tbh

@@ -14,6 +14,13 @@ import TSCBasic

// TODO: is there a better name? this conflicts with the module name which is okay in this case but not ideal in Swift
public struct PackageCollections: PackageCollectionsProtocol {
// Check JSONPackageCollectionProvider.isSignatureCheckSupported before updating or removing this
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if there is a way to exclude the entire PackageCollections module in unsupported platforms. not sure if easier / harder but if easy may hep to keep the code simpler and move the complexity there

Copy link
Contributor

Choose a reason for hiding this comment

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

cc @neonichu may know of a way

Copy link
Contributor

Choose a reason for hiding this comment

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

In principle, we could use conditional dependencies, might need some reorganization because I think right now some of the collections targets are also directly included in products.

@tomerd
Copy link
Contributor

tomerd commented Feb 20, 2021

looks good, some ideas/thought on how to simplify this but its good either way.

@tomerd tomerd added the ready Author believes the PR is ready to be merged & any feedback has been addressed label Feb 21, 2021
@yim-lee
Copy link
Contributor Author

yim-lee commented Feb 24, 2021

@swift-ci please smoke test

@yim-lee
Copy link
Contributor Author

yim-lee commented Feb 25, 2021

@swift-ci please smoke test

@yim-lee
Copy link
Contributor Author

yim-lee commented Feb 25, 2021

@swift-ci please smoke test

@yim-lee yim-lee merged commit cf0eb29 into swiftlang:main Feb 25, 2021
@yim-lee yim-lee deleted the security-import branch February 25, 2021 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Author believes the PR is ready to be merged & any feedback has been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants