Setting environment variables
Mark Evenson
evenson at panix.com
Tue May 2 06:36:09 UTC 2023
> On Apr 30, 2023, at 00:38, Alan Ruttenberg <alanruttenberg at gmail.com> wrote:
>
> Here's what I did: https://github.com/alanruttenberg/lsw2/blob/owlapiv4/util/setenv.lisp
>
> You still can't set environment variables in the parent process, of course.
>
> Alan
>
>
> On Sat, Apr 29, 2023 at 2:25 AM Scott L. Burson <Scott at sympoiesis.com> wrote:
> Hi,
>
> I've been away from ABCL for some time, so I ask your indulgence in case I'm revisiting a familiar issue. I tried (SETF (UIOP:GETENV "foo") "value") and got
>
> Not (currently) implemented on ABCL: (SETF UIOP/OS:GETENV)
>
> On investigation, I see that the JVM doesn't normally support setting environment variables, but there are known ways to jimmy it into doing so: https://stackoverflow.com/questions/318239/how-do-i-set-environment-variables-from-java
>
> Would a PR to add such a hack to ABCL be welcome, or should I just make it a local mod? Or is there another, recommended way of doing this?
A patch for ABCL to add this would be appreciated, but the implementation should somehow be changed to the “standard” load for JNA by the ABCL-ASDF contrib, namely something like
(require :abcl-contrib)
(asdf:make :jna)
As I understand it, Alan’s implementation only works if ABCL-ASDF:RESOLVE is present, meaning it cannot be put “as is” in the base ABCL system. I believe this is possible because the OWL2 application uses the ABCL-AIO build of ABCL which merges abcl.jar which abcl-contrib.jar, but I could be wrong. Conceptually, we should somehow place the implementation of setting environment variables via the C syscall as a patch in the contrib system in a new contrib called (?) USE-POSIX-SYSCALLS (terrible name, please change). Such a new contrib would a) depend on
JNA and b) have to be used via
(asdf:make :use-posix-syscalls)
--
"A screaming comes across the sky. It has happened before but there is nothing
to compare to it now."
More information about the armedbear-devel
mailing list