-
Notifications
You must be signed in to change notification settings - Fork 298
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
#73 Scala Native Curl based backend #105
Conversation
Looks really promising, thanks for your work! Do I understand correctly that no tests are runnable currently? If so, maybe instead of moving them, the native subproject could override the test sbt settings, remove the dependency on scalatest and switch off the tests (at least until scalatest-native is there)? |
221d035
to
321bbc4
Compare
6d0491d
to
89a393e
Compare
I have started using Curl based encoder (89a393e) but I'm still having one test failing:
but when I run |
2f4ff8b
to
f9fae9c
Compare
Ah see, curl is yet another backend which doesn't support IDN domains ;) But I suppose if the IDN Java class is not available, there are only two possibilities: (1) copy its functionality into our codebase (2) live with the fact that - at least for now - IDN domains won't work :) |
I have just added test of the backend, but because of the Native scalatest status: At this moment, the main feature left is request body support. |
Would it be easier to use libidn instead of copying Maybe the test problem is caused by native ScalaTest not handling tests that return futures? Does uTest (only testing library that seems to have a released native version) have the same problem? |
@guymers - I've just added IDN based on |
bb1d714
to
0610f7b
Compare
I have just added significant part of tests that I was able to transfer from shared |
I have just bumped Scala Native version to 3.8 and removed encoding based on Curl, since @densh Thanks for the explanation. I'll experiment around async tests. |
@pcejrowski I wanted to convert the tests to a synchronous version, however this won't work with scala.js, as it's single-threaded and the only way to do something in parallel there is to work with So if it turns out it's not possible to use |
@adamw yeah, I have been playing around |
@pcejrowski let me know how it goes - I can either merge the PR as is, or wait for the results of your trials :) |
@@ -29,6 +29,13 @@ val commonJSSettings = Seq( | |||
} | |||
) ++ browserTestSettings | |||
|
|||
val commonNativeSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq( | |||
organization := "com.softwaremill.sttp", | |||
scalaVersion := "2.11.12", |
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.
So scala native is based on 2.11? What about 2.12?
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 is no 2.12 support.
2.12 support is tracked here: scala-native/scala-native#233
|
||
import scala.concurrent.duration._ | ||
|
||
trait SyncHttpTest |
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.
If this test stays as-is (copy-pasted), maybe you could add a comment explaining why it's copied and how to add how the tests cases differ from HttpTest
@adamw |
@pcejrowski do you maybe know why I'm getting
when trying to run the tests locally? (macos) |
|
@pcejrowski though now I've got another one :) I installed
as specified on http://www.scala-native.org/en/latest/user/setup.html, but now I get:
Any pointers maybe where to look? |
You need to install idn library using homebrew probably. |
@adamw Congrats on your first contact with Scala Native :)
|
@densh Thanks, trying :) |
@densh @pcejrowski new errors:
:) |
I think you might have an old version of Curl. I have |
Curl is required in version |
Ok, I've got curl 7.61.0, I've updated the |
The brew message says that:
so maybe I need to pass those flags to the compiler somehow? |
helped :) |
@pcejrowski I've updated the I've also updated the README to include instructions on building with the scala-native backend. |
Because the native backend setup is non-trivial, I've changed the default build not to include the native backend in the aggregate project by default. To include it, the I'll be back on Tuesday :) |
#73 This is Curl based backend for Scala Native.