-
Notifications
You must be signed in to change notification settings - Fork 41
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
WIP: Support Scala Native #239
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # kubernetes-client/src/com/goyeau/kubernetes/client/KubernetesClient.scala
# Conflicts: # kubernetes-client/src/com/goyeau/kubernetes/client/KubernetesClient.scala
# Conflicts: # build.sc # project/Dependencies.sc
# Conflicts: # kubernetes-client/src/com/goyeau/kubernetes/client/KubernetesClient.scala
…e of `PodsApi#execStream`, minor refactoring
# Conflicts: # .github/workflows/ci.yml # .mill-version # build.sc # project/Dependencies.sc
What do you think about using ember instead of jdk http client? |
I just noticed that this repo uses javax for TLS. We need to find a substitute for it to support it on native. |
I was thinking to add a "bring your own Client" constructor somehow. We can leave the JDK client as the default (as it is now) - in the jvm platform. Obviously it won't be available in other platforms - it will have to be Ember instead. Or we could make Ember the default in all platforms, and add the jdk client as an alternative on jvm. @joan38 what do you think?
Ember is using https://github.com/typelevel/fs2/blob/main/io/native/src/main/scala/fs2/io/net/tls/TLSContextPlatform.scala This should be all we need, right? We just need to create the |
Do we have a problem? :) |
Web socket support was the whole reason we went with the jdk client. |
Yeah... |
and this: http4s/http4s#7196 - there's even a snapshot available |
now, how do I tell mill to look at the sonatype snapshots? :) |
def repositoriesTask = T.task {
super.repositoriesTask() ++ Seq(coursier.Repositories.sonatype("snapshots"), coursier.Repositories.sonatypeS01("snapshots"))
} |
trying it with that snapshot version, got it to compile, but js linking fails:
now I need to tell mill to give me more details |
Feel free to push more commits to this branch of course :) |
Will do! :) I was thinking if I should branch off, but if you're not actively working on it today I'd rather push here. |
Sounds like we need to replace all the |
Ha, I'm blind. Those were just warnings. The action fails because of the same error I'm getting locally:
It must have changed in mill 0.11 |
@lolgab can we have something like |
for anyone interested: |
I changed the CI job to matrix. Is this too much now? :) |
I would expand the whole matrix only in the latest Kubernetes version and then have a job with |
Out of the box it's not supported I think. I have it in my mill-crossplatform plugin but it's not worth it to add here. def sources = super.sources() ++ Seq(millSourcePath / "src-js-native") |
That's what I was looking for, thanks! :) Though now I'm realizing that the ember client builder in all three |
Fixes #192
Current Status
✅ compiles successfully for all platforms
✅ links successfully for all platforms
✅ jvm /
jdk-client
tests passing❌ jvm /
ember-client
tests NOT passing❌ js /
ember-client
tests NOT passing❌ native /
ember-client
tests NOT passing🤘 figure out yaml: since the original circe yaml is not cross-platform, we're using @armanbilge's fork: https://github.com/armanbilge/circe-scala-yaml (nothing bad with it per se;
and I don't know if we should be expecting cross-platform builds from the upstreamwe should not be expecting it from the upstream since it's based on a java library)❌ stop using a snapshot version of http4s (when websocket support in Ember client lands in a release version)
✅ stop using a snapshot version of fs2 (when clientside mTLS fix lands in a release version)
Ember client
❌ need to fix the websocket issue:
native
✅ Ember client (the underlying s2n connection) is
notnow enabling the mutual TLSand fails when the server requests it❌ client key password is not supported (s2n doesn't do it) - I'm assuming it's not critical for the vast majority of use cases, though. Currently an error is raised if the password is specified in the configuration. If we want to add support for it, we'll have to parse and decrypt the pem file ourselves.
In order to be able to run the linked binary I did this locally:
❌ This needs to be part of the build (for CI). See https://github.com/armanbilge/scala-native-config-brew for reference.