From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id mPQgNKP83V/ZEwAA0tVLHw (envelope-from ) for ; Sat, 19 Dec 2020 13:14:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id +CPwL6P83V/iLQAAB5/wlQ (envelope-from ) for ; Sat, 19 Dec 2020 13:14:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 35C89940438 for ; Sat, 19 Dec 2020 13:14:11 +0000 (UTC) Received: from localhost ([::1]:57886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqc3l-0007Jm-QM for larch@yhetil.org; Sat, 19 Dec 2020 08:14:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42466) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqc3e-0007JE-9g for bug-guix@gnu.org; Sat, 19 Dec 2020 08:14:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57728) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kqc3e-0002ok-2U for bug-guix@gnu.org; Sat, 19 Dec 2020 08:14:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kqc3d-0007w7-UQ for bug-guix@gnu.org; Sat, 19 Dec 2020 08:14:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#45193: Wrapper of Qt programs doesn't extend existing environment variable References: <86wnxns81f.fsf@163.com> In-Reply-To: <86wnxns81f.fsf@163.com> Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 19 Dec 2020 13:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45193 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Zhu Zihao Received: via spool by 45193-submit@debbugs.gnu.org id=B45193.160838360330446 (code B ref 45193); Sat, 19 Dec 2020 13:14:01 +0000 Received: (at 45193) by debbugs.gnu.org; 19 Dec 2020 13:13:23 +0000 Received: from localhost ([127.0.0.1]:41040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqc30-0007uy-3k for submit@debbugs.gnu.org; Sat, 19 Dec 2020 08:13:23 -0500 Received: from mail-out.m-online.net ([212.18.0.10]:33649) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqc2y-0007uo-7x for 45193@debbugs.gnu.org; Sat, 19 Dec 2020 08:13:20 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4CymPq5fLMz1rwb8; Sat, 19 Dec 2020 14:13:15 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4CymPl5wqnz1tYWm; Sat, 19 Dec 2020 14:13:15 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id pEB0yagDA3Ft; Sat, 19 Dec 2020 14:13:14 +0100 (CET) Received: from hermia.goebel-consult.de (ppp-188-174-52-104.dynamic.mnet-online.de [188.174.52.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Sat, 19 Dec 2020 14:13:14 +0100 (CET) Received: from lenashee.goebel-consult.de (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id 60DA060213; Sat, 19 Dec 2020 14:20:22 +0100 (CET) From: Hartmut Goebel Organization: crazy-compilers.com Message-ID: <1cc6eb46-813b-ba3c-f796-30d545f35941@crazy-compilers.com> Date: Sat, 19 Dec 2020 14:13:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------10C834250C9B054ED1837695" Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 45193@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -0.82 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 35C89940438 X-Spam-Score: -0.82 X-Migadu-Scanner: scn0.migadu.com X-TUID: dihlPib/Bi5U This is a multi-part message in MIME format. --------------10C834250C9B054ED1837695 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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 |h.goebel@crazy-compilers.com | |www.crazy-compilers.com | compilers which you thought are impossible | --------------10C834250C9B054ED1837695 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

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          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |
--------------10C834250C9B054ED1837695--