Scala Native - #2975
Merged
Merged
Conversation
This reverts commit 20a277a.
This reverts commit ea0c721.
Member
Author
|
I've published If anyone with an M1 wants to run the fs2-io test suite locally I'd be much obliged :) you will need to |
Member
|
I tried on an M1 Mac and ran in to some test errors in TLSSockeSuite like this: ==> X fs2.io.net.tls.TLSSocketSuite.TLSSocket - google - default - client writes before reading 0.07s java.io.IOException: getaddrinfo: 8 |
Member
Author
|
@mpilquist thanks for that, probably due to broken IPv6 in epollcat. Hopefully the latest commit should fix that (or at the very least, give a more verbose error :) |
armanbilge
marked this pull request as ready for review
September 15, 2022 02:57
Closed
|
Just wanted to say you are a hero, @armanbilge! Thanks for all your work! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2319.
Supports:
fs2-core, excepthashAsynchronousSocketChannelis available at link-time, such as epollcatMost of the changes in this PR are adding support for TLS. Everything else is code shuffling.
The TCP implementation is unopinionated: it shares the
AsynchronousSocketChannelimplementation with the JVM.AsynchronousSocketChannelis not implemented in Scala Native (and cannot be until it supports multithreading). This leaves the door open for 3rd parties to implement these APIs. Any implementation compliant with JDK should work.We run our tests against the implementation provided in epollcat which supports Linux and macOS. A hypothetical implementation of these APIs based on libuv and/or scala-native-loop could run on Windows.
On the other hand, the TLS implementation is very opinionated. It relies on s2n-tls and introduces configuration classes specifically based on its APIs and features. Note that s2n does not support Windows (aws/s2n-tls#497). s2n is also minimalist by-design:
In exchange, it offers a modern, simple API that was straightforward to integrate with. I think the trade-off is worth it.
The alternative, unopinionated approach would have been to use the JDK SSL APIs (essentially sharing the JVM code). These are not provided by Scala Native core, so it would be up to third parties to implement them. I explored this idea in sn-ssl, but it proves to be a significant amount of work with a greater surface area for vulnerability.
Once CI is green, I will publish a hash version to Maven Central and continue onwards to http4s ember and skunk.