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

HashAlgorithm conformance that wraps CryptoKit.SHA256 #31

Merged
merged 1 commit into from
Jun 6, 2020

Conversation

hartbit
Copy link
Contributor

@hartbit hartbit commented Jan 10, 2020

No description provided.

@hartbit
Copy link
Contributor Author

hartbit commented Jan 10, 2020

@swift-ci please test

@hartbit
Copy link
Contributor Author

hartbit commented Jan 10, 2020

@swift-ci please test

1 similar comment
@hartbit
Copy link
Contributor Author

hartbit commented Jan 10, 2020

@swift-ci please test

@hartbit
Copy link
Contributor Author

hartbit commented Jan 10, 2020

@swift-ci please test

1 similar comment
@hartbit
Copy link
Contributor Author

hartbit commented Jan 10, 2020

@swift-ci please test

@hartbit
Copy link
Contributor Author

hartbit commented Jan 10, 2020

@swift-ci please test

1 similar comment
@hartbit
Copy link
Contributor Author

hartbit commented Jan 10, 2020

@swift-ci please test

@hartbit
Copy link
Contributor Author

hartbit commented Jan 10, 2020

@swift-ci please test

@aciidgh
Copy link
Contributor

aciidgh commented Jan 10, 2020

@swift-ci test

@hartbit
Copy link
Contributor Author

hartbit commented Jan 10, 2020

@swift-ci test

1 similar comment
@hartbit
Copy link
Contributor Author

hartbit commented Jan 10, 2020

@swift-ci test

@hartbit
Copy link
Contributor Author

hartbit commented Jan 10, 2020

@swift-ci test

1 similar comment
@hartbit
Copy link
Contributor Author

hartbit commented Jan 10, 2020

@swift-ci test

Comment on lines 184 to 187
if #available(macOS 10.15, *) {
return bytes.withData { data in
let digest = CryptoKit.SHA256.hash(data: data)
return ByteString(digest)
}
} else {
fatalError("not supported on this platform")
}

Choose a reason for hiding this comment

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

I think this will need to use conditional compilation directives.

-        if #available(macOS 10.15, *) {
+        #if canImport(CryptoKit)
             return bytes.withData { data in
                 let digest = CryptoKit.SHA256.hash(data: data)
                 return ByteString(digest)
             }
-        } else {
+        #else
             fatalError("not supported on this platform")
-        }
+        #endif

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That resolves the Linux issue, but macOS still does not weak link the framework.

Choose a reason for hiding this comment

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

Someone has reported the weak-linking issue on the forums and as SR-11907.

(I'm getting a 502 Proxy Error for bugs.swift.org at the moment.)

@hartbit
Copy link
Contributor Author

hartbit commented Jan 13, 2020

@swift-ci test

2 similar comments
@hartbit
Copy link
Contributor Author

hartbit commented Jan 13, 2020

@swift-ci test

@neonichu
Copy link
Contributor

neonichu commented Jun 6, 2020

@swift-ci test

@neonichu neonichu merged commit cffd634 into swiftlang:master Jun 6, 2020
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.

4 participants