flatpak / freedesktop-sdk-images

Flatpak freedesktop 1.6 runtime. Note: New development is at https://gitlab.com/freedesktop-sdk/freedesktop-sdk
29 stars 33 forks source link

OpenJdk extension #30

Closed adityashah1212 closed 7 years ago

adityashah1212 commented 7 years ago

I wanted to add a jre extension to freedesktop platform and a jdk extension to freedesktop sdk. Though I am not sure if, they should be extensions or separate runtimes based on freedesktop runtime/sdk. Also as I mentioned in #28 ALSA's rawmidi support is needed to build OpenJdk8.

barthalion commented 7 years ago

I don't think it makes much sense to have OpenJDK extension point as it should be possible to get it build in runtime/app instead.

alexlarsson commented 7 years ago

Yeah, i don't really think extensions should be used to recreate package dependencies. Also, jre:s are tricky things, apps often depend on a specific version.

adityashah1212 commented 7 years ago

I understand, though we could still have java6, java7 and java8 as separate runtime right?

barthalion commented 7 years ago

Maintaining a runtime is a huge commitment, pretty much synonymous with own distribution (slightly less if based on other runtime but still…). Something like a base app sounds better for this use case, if duplication is unwanted.

alexlarsson commented 7 years ago

That, or just shared Json. That is likely to be deduplicated anyway.

adityashah1212 commented 7 years ago

I was trying to compile openjdk, and realised that we need a boot-jdk. Compilation guide redirects to oracle jdk website. I think this might become a hindrance for application developers.

adityashah1212 commented 7 years ago

I intend to work on this, this weekend... So what do you guys suggest, go with base app (which by my understanding would become an app on repo whose binaries would become a part of the developers app) or shared json.

Also there are a couple of concerns I have what about the security updates released by java with every uXXX version, how do we provide them? We can't have rebuilds every time a new uXXX comes out.

Also we have two use cases here (1) Applications like eclipse running on java, thus a core requirement (2) Applications like libreoffice which would only require java for plugins

adityashah1212 commented 7 years ago

Hey guys, whenever I try to compile openjdk8 it gives this error, it is basically failing to copy the files. Any ideas ## Starting install Installing jdk image into /app/lib/java/jvm/openjdk-1.8.0_141-flatpak and creating 41 links from /app/lib/java/bin into the jdk. /usr/bin/cp: failed to preserve ownership for /app/lib/java/jvm/openjdk-1.8.0_141-flatpak/jre/lib/amd64/server/libjsig.so: No such file or directory make[1]: *** [BuildJdk.gmk:131: install] Error 1 make: *** [/run/build/openjdk8//make/Main.gmk:154: install-only] Error 2 Error: module openjdk8: Child process exited with code 2

mrmcq2u commented 7 years ago

This is confusing me as well but from perspective of dart and flutter sdk's. For an sdk that supports multiple editors is the correct way of doing things to build flatpaks of said editors/ide's with the sdk's bundled in. Gets even more confusing when we are talking about two sdk's required like android sdk and flutter sdk. Is it best to just stick with distro packaging for this?

alexlarsson commented 7 years ago

@adityashah1212 That error should be fixed with ostree 2017.11 (it was due to https://github.com/ostreedev/ostree/pull/1137)

alexlarsson commented 7 years ago

@mrmcq2u Yeah, bundling an extensible thing like an IDE is complicated. The way e.g. gnome-builder does it is that the IDE itself uses flatpak to build in, so it doesn't need to have all the tools required for building things in its own bundles.

adityashah1212 commented 7 years ago

Thanks @alexlarsson. As far as aarch64 is concerned we could use AdoptJdk builds for bootjdk. Also about whether to package as baseapp or as common modules, I think we need both. So that baseapp can be used in case of simple applications based on only one runtime, while still having ability to use common modules if more jdk are needed.

alexlarsson commented 7 years ago

@adityashah1212 That doesn't seem to have any 32bit builds (arm or intel)

alexlarsson commented 7 years ago

@adityashah1212 As for baseapp, the sdk extension i created at: https://gist.github.com/anonymous/c5a4780604949256c4ee146403f8826d has a install.sh script which bundles the jre in the app. All the app has to do is run this and set up the PATHs, then java in the bundled app should work. And since the copy is bitwise identical it will be shared between bundlers of it (that use the same extension build).

adityashah1212 commented 7 years ago

@adityashah1212 That doesn't seem to have any 32bit builds (arm or intel)

Yeah, I know... I was only talking about aarch64.

So that baseapp can be used in case of simple applications based on only one runtime, while still having ability to use common modules if more jdk are needed.

What I meant here is, we should have both alternatives, so if in case an app needs multiple jre/jdk it have them by using one as baseapp and other from common modules

adityashah1212 commented 7 years ago

Sorry by mistake hit close

alexlarsson commented 7 years ago

@adityashah1212 A base app is essentially identical to copying the files from a sdk though, so if doing that is easy i see no reason to do the base-app version too.

adityashah1212 commented 7 years ago

I understand that and agree with you, but what I am saying is we should have both prebuilt jdk on repo and a json in common modules so the developer is able to choose multiple jdks in case of need, since I think we may need to support multiple versions of jdk such as 1.6, 1.7, 1.8 and now even 1.9.

alexlarsson commented 7 years ago

https://github.com/flathub/org.freedesktop.Sdk.Extension.openjdk9

koppor commented 5 years ago

Since Google leads to here when googling for flatpack jdk jre openjdk, here the most recent link (as of today):

SDK Extension for OpenJDK 11 --> https://github.com/flathub/org.freedesktop.Sdk.Extension.openjdk11