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

Update libcore to support java 8 #514

Closed
PokeMMO opened this issue Aug 27, 2020 · 16 comments
Closed

Update libcore to support java 8 #514

PokeMMO opened this issue Aug 27, 2020 · 16 comments

Comments

@PokeMMO
Copy link

PokeMMO commented Aug 27, 2020

It appears that mobivm is still using an old version of libcore that does not support api's that were added in java 8.

What steps would it take to get mobivm updated to a more modern libcore version? I see there are ~200 RoboVM note comments indicating modifications.

https://github.com/MobiVM/robovm/tree/master/compiler/rt/libcore
https://android.googlesource.com/platform/libcore/

@dkimitsa
Copy link
Contributor

robovm uses libcore from android 4.0.
to get entire RT it would require get together not only lib code project but compile and provide bunch of ext/ components such as crypto, unicode etc. For sure it will require code to be highly adapted to remove unsupported code.
And IMHO it will required much more than 200 adaptations as code base is bigger now.
It seems doable, and probably has better chances than switching to OJDK in question of time budget.

@PokeMMO
Copy link
Author

PokeMMO commented Sep 6, 2020

Do we know who would be willing/able to do this?

@dkimitsa
Copy link
Contributor

dkimitsa commented Sep 6, 2020

hi @PokeMMO,
I spent few days playing around this topic and adapted code just to able to compile level. I was using Android 10 R45 tag as source for everything. To have it running it will require another bunch of hours spent as from runtime differs from what it was during Android 4.4 time. Especially it affects native code that is behind java one.
But I'm optimistic about it and in week or two I should have something to share.
In meanwhile could you please share why you are in hurry with this topic and what is blocking you ?
As probably there is a workaround known.

@PokeMMO
Copy link
Author

PokeMMO commented Sep 6, 2020

I'm not in any hurry, but this would be nice to finally be able to update libgdx and other depending projects to java8 api level. Now that Android can desugar the entire core library.

Personally, I have a project which uses java8 libraries internally which would prevent it from being used on robovm without some manual effort to replace with java7 equvilents.

@LordTylus
Copy link

Hi @dkimitsa,

do you by any change have a very rough time estimate on how long it would take to update Android Lib Core? Our Development team currently works with Java 8 to have Language Features, but we have to be very careful that no one uses any Java 8 API in the shared code libraries because it would break iOS at runtime.

Preferably we even would like to update to Java 11 now that we can use the JDK 12 Build Tools with RoboVM 2.3.10. But that would likely only cause more issues when more recent APIs are not supported yet.

Since you said you were able to compile with Android 10 libs but the runtime is in a crashes-about-everywhere state we were wondering if it is just a matter of a few more weeks, a few more months or even years.

Thank you for your great work and a short reply.

@dkimitsa
Copy link
Contributor

hi
small update on progress:

  • resolved all (hope so) native VM dependencies and APIs
  • currently VM starts and basic test are working (String/Streams/Networking (we have TLS 1.3 now!)
  • debugger also works

Libcore 10 is based on ART and migration of RoboVM to ART is time consuming thing (its better to migrate to OJDK then). So currently its a frankenstein of Dalvik/RoboVM VM with Libcore 10 runtime (and its a mess of OJDK code with old luni libcore).

I plan to prepare a clean branch (as current working tree has tons of quick and dirty hacks to get faster to result) next week and will start to delivering test Idea builds with it for quicker testing/fixing. Even if some part missing/wip.

PS: currently testing on MacOS console target, haven't been compiling for iOS. Linux is out of scope for a moment.

@LordTylus
Copy link

Hello,

thank you for the very detailed update. This sounds like a lot of progress has been made.

Have a nice weekend

@dkimitsa
Copy link
Contributor

dkimitsa commented Oct 6, 2020

have re-integrated 100+ dirty commits into so-so clean branch.
also test builds are available.
more details in the post: https://dkimitsa.github.io/2020/10/06/runtime-update-libcore10/
repo for build, testing, and issues: https://github.com/dkimitsa/robovm-libcore10-smoketest

as its expected to have lot of issues please report to the issue tracker of repository above (specially created for testing)

@LordTylus
Copy link

LordTylus commented Oct 9, 2020

Hello, thank you for your great work,

for evaluation I would like to just build our mobile app with this test version to easily find if there are any issues. Would it be possible to also get either a precompiled Eclipse or Gradle plugin for this evaluation, since I don't have IDEA set up currently? Preferred would be Eclipse, because I could then likely provide sample projects if I find things that are not working.

Would be happy to provide feedback then as soon as possible.

@dkimitsa
Copy link
Contributor

@LordTylus
Hello, probably quickest way would be to build it from source.

@davidgiga1993
Copy link

davidgiga1993 commented Mar 8, 2022

I know this issue is almost 1.5 years old, but was there any update on this? Robovm is the only reason I'm stuck at java 7.5 instead of java 11. Is there any way we can support your on this topic?
Guess this is also somehow related to #556

@davidgiga1993
Copy link

Given that no one replied after nearly a year I guess this this topic is dead?

@dkimitsa
Copy link
Contributor

dkimitsa commented Mar 4, 2023

hi, not abandoned, still one of priorities, hope to have another test build next week (with reflection code adapted)

@davidgiga1993
Copy link

Great! Thank for your feedback!
Btw would it be possible to use graalvm native image as a backend for robovm in the future? That could reduce the complexity and maintenance required on the robovm side. Sadly I'm a bit lacking the understanding on how robovm works internally, especially the binding to the native iOS API.

@congcoi123
Copy link

I appreciate your time @dkimitsa and am looking forward to the test build, was it ready?

@Tom-Ski
Copy link
Member

Tom-Ski commented Aug 18, 2023

Merging into #556

@Tom-Ski Tom-Ski closed this as completed Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants