-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
ENHANCED: allow user:exception for missing shlibs, save dependencies #429
base: master
Are you sure you want to change the base?
ENHANCED: allow user:exception for missing shlibs, save dependencies #429
Conversation
This patch allows the user to load a shared library from the network or from the saved state by means of writing the user:exception hook. It also provides qsave_foreign_libraries/4 to retrieve foreign libraries (for a compatible architecture) from the saved state. This makes it easier to implement the user:exception hook, while abstracting from the internal naming of the shared libraries in the saved state. Accordingly qsave_program/2 is also enhanced to store dependencies for the main shared library. Test cases are also provided.
oops...forgot to update the documentation for qsave_foreign_libraries/4, it now returns a I'll submit a patch later. |
BTW, the |
Probably not :( Most of this stuff is really old ... |
Would you like me to submit a patch for it? |
Please! |
done in d3f9bc1 , but ..perhaps you wanted a separate PR .... Edit: just wanted to point out that |
Sorry this is taking so long. Bit busy and I think this pull request is largely good, but there are some things that need some additional thought. One issue I'd like to share now is the use of atom_to_term/2 to add fancy names to the ZIP files. Although I'm not entirely sure, you introduce terms '$shlib'(...) which results in really ugly ZIP file names, right? I propose to turn these into normal paths, so people can (dis)assemble them using |
Yes, I didn't like the names either... the entry name needs to allow reconstruction of the alias/path and needs to encode the following information:
Of course What do you think? |
Looks ok to me. Not sure I like all the $. They are probably needed to avoid ambiguity, but they do not make it easier to manage the zip files using shell scripting. There are not many good alternatives though. Let us try and see. |
OK, will get to work on it. |
BTW, from http://www.swi-prolog.org/pldoc/man?section=res-declare
We could use : also. Perhaps something like |
Windows file names are not allowed to containt |
Ok. thanks. |
d3f9bc1
to
9ce4881
Compare
Ok, here are the fixes:
|
Great! Bit busy, so I cannot make promises. This is surely going to be reviewed and merged though. Guess you can continue your Android work with your branch anyway? |
Yes, so far I can continue with my branch. I also have some patches for Jpl so that it loads on the Android JVM, but I don't think they are ready for a PR, the JPL c code is a little bit messy, and I am trying to make the least changes as possible. |
It would need a big rewrite turning 99% of the macros into functions ... |
BTW, they are doing a major rework in the termux project, so they are not adding SWI Prolog to the main repo for now (they've put it in the unstable repo); so I think we just wait and keep using our current method until it gets into the main repo. |
We have some extra deps in
|
Is used by
Minizip provides the archive functionality on top of the compression library |
Sorry this takes so long. As a prove I do not want to let this slip I rebased the branch after fixing merge issues to It is a quite complex patch and there are some issues with it. One is the testing. As is, this modifies the source tree. That is not allowed in a proper CMake build. So, these build products must be created in the build directory, most likely in I also have my doubts about the way you deal with errors. Asserting and delaying them seems highly dubious. There is surely room for enhancing error processing during processes like this, which also causes problems in the compiler. Roughly, I think we need three options depending on a flag:
For now, for qsave, I propose to simply propagate the error for fatal issues and print them otherwise, just as the compiler does. |
Thanks, it will be a bit since I get back to work back on this, I lost a bit of the energy I had going.
ahh, yes, the .so files are created at build time in the source dir...they need to be moved..
That was in the original code, so I just followed the pattern to make as few changes as possible. I don't like it much either.
Yes, I think these are good ideas. |
This patch allows the user to load a shared library from the
network or from the saved state by means of writing the
user:exception hook.
It also provides qsave_foreign_libraries/4 to retrieve
foreign libraries (for a compatible architecture) from
the saved state. This makes it easier to implement the
user:exception hook, while abstracting from the internal
naming of the shared libraries in the saved state.
Accordingly qsave_program/2 is also enhanced to store
dependencies for the main shared library.
Test cases are also provided.
Implements what was discussed in #425 and #427