Skip to content
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

Split stklos into lib and binary (so STklos will be embeddable) #263

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jpellegrini
Copy link
Contributor

So we can have an embedable libstklos in the near future. A small patch, as you can see!

I'll work on an example program embedding STklos.

Pending:

  • Don't clutter $PREFIX/include with socket.h, extraconf.h etc.
  • Maybe have three targets, install-base, install-dev and install? (Not sure if this is needed)

So we can have an embedable libstklos in the near future.
@jpellegrini jpellegrini changed the title Split stklos into lib and binary Split stklos into lib and binary (so STklos will be embeddable) Sep 4, 2021
@jpellegrini
Copy link
Contributor Author

One more thing: the binary can't find the library and I had to set LD_LIBRARY_PATH manually. I think there is a way to fix this.

@jpellegrini
Copy link
Contributor Author

An I'd have to study the STkos boot process. I though I knew how it worked, but it's more complicated than my initial understanding.
The idea would be to have something similar to a boot image, but without the REPL, just so the user can load the basic libraries.

@jpellegrini
Copy link
Contributor Author

I haven't given up on this :) I'll try to work on it later... The tricky part is to adjust the boot process.

@egallesio
Copy link
Owner

One more thing: the binary can't find the library and I had to set LD_LIBRARY_PATH manually. I think there is a way to fix this.

The first versions of STklos used this approach (look at the file etc/simple-stklos.c which is here from the beginning, and permitted to use a customized boot image). However, I gave up with this approach, because it was difficult to have a portable way to test STklos without installing it, ans it was a real headache. In particular, LD_LIBRARY_PATH didn't seem to be universally used to denote the places where the library are placed. At the time, STklos was available on a larger number of systems .
Things are a little simpler now, but at least on MacOs, the name of the variable is different (DYLD_LIBRARY_PATH is I remember), and is not passed to subprocesses depending on the security options the user has set. I think that it is important that the make test can be run as a normal user before running make install. However, if you have a solution, it would be really really cool.

@jpellegrini jpellegrini marked this pull request as draft February 13, 2023 15:18
@ryandesign
Copy link
Contributor

So we can have an embedable libstklos in the near future.

I'm surprised because:

STklos/README.md

Lines 14 to 15 in 590c727

Machine. STklos can also be compiled as a library and embedded in an
application.

Is the README wrong?

@jpellegrini
Copy link
Contributor Author

Is the README wrong?

I think @egallesio forgot to remove that part of the README. As he mentioned in this PR, STkos used to be embeddable.

By the way, he explained what the problem is, and if there is a solution then STklos cold be embeddable again...

@egallesio
Copy link
Owner

Is the README wrong?

For now, it is. I have suppressed this sentence from the README. I'll reintegrate it when this will be again possible.
This will be done after v2.00.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants