On Thu, Feb 24, 2022 at 9:59 AM Patrick Böker <patrick.boe...@posteo.de> 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