Subject: Re: [bug#71109] [PATCH] gnu: vulkan-tools: Wrap binaries with LD_LIBRARY_PATH.

From: Sughosha <[email-masked]>
Date: Fri, 31 May 2024 20:51:44 +0530

On Friday, May 31, 2024 4:08:53 PM IST Ludovic Courtès wrote:
> Hi,
> 
> Sughosha <[email-masked]> skribis:
> > This fixes not finding vulkan-loader.
> 
> Could you show how to test it?
> 
> > +                          (wrap-program file
> > +                            `("LD_LIBRARY_PATH" ":" =
> > +                               (,(getenv "LIBRARY_PATH")))))
> 
> This is probably a bit too broad because LIBRARY_PATH includes
> build-time-only dependencies (python, gawk, binutils, bzip2, etc.).
> 
> Could we explicitly list what needs to be there instead?
> 
> Also maybe change ‘=’ to ‘suffix’ so users can still override
> LD_LIBRARY_PATH.
> 
> Thanks,
> Ludo’.
Hi,
Thanks for your review!

> Could you show how to test it?
Currently if I just run `vulkaninfo`, this error appears:
```
ERROR at /tmp/guix-build-vulkan-tools-1.3.280.0.drv-0/source/vulkaninfo/./
vulkaninfo.h:412: Failed to initialize: Vulkan loader is not installed, not 
found, or failed to load.
```
I don't know if something should be patched before building itself.
But if I run: `LD_LIBRARY_PATH=$(guix build vulkan-loader)/lib vulkaninfo`, 
the program will be executed without any error.

> This is probably a bit too broad because LIBRARY_PATH includes
> build-time-only dependencies (python, gawk, binutils, bzip2, etc.).
If I wrap only with vulkan-loader's library path also, it works. But would it 
be a "right" way of wrapping a program.

> Also maybe change ‘=’ to ‘suffix’ so users can still override
Yes, you are right. I will change it.

-- 
Sughosha