Add skija 1.7.0 to eclipse-sdk target#1
Conversation
62c07f1 to
3cccba4
Compare
|
For my SWT-Skija bridge currently only windows and linux for x86 are supported, so these are sufficient. |
|
For RCP libraries we nowadays rely on the automatic JAR to bundle conversion via the target platform. Can this also be used here? |
|
Yes, Orbit relies heavily on bundlizing non-OSGi maven dependencies: https://github.com/eclipse-orbit/orbit-simrel/blob/main/maven-bnd/tp/MavenBND.target These are the expectations from a SimRel point of view:
What folks do in a branch that is not feeding into production code is their business but if this is going to be part of production code, as is suggest by the correspond PR on master then, there are processes to follow. |
|
So to use the Skia libraries we must add it to https://github.com/eclipse-orbit/orbit-simrel/blob/main/maven-bnd/tp/MavenBND.target to avoid using the same BSN? |
|
The platform consumes the following things from Orbit for various reasons: E.g., not available in the required form in Maven, not available in any proper form in Maven, not available as a bundle in Maven, not natively signed (e.g., Windows and macos shared native libraries, e.g., dll) in Maven. I really don't know the "long term" plan around these libraries, which architectures are to be support, long term, how this is shipped, and by whom it will be used. I see it was recently changed to not copy the libraries into another bundle and I don't know why that was changed either. Many question... |
|
cc @HeikoKlare |
|
Just an information about Skija. There are multiple jar files:
So if code signing of native binaries is the problem, Maybe it is possible that SWT builds the Skia binaries themself and only uses the Skija-jars Shared and Types. In the long term it is the question whether SWT wants to rely on Skija at all or if we build Skia binaries and use FFM-API. |
|
To summarize my understanding: attaching OSGi metadata to all the required JARs is something we can do with the according PDE/Tycho tooling via Orbit. The challenging parts seems to be signing the native libraries together with the creation of OSGi metadata for the jar containing them. @merks you say:
Can you shortly explain why you say "should" (and not "must")? I am asking because Skia is supposed to be integrated as an experimental feature to SWT, so that it becomes easy to try out and can be incrementally developed (in best case to fully production-ready state) within the production code. Of course we all hope that we reach production-ready state, still, depending on the results of that testing and development, the feature might be removed again. |
|
People don't necessarily notice if a *.dll isn't signed, but in the end, someone will come and complain that their ultra-awesome security tool is flagging unsigned native libraries. It's worse on macos because one cannot notarize a product that contains a library that contains a native macos library that is not signed. That's why we have this: When I looked at it later in detail yesterday I saw it said this: So it might well be the case that I can simply use a non-OSGi artifact with native libraries here and both bundlize it and sign the nested native libraries. I'd need to experiment but if that's the case the problem is much reduced. As as an outlook, if all goes relatively smoothly, it's maybe only a day of work or maybe less even. I am generally very careful to look at the OSGi metadata in the actual jars being produced to make sure they are sensible. I've had to manage the budget very carefully, often deferring tasks, because it generally runs out extremely quickly. That's why I wanted to be sure what path we are on here before I invest that effort. I guess this is sort of blocker and I might consider to prioritize this higher ASAP? |
|
I have all the wrapping stuff working but I don't know how exactly the libraries will be loaded from the OSGi runtime bundle. I believe this is doing the loading. https://github.com/HumbleUI/Skija/blob/master/shared/java/impl/Library.java This suggests to me that the bundles with the native libraries need to be fragments of the shared host bundle. So I'd need to synthesize something similar to this which is pretty straight forward:
I'd also need a filter like this in each fragment, which hopefully I can do patterns via a single set of instructions for the different natives:
I'm really not sure yet how to test that what I generate actually works properly... Do you have any insights about how this is expected to work as OSGi bundles to speed up my investigation? If not, even just some clue on some simple thing I might try that would only work if the native library is loaded. I'll be out of office soon for the next few hours... |
|
@merks The org.eclipse.swt.skia plugin has the common and the OS parts (win/x86 and linux/x86) as dependency. Then at runtime the shared Layer just loads the library which is supported for the currently running OS and architecture and ignores the other one. The only disadvantage of this approach is the size of the not used OS dependent parts. So with the experimental state i would recommend to just create one OSGi runtime bundle with the shared, types, (win/x86 and linux/x86) dependencies and make it OS independent. This minimizes work and the org.eclipse.swt.skia plugin can work with that. @HeikoKlare Your opinion? |
|
That part is all clear. The point though is how exactly will the shared bundle load native libraries from the separate native bundle/fragment in an OSGi runtime? That works differently and is more complex than when these are just jars on a flat classpath. In the worst case, I’ll make an educated guess and we can refine it later. And it won’t actually matter if you initially use them as plain old jars with a standalone (non-OSGi) launch. |
|
From what I know about the mechanism of adding OSGi metadata to Maven artifacts, it's easiest (if not limited to) making bundles out of the existing Maven arfiacts, i.e., not combining multiple Maven artifacts to a new bundle. To the best of my knowledge, that would require a dedicated Maven build that produces kind of a fat jar and deploys it to some Maven repository. Ed's proposal of adopting the SWT structure for the Skia dependencies sounds reasonable to me: have a shared host bundle and make fragments out of the Jars with the native libraries with proper platform filters. @merks is it easy to implement that with Orbit and try it out, or should we locally create and test the bundles/fragments that we would expect from the process, so we don't invest too much into the automation now that we don't know for sure yet if that's what will finally work. |
|
BND is very expressive so none of these things are all that challenging. At this point I only need to augment what I already have working to add the two headers for the native fragments. I’ll continue when I arrive at my destination in a few hours. Is there some simple snippet I might try from an OSGi launch as an early smoke test? That would help quite a bit. |
|
In the org.eclipse.swt.examples plugin you can run: SnippetCanvasCompare |
|
One more info: |
|
I created this issue which includes details of what's been added to Orbit: The aggregation table shows the new content: https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/table.html
Those new bundles and fragments are available in this update site https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/nightly/latest You can change the following Place it here:
These will be available:
Note that a bunch of iplab issues were opened and will need to be reviewed. Please test and report any problems or concerns here: Once we you give the green light on that issue I will build a milestone repository with that content. |






Required for:
eclipse-platform/eclipse.platform.swt#3231 (comment)