-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement loading of libpost4jni
and post4.p4
bundled with the Post4.jar.
#72
Comments
|
It doesn't I suppose, but bundling native code libraries with the .jar file makes sense. Also there are the .p4 files (post4.p4, other useful .p4, and examples). Bundling everything in the .jar (aka .zip file) allows Post4.jar to be distributed separately from the CLI version. Since it is a .zip file I suppose I could just include instructions to manually extract a lib directory into a suitable location and avoid the extra code overhead and then let the user set POST4_PATH.
What if the .jar file lives in a system or package directory? The user might not have permissions. I'm not entirely certain yet how Post4 should be distributed.
I am leaning to separate CLI package and Java package; to be determined (by any chance do you know Judo, throw darts? Maybe rock-paper-scissors-spock-lizard) |
Then this .jar file should have the command line option
If I'm using a Forth system not through the operating system's package manager, I just do I will have a question about distribution only if I want to share my program that runs via Post4.jar and should not require a separate Post4 download.
No, I don't know 🤣 |
Not sure how that would work. A .jar file is not executable (well on Windows you can create an association to start it via Java). I suppose |
It seems that the distributed jar file must be unpacked anyway in order to run the Forth system, and the only question is when to do it. Then using For distribution, If you still want to pack them into a jar file, then pack both |
Well I could save a whole lot of code and angst and just give manual instructions. |
Automatic JIT unpacking makes sense when you distribute an executable that unpacks the files into a temporary directory and immediately launches a child process. But the cost is that it does the unpacking every time it runs. |
Well the code could also detect if the files have been unpacked before. Anyway, first go around will be with either a Makefile from the repo or instructions from separate download. Though I'm all about source based installs (old school). I can leave package installs up to OS distros probably. |
Next going to look at adding the class path |
Class path might impossible: you need class path to find the class that would update class path; maybe a root class? Chicken, egg, fry pan 🍳 |
So in production deployment
java --jar Post4.jar
needs to extract the necessarylibpost4jni.so
,post4.p4
, and any other supporting files some place. Java doesn't appear to automagically pull resources from the .jar file itself (which seems weird and short sighted).Ideally I'd prefer to unpack into
/usr/local/lib/post4
, but that has permissions and version conflict issues, that/usr/local/lib/post4
should be reserved for the CLI version ofpost4
installed by root.Thus for the user its probably safer to unpack support files in
$USER/.post4
,$USER/.post4/lib
or$TMPDIR/$USER/post4
.The text was updated successfully, but these errors were encountered: