Re: Setting environment variables

Robert Goldman <[email protected]> Wed, 03 May 2023 10:57:46 -0500
Newsgroups gmane.editors.j.devel
Message-ID <[email protected]>
--=_MailMate_513EFDD3-7178-4C33-8883-AF8A8AB7F229_=
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

`ASDF:MAKE` is a wrapper function that can do `LOA=10D-SYSTEM` or other =

things through some complex configuration process. I think the intent is =

to let the user specify that the `MAKE` operation might actually involve =

building an executable, a library, or some other thing (particularly for =

the C-based implementations).

So you could require the `asdf:make` on `"use-posix-syscalls"` to do =

something like build a `.jar` file or some JNI whatchamacallit.

But if it's just going to do `load-system`, I'd encourage you to simply =

tailor the behavior of the `load-op`.  `make` is a new layer of =

complexity, which you should avoid unless you need it.

Best,
R


On 3 May 2023, at 10:30, Mark Evenson wrote:

>> On May 2, 2023, at 21:16, Alan Ruttenberg <[email protected]> =

>> wrote:
>>
> [=E2=80=A6]
>>
>> It's true that I use aio. TBH I've never understood the point of =

>> separating the contribs from the base. File size isn't an issue any =

>> more. What's the upside of splitting them apart? A bit of extra time =

>> indexing the classes in the jar?
>
> From =

> <https://github.com/armedbear/abcl/blob/master/doc/packaging-abcl.org> =

> :
>
> We create two separate jar artifacts in order to:
>     =E2=80=A2 To place an upper bound of size of abcl.jar regardless of=
 what =

> we package in abcl-contrib.jar.
>     =E2=80=A2 Clearly mark which parts of the code-base are covered und=
er =

> GPLv2+classpath from those that may have other licensing terms. By =

> making the loading of =E2=80=9Ccontrib=E2=80=9D a dynamic operation, we=
 defer =

> possible infringement to the User who redistributes the resulting jar =

> artifact.
>
>>
>> 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)
>>
>> I don't know what asdf:make does. I tried it in a situation =

>> (autoloading the java parser when #1 was used the first time) where I =

>> expected it to load a system and it didn't seem to.
>
> ASDF:MAKE is a shorter synonym for ASDF:LOAD-SYSTEM as far as I =

> understand things.
>
>> Would it be sufficient to do something like:
>>
>> (defun ensure-jna-loaded ()
>>   (or *jna-loaded*
>>       (progn
>>         (when (not (ignore-errors (find-java-class =

>> 'jna.nativelibrary)))
>>           (require 'abcl-asdf)
>>           (add-to-classpath (funcall (intern "RESOLVE" 'abcl-asdf =

>> "net.java.dev.jna/jna/LATEST")))
>>           (setq *jna-loaded* t)))))
>
> Probably not:  you really want to depend on the ASDF encapsulation of =

> JNA in 'contrib/mvn/jna.asd=E2=80=99, not the presence of yet another =

> special (=E2=80=9C*jna-loaded*=E2=80=9D).    Since you are requiring =

> ABCL-ASDF:RESOLVE to be present, you can make the assumption that both =

> ASDF and ABCL-CONTRIB have been successfully REQUIREd.
>
> [=E2=80=A6]
>
>> Bottom line is that I don't know how to package this under whatever =

>> the assumptions are when not using abcl-aio
>
> Alright.  I will try to take a stab at this after I figure out the way =

> forward with the Gray streams/SLIME imbroglio.
>
> -- =

> "A screaming comes across the sky.  It has happened before but there =

> is nothing
> to compare to it now."
--=_MailMate_513EFDD3-7178-4C33-8883-AF8A8AB7F229_=
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html>
<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/xhtml; charset=3Dutf-8"=
>
</head>
<body><div style=3D"font-family: sans-serif;"><div class=3D"markdown" sty=
le=3D"white-space: normal;">
<p dir=3D"auto"><code style=3D"margin: 0 0; padding: 0 0.25em; border-rad=
ius: 3px; background-color: #F7F7F7;">ASDF:MAKE</code> is a wrapper funct=
ion that can do <code style=3D"margin: 0 0; padding: 0 0.25em; border-rad=
ius: 3px; background-color: #F7F7F7;">LOA=10D-SYSTEM</code> or other thin=
gs through some complex configuration process. I think the intent is to l=
et the user specify that the <code style=3D"margin: 0 0; padding: 0 0.25e=
m; border-radius: 3px; background-color: #F7F7F7;">MAKE</code> operation =
might actually involve building an executable, a library, or some other t=
hing (particularly for the C-based implementations).</p>
<p dir=3D"auto">So you could require the <code style=3D"margin: 0 0; padd=
ing: 0 0.25em; border-radius: 3px; background-color: #F7F7F7;">asdf:make<=
/code> on <code style=3D"margin: 0 0; padding: 0 0.25em; border-radius: 3=
px; background-color: #F7F7F7;">&quot;use-posix-syscalls&quot;</code> to =
do something like build a <code style=3D"margin: 0 0; padding: 0 0.25em; =
border-radius: 3px; background-color: #F7F7F7;">.jar</code> file or some =
JNI whatchamacallit.</p>
<p dir=3D"auto">But if it's just going to do <code style=3D"margin: 0 0; =
padding: 0 0.25em; border-radius: 3px; background-color: #F7F7F7;">load-s=
ystem</code>, I'd encourage you to simply tailor the behavior of the <cod=
e style=3D"margin: 0 0; padding: 0 0.25em; border-radius: 3px; background=
-color: #F7F7F7;">load-op</code>.  <code style=3D"margin: 0 0; padding: 0=
 0.25em; border-radius: 3px; background-color: #F7F7F7;">make</code> is a=
 new layer of complexity, which you should avoid unless you need it.</p>
<p dir=3D"auto">Best,<br>
R</p>
<p dir=3D"auto">On 3 May 2023, at 10:30, Mark Evenson wrote:</p>
</div><div class=3D"plaintext" style=3D"white-space: normal;"><blockquote=
 style=3D"margin: 0 0 5px; padding-left: 5px; border-left: 2px solid #777=
777; color: #777777;"><blockquote style=3D"margin: 0 0 5px; padding-left:=
 5px; border-left: 2px solid #777777; border-left-color: #999999; color: =
#999999;"><p dir=3D"auto">On May 2, 2023, at 21:16, Alan Ruttenberg &lt;a=
[email protected]&gt; wrote:</p>
</blockquote><p dir=3D"auto">[=E2=80=A6]</p>
<blockquote style=3D"margin: 0 0 5px; padding-left: 5px; border-left: 2px=
 solid #777777; border-left-color: #999999; color: #999999;"><p dir=3D"au=
to">It's true that I use aio. TBH I've never understood the point of sepa=
rating the contribs from the base. File size isn't an issue any more. Wha=
t's the upside of splitting them apart? A bit of extra time indexing the =
classes in the jar?</p>
</blockquote><p dir=3D"auto">From &lt;<a href=3D"https://github.com/armed=
bear/abcl/blob/master/doc/packaging-abcl.org" style=3D"color: #777777;">h=
ttps://github.com/armedbear/abcl/blob/master/doc/packaging-abcl.org</a>&g=
t; :</p>
<p dir=3D"auto">We create two separate jar artifacts in order to:
<br>
    =E2=80=A2 To place an upper bound of size of abcl.jar regardless of w=
hat we package in abcl-contrib.jar.
<br>
    =E2=80=A2 Clearly mark which parts of the code-base are covered under=
 GPLv2+classpath from those that may have other licensing terms. By makin=
g the loading of =E2=80=9Ccontrib=E2=80=9D a dynamic operation, we defer =
possible infringement to the User who redistributes the resulting jar art=
ifact.</p>
<blockquote style=3D"margin: 0 0 5px; padding-left: 5px; border-left: 2px=
 solid #777777; border-left-color: #999999; color: #999999;"><p dir=3D"au=
to">Conceptually, we should somehow place the implementation of setting e=
nvironment variables via the C syscall as a patch in the contrib system i=
n a new contrib called (?) USE-POSIX-SYSCALLS (terrible name, please chan=
ge).  Such a new contrib would a) depend on
<br>
 JNA and b) have to be used via</p>
<p dir=3D"auto">   (asdf:make :use-posix-syscalls)</p>
<p dir=3D"auto">I don't know what asdf:make does. I tried it in a situati=
on (autoloading the java parser when #1 was used the first time) where I =
expected it to load a system and it didn't seem to.</p>
</blockquote><p dir=3D"auto">ASDF:MAKE is a shorter synonym for ASDF:LOAD=
-SYSTEM as far as I understand things.</p>
<blockquote style=3D"margin: 0 0 5px; padding-left: 5px; border-left: 2px=
 solid #777777; border-left-color: #999999; color: #999999;"><p dir=3D"au=
to">Would it be sufficient to do something like:</p>
<p dir=3D"auto">(defun ensure-jna-loaded ()
<br>
  (or *jna-loaded*
<br>
      (progn
<br>
        (when (not (ignore-errors (find-java-class 'jna.nativelibrary)))
<br>
          (require 'abcl-asdf)
<br>
          (add-to-classpath (funcall (intern "RESOLVE" 'abcl-asdf "net.ja=
va.dev.jna/jna/LATEST")))
<br>
          (setq *jna-loaded* t)))))</p>
</blockquote><p dir=3D"auto">Probably not:  you really want to depend on =
the ASDF encapsulation of JNA in 'contrib/mvn/jna.asd=E2=80=99, not the p=
resence of yet another special (=E2=80=9C*jna-loaded*=E2=80=9D).    Since=
 you are requiring ABCL-ASDF:RESOLVE to be present, you can make the assu=
mption that both ASDF and ABCL-CONTRIB have been successfully REQUIREd.</=
p>
<p dir=3D"auto">[=E2=80=A6]</p>
<blockquote style=3D"margin: 0 0 5px; padding-left: 5px; border-left: 2px=
 solid #777777; border-left-color: #999999; color: #999999;"><p dir=3D"au=
to">Bottom line is that I don't know how to package this under whatever t=
he assumptions are when not using abcl-aio</p>
</blockquote><p dir=3D"auto">Alright.  I will try to take a stab at this =
after I figure out the way forward with the Gray streams/SLIME imbroglio.=
</p>
<p dir=3D"auto">-- =

<br>
"A screaming comes across the sky.  It has happened before but there is n=
othing</p>
</blockquote></div>
<div class=3D"markdown" style=3D"white-space: normal;">
<blockquote style=3D"margin: 0 0 5px; padding-left: 5px; border-left: 2px=
 solid #777777; color: #777777;">
<p dir=3D"auto">to compare to it now.&quot;</p>
</blockquote>

</div>
</div>
</body>

</html>

--=_MailMate_513EFDD3-7178-4C33-8883-AF8A8AB7F229_=--