-
Notifications
You must be signed in to change notification settings - Fork 2
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
Scaling-plan: A scaling plan applied to scale the API for professional use-cases #20
Conversation
…emory leaks when failure occurs and provide anti-failure machanisms
…n Framework Project
…n throwing from the listener dispatch
…file locks before usage by the Java Loader
In addition to the CPUs listed, you may also want to support the 64-bit RISC-V, which must run Java because LWJGL supports it. |
In case this happens again, this exception has been replaced with a Jul 26, 2024 8:09:54 AM electrostatic.snaploader.NativeBinaryLoader cleanExtractBinary
SEVERE: Extraction has failed!
java.io.FileNotFoundException: File locator has failed to locate the file inside the compression!
at electrostatic.snaploader.filesystem.FileLocator.validateFileLocalization(FileLocator.java:97)
at electrostatic.snaploader.filesystem.FileExtractor.extract(FileExtractor.java:110)
at electrostatic.snaploader.filesystem.ConcurrentFileExtractor.extract(ConcurrentFileExtractor.java:74)
at electrostatic.snaploader.NativeBinaryLoader.cleanExtractBinary(NativeBinaryLoader.java:311)
at electrostatic.snaploader.NativeBinaryLoader.loadLibrary(NativeBinaryLoader.java:163)
at electrostatic.snaploader.examples.TestBasicFeatures.main(TestBasicFeatures.java:77) It's reproducible by two ways:
EDIT: |
For automated testing in the jolt-jni project, there's no need to extract files, because they're already present in the filesystem. However, the failures I reported are in the snap-jolt project, which does extraction: https://github.com/stephengold/snap-jolt/blob/f8fc077da82294bd80bbd47da97001101a80bbe6/src/main/java/com/github/stephengold/snapjolt/HelloWorld.java#L59-L74 Sorry for the confusion.
It turns out there's a valid Windows binary in the platform directory, but its name is incorrect: $ jar tf jolt-jni-Windows64-0.3.2-DebugSp.jar
META-INF/
META-INF/MANIFEST.MF
windows/x86-64/com/github/stephengold/joltjni.dll The final component of the path should be "libjoltjni.dll" instead "joltjni.dll". This mistake doesn't pose any difficulty for JME's JSnapLoader's way (specifying only the platform directory) is superior to that of I'll correct the name of the Windows binary in jolt-jni and try again. |
Thanks for this comprehension. So far I will try to provide the |
No, wait! I got it backward:
|
So, should we just selectively remove the prefixed value "lib" before the windows binaries in the |
Yes, I think so: --- a/snaploader/src/main/java/com/avrsandbox/snaploader/platform/NativeDynamicLibrary.java
+++ b/snaploader/src/main/java/com/avrsandbox/snaploader/platform/NativeDynamicLibrary.java
@@ -105,8 +105,8 @@
NativeDynamicLibrary.LINUX_x86_64.library = "lib" + libraryInfo.getBaseName() + ".so";
NativeDynamicLibrary.MAC_x86.library = "lib" + libraryInfo.getBaseName() + ".dylib";
NativeDynamicLibrary.MAC_x86_64.library = "lib" + libraryInfo.getBaseName() + ".dylib";
- NativeDynamicLibrary.WIN_x86.library = "lib" + libraryInfo.getBaseName() + ".dll";
- NativeDynamicLibrary.WIN_x86_64.library = "lib" + libraryInfo.getBaseName() + ".dll";
+ NativeDynamicLibrary.WIN_x86.library = libraryInfo.getBaseName() + ".dll";
+ NativeDynamicLibrary.WIN_x86_64.library = libraryInfo.getBaseName() + ".dll";
}
/* Initializes the library jar path to locate before extracting, "null" to use the classpath */ However, it would also be prudent to provide some mechanism for specifying the full name. |
I can confirm that this correction (in the gamma pre-release) solves the issue with MACOS_X86_64: https://github.com/stephengold/snap-jolt/actions/runs/10114683678/job/27973857208 |
Beware that the classes on the current master are internally different from the current branch; the API has recently undergone a lot of changes, but with preservation of the method signatures, so no breaking changes so far. |
…and Win-OS library names standardizations
Alright, version
|
I've updated my projects to 1.0.0-delta: both the snap-jolt testbed and also automated tests in the jolt-jni project. All tests are passing. The loading code in jolt-jni is rather crude. I'd welcome any suggestions you might have for simplifying or refining it: I'm thinking about how to test jSnapLoader on Linux-on-ARM platforms. I have a 32-bit Raspberry Pi on my desk plus remote access to 64-bit build servers at Travis-CI. Libbulletjme is already built for Linux-on-ARM but jolt-jni currently is not. |
Well, if you have any TestBullets techdemos (on Libbulletjme or even jme3-examples), you could plug them on with jSnapLoader. However, I don't know how you will suppress the JME's NativeLibraryLoader... |
In case you accept contributions, could you activate running the GitHub workflows for PRs against master, please? So, something like: # Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ] Then, we could test the changes remotely on GitHub before merging. |
Good point about suppressing JME's loader. Luckily, I have many Libbulletjme demos and tests that don't use JMonkeyEngine at all. Instead of extracting native libraries from JARs (as Minie, KK Physics, and jolt-jni do), those apps download native libraries from GitHub Releases via HTTPS (because Libbulletjme natives aren't currently available from Maven Central). There's an open issue to publish Libbulletjme natives to MavenCentral. If I solved that, I could use Libbulletjme to test extraction. Ideally I should both solve stephengold/Libbulletjme#12 and publish Linux-on-ARM natives for jolt-jni. Then I could test jSnapLoader extraction on Linux-on-ARM using both libraries. But it's difficult to predict how long those changes might take. A week or two, maybe. Are you willing to delay the stable release of jSnapLoader v1.0 by a couple weeks, to allow for additional testing? |
Yes, sure, I am not on a hurry. Since, the |
I've done so, both in jolt-jni and snap-jolt. |
Thanks! I propose to merge this PR, and continue on forums. |
@stephengold Your contributions are much appreciated! Thank you! |
This PR conclusively adds the following to the core API:
PlatformPredicate
s: provides the ability to append propositions as platform variant {OS + ARCH + INSTRUCT_SET}.SystemDetectionListener
s: detects the system found and not found.ExtractionListener
s: exposes the lifecycle of the extraction process to the user applications.LoadingListener
s: exposes the lifecycle of the native loading process to the user applications.In addition, I have updated the
NativeVariant
propositions to reflect the OS ARCHS; according to ChatGPT, the available architectural propositions are: