Subject: Wrapper of Qt programs doesn't extend existing environment variable

From: Hartmut Goebel <[email-masked]>
Date: Sat, 19 Dec 2020 14:13:11 +0100

Zhu Zihao wrote

> When building QT program, Guix builder populates qt related 
> environmentvariable, and wrap-qt-program just record it into wrapper.
>
> However, the wrap behaviour in qt-build-system is quite different, 
> itsearch all inputs and mark them should be included in envvar 
> definitionif correspond directory exists.

This will have the same result in must cases:

The environment variables used in qt-utils are defined as 
"native-search-paths" by some package. So these variables will be set 
when creating the build environment, based in the inputs. So if the 
package does not touch these variables, the output should be the same 
(beside perhaps the order).

When using the environment-variables, this would allow the package 
definition to remove unwanted parts. Nevertheless this is cumbersome 
(fetching the input, string-append, manipulating the variable value). 
And AFAIS none of the pacakges using wrap-qt-program does this.

I agree that leaking the environments variables from the build 
environment to the package is not a good idea. Also we might want to add 
some filters to avoid all imports (including cmake) are going into the 
wrapping variables - which is much easier when dealing with inputs nor 
strings.

> Another difference is, wrap-qt-program will include the directory 
> ofoutput in envvar but qt-build-system won't do.

If I understand the code correctly,  line 103 of qt-build-system also 
handle the output directories

                              (append (list directory)
                                      input-directories))))

and the qt-build-system should even handle different outputs (while 
qt-tuils does not):

   (for-each handle-output outputs)

(I may be wrong on this, please double check.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          [email-masked]                |
|www.crazy-compilers.com  | compilers which you thought are impossible |