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

Support building with graal #5126

Closed
yschimke opened this issue May 25, 2019 · 8 comments
Closed

Support building with graal #5126

yschimke opened this issue May 25, 2019 · 8 comments
Labels
enhancement Feature not a bug
Milestone

Comments

@yschimke
Copy link
Collaborator

I think some of the advanced usage of kotlin is tripping up graal. But it seems worthwhile to support particularly in the serverless space.

#5125

Currently failing for me with

$  ./gradlew :okcurl:nativeImage

> Task :okhttp:compileKotlin
e: /Users/yuri/workspace/okhttp/okhttp/src/main/java/okhttp3/internal/Internal.kt: (30, 1): Conflicting overloads: public fun parseCookie(currentTimeMillis: Long, url: HttpUrl, setCookie: String): Cookie? defined in okhttp3.internal in file Internal.kt, public fun parseCookie(currentTimeMillis: Long, url: HttpUrl, setCookie: String): Cookie? defined in okhttp3.internal in file internal.kt
@yschimke yschimke added the enhancement Feature not a bug label May 25, 2019
@yschimke
Copy link
Collaborator Author

I think these are a recent regression, but probably typical with graal and kotlin and using edge cases. It would be good to get a working build showing it is supported.

I can build OkHttp 3.14.1 based apps with graal, so something here has changed.

@swankjesse swankjesse added this to the Backlog milestone Jun 15, 2019
@swankjesse
Copy link
Collaborator

Most likely a Kotlin+Graal issue we’re victim to?

@yschimke
Copy link
Collaborator Author

I might try to get

./gradlew :okcurl:nativeImage

building, land that with a separate build that tells us when broken. Useful for testing anyway. Are you ok with that plan?

@swankjesse
Copy link
Collaborator

Sure. I don't know enough about Graal to understand how this will constrain us, or what benefits we gain from it.

@yschimke
Copy link
Collaborator Author

It's getting adopted by various frameworks e.g. micronauts, and more relevant for fast startup in FaaS models. Support for it generally is more important than okcurl.

Demonstrable performance on a desktop machine for java okhttp

time okcurl/build/graal/okcurl -Djavax.net.ssl.trustStore=cacerts https://api.twitter.com/robots.txt
# Used for Google app indexing. See https://developers.google.com/app-indexing/webmasters/server
User-agent: Googlebot
Disallow:

User-agent: *
Disallow: /

0.03s user 0.02s system 15% cpu 0.303 total

@yschimke
Copy link
Collaborator Author

yschimke commented Jun 15, 2019

I think two main impact of not having clean graal support are

  1. things don't just work, a lot of errors to workaround. But eventually it does work.
  2. Some of the workaround defer work to runtime, and then startup times go from 0.02s to 0.5s etc

@yschimke
Copy link
Collaborator Author

Working with some caveats #5294

  1. need a directory of external libraries, at minimum
  2. Can possibly hackaround and use bouncy castle instead of SunEC
  3. Can disable ECC in client

Otherwise it frequently blows up because server negotiates ECC cipher and then client fails.

@yschimke
Copy link
Collaborator Author

yschimke commented Jan 2, 2020

#5631

@yschimke yschimke closed this as completed Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature not a bug
Projects
None yet
Development

No branches or pull requests

2 participants