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

Missing Ktor HTTP Client For Linux #479

Closed
napperley opened this issue Jul 16, 2018 · 8 comments

Comments

Projects
None yet
4 participants
@napperley
Copy link

commented Jul 16, 2018

Ktor's HTTP client library has ports for multiple platforms. There is no Kotlin Native Linux port (incl amd64 and armv7). Having a port would provide the following advantages for Kotlin Native programs targeting Linux (amd64/armv7):

  • Lower maintenance (only need to deal with ARC for memory management, instead of dealing with manual memory management via C interop)
  • Decreased learning curve (using Kotlinic style APIs that Kotliners are used to, and makes interop seamless)
  • Increased ROI (can use the core APIs on other platforms that the Ktor HTTP client library supports)

There is a Serverless Function project using Kotlin Native (targets Linux amd64) that would be a good use case for the port.

@e5l e5l added the feature label Jul 16, 2018

@e5l e5l self-assigned this Jul 16, 2018

@e5l

This comment has been minimized.

Copy link
Contributor

commented Jul 16, 2018

Hi, @napperley. Thanks for the request.
We'll consider adding Linux-engine implementation in near future.

@luca992

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2018

@e5l Is there any technical reason you guys are only generating a native framework for ios? Or is it just that you guys haven't gotten around to it yet? I was able to compile a Klibrary targeting macos_x64 without a problem with the eap13 branch.

@napperley

This comment has been minimized.

Copy link
Author

commented Sep 11, 2018

Is there any technical reason you guys are only generating a native framework for ios? Or is it just that you guys haven't gotten around to it yet? I was able to compile a Klibrary targeting macos_x64 without a problem with the eap13 branch.

What does MacOS have to do with Linux?

@luca992

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2018

@napperley Well sorry, I haven't actually tested setting the target to linux_x64 yet. But I am assuming that will also work just fine. Only reason I brought up compiling for macos is that it also is not targeted... So I am thinking Linux is not targeted for the same reason macos is not targeted.

@e5l

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2018

Hi, @luca992.
I'll test the macos_x64 target and publish the artifacts if everything is fine.

Unfortunately, Linux x64 target wouldn't work for now.

@luca992

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2018

@e5l
I see, too bad. Is windows support also a definite no for now?

Well regarding macos, while I can compile a klib that targets macos_x64... my actual http requests are not working.

I have tried a simple program like:

import kotlinx.coroutines.runBlocking
import io.ktor.client.engine.ios.*
import io.ktor.client.*
import io.ktor.http.*
import io.ktor.client.request.*


fun main(args: Array<String>) = runBlocking<Unit> {
    val client = HttpClient()
    val htmlContent = client.get<String>("https://en.wikipedia.org/wiki/Main_Page")

    println("$htmlContent")
    return@runBlocking 
}

it hangs at client.get<String>("https://en.wikipedia.org/wiki/Main_Page")

I can make a seperate issue for macos if you would like

@e5l e5l added this to the 1.1.0 milestone Dec 5, 2018

@cy6erGn0m

This comment has been minimized.

Copy link
Contributor

commented Dec 18, 2018

Should be fixed in #777

@cy6erGn0m cy6erGn0m modified the milestones: 1.1.0, 1.1.1 Dec 24, 2018

@e5l

This comment has been minimized.

Copy link
Contributor

commented Jan 11, 2019

Merged in master

@e5l e5l closed this Jan 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.