-
Notifications
You must be signed in to change notification settings - Fork 354
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 for multiple plattforms at the same time #257
Comments
See #261. I'm sorry, but I just don't have the resources to support all the different versions of J2V8 that everyone seems to want. I'm hoping we can find a workable solution where others can help with the maven builds and we can share the artifacts. |
@drywolf : Do you have some thoughts on the matter? If the naming of the library files is distinct (that's why I made that change in the Alpine PR), it should be possible to just create an maven artifact which contains all library files. As I said - I think such an artifact would be very nice for development, as a team with different dev OSes (such as our team) could use the same maven artifact for development (atm it is very nasty for us, since the J2V8 dependency is currently hardwired deeply in an application SDK, which needs to be rebuild locally on non-linux machines. Duh...) |
I have done some research on this (focusing on #188 and #289) IMO there are two problems that need to be solved well:
To get a consistent and reliable library-loading scheme going for the linux distributions and all their subtle differences, I would propose: 1) File naming schemeTo settle on a uniform naming scheme for the native libraries, gcc seems to have this covered well already (see GCC Target triplet structure: gcc -dumpmachine examples:
The structure of a system-triple for the filename of the native library should be less ambiguous, and include all the relevant parts:
examples:
2) LibraryLoader.java implementation:The current implementation of the library loader heavily relies on some Java system properties (os.name, java.specification.vendor, os.arch) to try and figure out which OS is the JVM host. For the fourth part (🤷♂️) of the filename system-triplet ... the clib_env/abi_env .... I think we can just keep an internal table of the most relevant linux distributions and which clib they use, and just return it from there based on which distribution was detected via PPS: The LibraryLoader code should also be able to handle a fallback case, for example when there is a native lib located in the JAR that does not specify the vendor-part, then the LibraryLoader should pick this library if no other fitting vendor-specific library is located in the JAR. This should cover the case if we want to continue to deliver a default linux JAR via maven, but which is mostly only compatible with debian-based derivates. The only thing that I couldn't confirm myself was the file permissions that a "regular" user might have for the @kernle32dll could you please help me out and check what the file permissions on that file are on a usual Linux machine with a user that you would usually use to run your J2V8 software ? PS: is just found this code in a maven plugin that pretty much does exactly what I outlined above, so the general approach seems to be feasable 😄 |
@drywolf Awesome investigation... |
@drywolf : Awesome investigation indeed! I'm all for the suggested naming scheme. At least on my dev machine at work was no As for permissions, it is indeed root owned. But I did not encounter problems reading (cat) from it as a regular user. So I think we should be good with that. Also, as you might have seen in #289 (see this line in particular), I did use a similar trick ( |
Thanks for testing the file permissions @kernle32dll
That's what I also thought, and mentioned in the PPS part above. PS: I meant to say |
Is there any updates on this topic? |
Hey @AlexTrotsenko, While developing http://alicorn.io and https://github.com/alicorn-systems/v8-adapter, I had a similar issue with supporting multiple build environments. On the desktop, my solution was to use Maven profiles; for each platform, I attempt to have Maven auto-detect the platform and use the correct V8 dependency (which you can see in action in the V8-Adapter POM: https://github.com/alicorn-systems/v8-adapter/blob/master/pom.xml#L140). On Android (with Gradle), I exclude the V8 dependency from the normal POM and re-add the .AAR file from J2V8: compile ('io.alicorn:my-project:0.1-SNAPSHOT') {
exclude group: 'com.eclipsesource.j2v8'
}
compile (name: 'j2v8', ext: 'aar') Hope this helps! |
@crahda thanks for suggestions. I will check and try it! |
The J2V8 project will only be providing binaries for Android. Others are free to build and distribute binaries for other platforms. This has been the case for a while now because I haven't had the time to support all the different configurations. Please see #441 for more information. I'm currently in the process of building an |
@irbull So how does one build both 32 and 64-bit ARM binaries for Android into 1 .aar? It's not clear from the existing build system? |
I'll add this to the docs. The way I do it: Then I build for another platform with the I don't run the tets steps here because 1) we've already run all the emulator tests, and 2) I can't seem to get x86 emulator tests running inside a docker container while running on an x86 host. I repeat this for the other platforms: This produces an |
I've re-opened this issue as a TODO to update the docs. |
Hi,
currently development on our local machines is a bit of a hassle, since we have developers use all kind of OSses, e.g Linux, macOSX and even Windows. So looking at the latest build refinements in J2V8 - would it be possible to provide a maven artifact, which contains all the lib files for all supported platforms? From what I can tell the lib loader should be able to handle that.
In hindsight it would also be nice to have a "core" image, which does not contain any lib whatsoever, and instead relies on the platform to provide one (#252).
The text was updated successfully, but these errors were encountered: