Re: How to reset ENV
[email protected] (Roderich Schupp) Thu, 24 Feb 2022 11:01:40 +0100
| Newsgroups | perl.par |
|---|---|
| Message-ID | <CAC9r9zYkGH4kNYNteM5LxYO_6+9Be4NCKMdm_29ub7UQzsCVeg@mail.gmail.com> |
--000000000000d97a2e05d8c0ab06 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Feb 24, 2022 at 9:59 AM Patrick B=C3=B6ker <[email protected]= e> wrote: > Rakubrew can act as a shim wrapper that forwards its call to other > programs. > I consulted the rakubrew.org page, but failed to understand the shim mode. What does it do? And what role plays the PAR packed rakubrew executable in "forwards its call to other programs"? PAR modifies several environment variables amongst others > DYLD_LIBRARY_PATH. I > suspect that the change to DYLD_LIBRARY_PATH can have unwanted side > effects for > the called program with respect to dynamically loading C libraries. > ... side effects when a packed executable execs or spawns some other executable? This executable will inherit the DYLD_LIBRARY_PATH (which has a component that points into the cache directory where the packed executable has extracted itself into). Thus I'd like to make Rakubrew reset the environment to its original state > before doing the final "exec". Could this cause problems for the packed rakubrew executable itself? I don't think so, though I don't know the details of how MacOS and Windows load DLLs. On Linux the dynamic loader reads and caches environment variables, in particular LD_LIBRARY_PATH, at the start of program execution. Hence changes to LD_LIBRARY_PATH during the program's execution don't have any effect (for the program itself). Cheers, Roderich --000000000000d97a2e05d8c0ab06 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr">On Thu, Feb 24, 2022 at 9:59 AM Patrick B= =C3=B6ker <<a href=3D"mailto:[email protected]">patrick.boeker@po= steo.de</a>> wrote:<br></div><div class=3D"gmail_quote"><blockquote clas= s=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid r= gb(204,204,204);padding-left:1ex">Rakubrew can act as a shim wrapper that f= orwards its call to other programs. <br> </blockquote><div><br></div><div>I consulted the <a href=3D"http://rakubrew= .org">rakubrew.org</a> page, but failed to understand the shim mode.</div><= div>What does it do? And what role plays the PAR packed rakubrew executable= in "forwards its call to other programs"?</div><div><br></div><b= lockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-le= ft:1px solid rgb(204,204,204);padding-left:1ex">PAR modifies several enviro= nment variables amongst others DYLD_LIBRARY_PATH. I <br> suspect that the change to DYLD_LIBRARY_PATH can have unwanted side effects= for <br> the called program with respect to dynamically loading C libraries.<br></bl= ockquote><div><br></div><div>... side effects when a packed executable exec= s or spawns some other executable? This executable will inherit the DYLD_LI= BRARY_PATH (which has a component that points into the cache directory wher= e the packed executable has extracted itself into).</div><div><br></div><bl= ockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-lef= t:1px solid rgb(204,204,204);padding-left:1ex"> Thus I'd like to make Rakubrew reset the environment to its original st= ate <br> before doing the final "exec".=C2=A0</blockquote><div><br></div><= div>Could this cause problems for the packed rakubrew executable itself? I = don't think so, though I don't know the details of how MacOS and Wi= ndows load DLLs. On Linux the dynamic loader reads and caches environment v= ariables, in particular LD_LIBRARY_PATH, at the start of program execution.= Hence changes to LD_LIBRARY_PATH during the program's execution don= 9;t have any effect (for the program itself).</div><div><br></div><div>Chee= rs, Roderich</div></div></div> --000000000000d97a2e05d8c0ab06--