Received: (at 76428) by debbugs.gnu.org; 31 Mar 2025 16:43:02 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 31 12:43:02 2025 Received: from localhost ([127.0.0.1]:42629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tzIE1-0002yv-0a for submit <at> debbugs.gnu.org; Mon, 31 Mar 2025 12:43:02 -0400 Received: from ditigal.xyz ([2a01:4f8:1c1b:6a1c::]:47242 helo=mail.ditigal.xyz) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <rutherther@HIDDEN>) id 1tzIDy-0002xh-Dx for 76428 <at> debbugs.gnu.org; Mon, 31 Mar 2025 12:42:59 -0400 Received: by cerebrum (OpenSMTPD) with ESMTPSA id e093737a (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Mon, 31 Mar 2025 16:42:51 +0000 (UTC) From: Rutherther <rutherther@HIDDEN> To: =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN> Subject: Re: [GCD deliberation] Set search paths without program wrappers In-Reply-To: <87a59hdskx.fsf@HIDDEN> References: <87r03s6mtt.fsf@HIDDEN> <87a59hdskx.fsf@HIDDEN> Date: Mon, 31 Mar 2025 18:42:49 +0200 Message-ID: <87tt791792.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ditigal.xyz; i=@ditigal.xyz; q=dns/txt; s=20240917; t=1743439371; h=from : to : cc : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=rKbvAHWlys/FuhlAoRQCeo3wUn/1nuTr0Rmv8xG/SUc=; b=HjT6CxErM9PIseW3pkfwn3jg+mMAZwAfkJlUPCOf2U1SrOGfr3m0WBPQ9I6uCweqGNaQ7 9JYTS5jgUslEDWJn3DQWBH5sTvA3S9cOcs2jVNincA23O6BDsIcOnuFfMNFS1ywwaOwfSWg xlSSydzcGSA9DFiBD2ilu3L2hHfTOS0= X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 76428 Cc: 76428 <at> debbugs.gnu.org, guix-devel@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.5 (/) Hi, I am missing any mention about the current etc/profile file inside of built Guix profiles. Is it planned to also change the function of the search paths in profiles? Because for example currently it can happen that GIO_EXTRA_MODULES will get set, because dconf is propagated into the profile, and this can break, even on Guix system, the expected so files used. The home profile packages can pick up the system so files and when the home profile hasn't been rebuilt yet, you get crashing programs. I think this means the env var needs to get effectively replaced instead, or not set at all by the profile's etc/profile file. This seems to be quite 'common' (after there start to be ABI incompatibilities, it's common for users to go asking in the irc channel about this) when libdconfsettings.so ends up in one of the search path folders. 1. After this change, are packages still going to respect the env var as well, or will the ones patched and having etc/search-path.d just ignore them completely? (replace v prepend) And if they won't ignore them, how is this incompatibility outlined higher going to be fixed, if anyhow? 1(b). What if user combines the profiles? For example, I will install python and python-numpy to system profile, then python and python-matplotlib to user profile. When I start python, which search path is actually used? Currently both are as the env var is just merged, but it doesn't seem to be possible to me with etc/search-paths.d (at least unless the various search-paths.d folders are going to be in an env var, but I think that would go against the motivation that env vars shouldn't be 'leaking'. Although they wouldn't be leaking to childs exactly, they would still be leaking from the profiles sourced.) 2. Is something going to happen to the search-paths / native-search-paths functionality of the package records in regards to guix profiles? (in other words will the generation of etc/profile file in guix profiles be afected) And if so, how exactly? I can't seem to comprehend it being removed completely as some build systems just won't have the patches, at least yet, on the other hand how would it be distinguished which ones should end up in the profile exports and which ones should just end up in the search-paths.d files? Apologies if I've just missed answers to these questions in the GCD text or discussion. Regards, Rutherther
guix-patches@HIDDEN
:bug#76428
; Package guix-patches
.
Full text available.Received: (at 76428) by debbugs.gnu.org; 30 Mar 2025 21:26:00 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 30 17:26:00 2025 Received: from localhost ([127.0.0.1]:38276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tz0AJ-0005YA-OH for submit <at> debbugs.gnu.org; Sun, 30 Mar 2025 17:26:00 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:54592) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1tz0AH-0005Xd-FT for 76428 <at> debbugs.gnu.org; Sun, 30 Mar 2025 17:25:58 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 69BBF2F8; Sun, 30 Mar 2025 23:25:50 +0200 (CEST) Authentication-Results: hera.aquilenet.fr; none X-Virus-Scanned: Debian amavis at hera.aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavis, port 10024) with ESMTP id 0bYde4_5RPEZ; Sun, 30 Mar 2025 23:25:49 +0200 (CEST) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 3626B1B6; Sun, 30 Mar 2025 23:25:48 +0200 (CEST) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> To: =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN> Subject: Re: bug#76428: [GCD PATCH] 003-set-search-paths-without-program-wrappers: Submit. In-Reply-To: <87a59hdskx.fsf@HIDDEN> (=?utf-8?B?IuWui+aWh+atpiIncw==?= message of "Wed, 19 Mar 2025 22:05:02 +0800") References: <87r03s6mtt.fsf@HIDDEN> <87a59hdskx.fsf@HIDDEN> Date: Sun, 30 Mar 2025 23:25:47 +0200 Message-ID: <87h63acisk.fsf_-_@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 69BBF2F8 X-Spamd-Result: default: False [4.90 / 15.00]; SPAM_FLAG(5.00)[]; BAYES_HAM(-3.00)[100.00%]; NEURAL_SPAM(3.00)[1.000]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Level: **** X-Rspamd-Action: no action X-Spamd-Bar: ++++ X-Rspamd-Server: hera X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 76428 Cc: 76428 <at> debbugs.gnu.org, guix-devel@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) Hi =E5=AE=8B=E6=96=87=E6=AD=A6, First of all, apologies for not really contributing to the discussion before. My sentiment could be summarized as: I agree with the rationale, I like the idea of storing search path metadata in package outputs, but I=E2=80=99m concerned about the maintainability and viability of some aspects of the proposal (see below). I=E2=80=99ll send my deliberation in a separate mess= age. =E5=AE=8B=E6=96=87=E6=AD=A6 <iyzsong@HIDDEN> skribis: > ld.so.cache > search-paths.d > GUIX_XDG_DATA_DIRS > GUIX_GIO_EXTRA_MODULES > GUIX_GTK4_PATH I don=E2=80=99t think the =E2=80=9CGUIX_=E2=80=9D prefix is really justifie= d in the proposal. There=E2=80=99s a precedent, =E2=80=98GUIX_PYTHONPATH=E2=80=99, but I think= it does not follow that this can be generalized to every search path environment variable. For example, the XDG_ variables are honored by a lot of software, not just GLib- or Qt-based software, and it=E2=80=99s unrealistic to patch them= all. It=E2=80=99s also undesirable: generally speaking, we want to stay as close= to upstream as possible so that documentation, tutorials, and scripts found elsewhere also work on Guix. > ## Find the location of the current executable > > To find its search path configuration files when an executable is running, > we can first find the location of the executable. Conveniently, Linux > provides a pseudo-file `/proc/self/exe` for this exact purpose, which wor= ks > well for ELF executables. But for an interpreter script, `/proc/self/ex= e` > would return the file name of its interpreter instead of the script, so > we patch interpreters to set 2 environment variables: > > - `GUIX_INTERPRETER_FILE`: absolute file name of the interpreter > - `GUIX_MAIN_SCRIPT_FILE`: absolute file name of the script We won=E2=80=99t patch every interpreter out there, that=E2=80=99s not reas= onable. These two variables could also have unexpected consequences since an attacker could override them to cause confusion. > ## Implementation plan > > A WIP implementation can be found in <https://issues.guix.gnu.org/75688>. > > - Add a new function `g_guix_build_search_path_dirs` to GLib, which retur= ns a > search path as a list of file or directory names from a search path > configuration file and an environment variable. > - Patch GLib to use `g_guix_build_search_path_dirs` for `GUIX_XDG_DATA_DI= RS`, > `GUIX_XDG_CONFIG_DIRS`, `GUIX_GIO_EXTRA_MODULES` and > `GUIX_GSETTINGS_SCHEMA_DIR`. > - Patch Python to set `GUIX_INTERPRETER_FILE` and `GUIX_MAIN_SCRIPT_FILE`. > - Patch Qt to use `g_guix_build_search_path_dirs` for `GUIX_XDG_DATA_DIRS= `, > `GUIX_XDG_CONFIG_DIRS`, `GUIX_QT_PLUGIN_PATH`, `GUIX_QML_IMPORT_PATH`, > `GUIX_QML2_IMPORT_PATH`. > - Modify `glib-or-gtk-build-system` to get rid of `wrap-program`. > - Modify `qt-build-system` to get rid of `wrap-program`. I=E2=80=99m concerned about the cost of maintaining these patches. Again, = the ld.so patch (for glibc) sets a precedent, but this part of glibc changes relatively rarely, and it=E2=80=99s just one patch; what if we have to main= tain ten such patches in big and changing libraries like GLib and Qt? Overall, I think I=E2=80=99d be reassured if we reduced the scope a little = bit: don=E2=80=99t insist on the =E2=80=9CGUIX_=E2=80=9D prefix, focus on GTK an= d Qt applications. Thanks, Ludo=E2=80=99.
guix-patches@HIDDEN
:bug#76428
; Package guix-patches
.
Full text available.Received: (at 76428) by debbugs.gnu.org; 25 Mar 2025 12:28:25 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 25 08:28:25 2025 Received: from localhost ([127.0.0.1]:36730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tx3OK-0000Bv-OW for submit <at> debbugs.gnu.org; Tue, 25 Mar 2025 08:28:25 -0400 Received: from mail.envs.net ([5.199.136.28]:60410) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <iyzsong@HIDDEN>) id 1tx3O9-0000BT-4E for 76428 <at> debbugs.gnu.org; Tue, 25 Mar 2025 08:28:14 -0400 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id 6EDF838A4012; Tue, 25 Mar 2025 12:28:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=envs.net; s=modoboa; t=1742905690; bh=zLWduE4+E8yaWG45BqCVXWvEf1dUfpprZ+RXephDn0s=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=S9Wq2RllyMNaQx43kcZdwUal/gFsRTO1nC/j31XLfRTpp64ySYlSudXXDONghTp/U kFhpu6CBv8Xx7RIzY2+2cIcnF0+rEHRFe4pvnQk7+gtaYLk9ZBRt55ZIcSmVABijQv Ku39ocOaIVEhWZbTYZ0v5GSmrvXh71gRi1nBH/CaDcCcllw+/+Dq4hynIErpiCBfRy OMMVIBWt4zJQzG2TJcb3lsHJdNcqc+twj+//2x+KUYx6XjKXjLlNPr6vvK6lIYY9jO lEItrNRzoxVTt9oOfiyPvP6mFGfAZ7vU5+kx8YcYgBeP359oWFrYg5rjGeQyRpYdkK ZqL6E8ls7f7uAf05MFtyhj8NEhDSMalmw+ivP/BPLFqawF0YeewD292/LaLzOBn/CK gKvCH0rNT3IA9HoS0Byb4FnfpYS1nNtkG99BiB7Hns5zxC2ik/gwiyhXrv0CIfHpt0 PFW67CQAIPWv4wRbRyAxf6jM8g+/EjKS7sq9vCJCA5HViWSntB8qcU5kxPbU/QvH3A zGXy/MnA7xxpiDlC01TtSnweaaQNNtjSWuHVOHNsrNMo46E9qyRv54uNv7/IIxHcnt CLe2R7ltT7VOYK4sbay1KN5tCg9JTm07FzGyfVxiED3OYAxGJEbbGuGxU97Qj6BVT9 01EW8J1EJcrjjOwK1eLS9S3Q= X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id axdJh862kvWi; Tue, 25 Mar 2025 12:28:05 +0000 (UTC) Received: from localhost (unknown [112.44.105.62]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Tue, 25 Mar 2025 12:28:05 +0000 (UTC) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 061f627d; Tue, 25 Mar 2025 12:32:23 +0000 (UTC) From: =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN> To: Janneke Nieuwenhuizen <janneke@HIDDEN> Subject: Re: [GCD deliberation] Set search paths without program wrappers In-Reply-To: <874izk6m7p.fsf@HIDDEN> (Janneke Nieuwenhuizen's message of "Sun, 23 Mar 2025 12:05:46 +0100") References: <87r03s6mtt.fsf@HIDDEN> <87a59hdskx.fsf@HIDDEN> <874izk6m7p.fsf@HIDDEN> Date: Tue, 25 Mar 2025 20:32:23 +0800 Message-ID: <87bjtpjnoo.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76428 Cc: 76428 <at> debbugs.gnu.org, guix-devel@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Janneke Nieuwenhuizen <janneke@HIDDEN> writes: > [...] >> And when the executable's `/proc/self/exe` matches `GUIX_INTERPRETER_FILE`, >> we can get the script file name from `GUIX_MAIN_SCRIPT_FILE`. Alternatively, >> we can try to construct the script file name from command line arguments, but >> that won't work when you run a script using a relative file name and its >> current working directory changed before we figure out the script file name. > > Would this work with `guix pack' tarball archives, esp. think > cross-built `guix pack' archives for MinGW? I think this should work for `guix pack' when the target is a linux system, MingGW won't work with '/proc/self/exe', but maybe we can find something similiar. I'll keep this in mind and do some tests later, thanks!
guix-patches@HIDDEN
:bug#76428
; Package guix-patches
.
Full text available.Received: (at 76428) by debbugs.gnu.org; 23 Mar 2025 11:06:06 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 23 07:06:05 2025 Received: from localhost ([127.0.0.1]:47951 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1twJ9X-0000q9-F0 for submit <at> debbugs.gnu.org; Sun, 23 Mar 2025 07:06:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60168) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <janneke@HIDDEN>) id 1twJ9U-0000oe-2S for 76428 <at> debbugs.gnu.org; Sun, 23 Mar 2025 07:06:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <janneke@HIDDEN>) id 1twJ9N-0001oJ-6i; Sun, 23 Mar 2025 07:05:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=z8zdzPseCCgWeWJg6LzVZ/+hcl+EUvX57VbkGCaWc6A=; b=FLMD+UnzMgc8tUtPuYFo zFFE2Lzl0yIq3ABlG2j5i9DJrmmEj98GgcVGO3AtQfZA9bYNFOgfsGaLeSX7FWjiv3JMfbCVqsYxU wTCekzUjuVmE1G3h7TM1TM0PEPH4To1a+a3f+l5LQkQKvBypP1Jykjk1H6RkF4nss/zzhgcKXiU/o XX/Rjm5/JeFZu0LbTGtwHigVVXwnYQeepy4HedvAM68aakNKxbOnc2PYpHN5gb1swFi9oJ5yK7rtK 2XW7a9najWdWEStJ6knKiHXsILB74LqtjLKv1Fx+pryiFb368SuADcazYRzAuM6awC9FKAtBwIsiC f7jroGeSuIIiDA==; From: Janneke Nieuwenhuizen <janneke@HIDDEN> To: =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN> Subject: Re: [GCD deliberation] Set search paths without program wrappers In-Reply-To: <87a59hdskx.fsf@HIDDEN> (=?utf-8?B?IuWui+aWh+atpiIncw==?= message of "Wed, 19 Mar 2025 22:05:02 +0800") Organization: AvatarAcademy.nl References: <87r03s6mtt.fsf@HIDDEN> <87a59hdskx.fsf@HIDDEN> X-Url: http://AvatarAcademy.nl Date: Sun, 23 Mar 2025 12:05:46 +0100 Message-ID: <874izk6m7p.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76428 Cc: 76428 <at> debbugs.gnu.org, guix-devel@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hello, > # Detailed Design [..] > ## Find the location of the current executable > > To find its search path configuration files when an executable is running, > we can first find the location of the executable. Conveniently, Linux > provides a pseudo-file `/proc/self/exe` for this exact purpose, which wor= ks > well for ELF executables. But for an interpreter script, `/proc/self/ex= e` > would return the file name of its interpreter instead of the script, so > we patch interpreters to set 2 environment variables: > > - `GUIX_INTERPRETER_FILE`: absolute file name of the interpreter > - `GUIX_MAIN_SCRIPT_FILE`: absolute file name of the script > > And when the executable's `/proc/self/exe` matches `GUIX_INTERPRETER_FILE= `, > we can get the script file name from `GUIX_MAIN_SCRIPT_FILE`. Alternativ= ely, > we can try to construct the script file name from command line arguments,= but > that won't work when you run a script using a relative file name and its > current working directory changed before we figure out the script file na= me. Would this work with `guix pack' tarball archives, esp. think cross-built `guix pack' archives for MinGW? Greetings, Janneke --=20 Janneke Nieuwenhuizen <janneke@HIDDEN> | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar=C2=AE https://AvatarAcade= my.com
guix-patches@HIDDEN
:bug#76428
; Package guix-patches
.
Full text available.Received: (at 76428) by debbugs.gnu.org; 22 Mar 2025 06:01:04 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 22 02:01:04 2025 Received: from localhost ([127.0.0.1]:40452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tvrup-0006Xy-CZ for submit <at> debbugs.gnu.org; Sat, 22 Mar 2025 02:01:04 -0400 Received: from mail.envs.net ([5.199.136.28]:50994) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <iyzsong@HIDDEN>) id 1tvrum-0006XP-24 for 76428 <at> debbugs.gnu.org; Sat, 22 Mar 2025 02:01:01 -0400 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id B0E1A38A3FEC; Sat, 22 Mar 2025 06:00:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=envs.net; s=modoboa; t=1742623258; bh=BpiTnu0ZLsUJjbLYPdhxccO0Sf0/QaIfSJ1AdCzvL5Q=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=fIBbRo2oWI0qnSe80BMTXWC6YOl0SqHwSjIowutXV0zUYMcpdTWk7XnFMMhJLfKgC Nzg+uAcqc8rWPGaecUjTeaT5BGJYFxdGAH7Q9A92hLXisptbcF17NQSzK4G9/Rhqds EmXKzUN/nCuZcyjDsxAXru9TfxCat79e3GV04SphD+KOSy+GFgqIrt5oXt/jerallW SFqR9NElNLMVq9zOlKlXPlDTw1iSIp9au671ErHFEhVaXXgxYHmFwtt8NBWHS6IYSb Dig/V984bnVpFj6+DwYiGzEvNA9iGqjqPkBnl9hoLCaEfOwMWfTAyWzGH7iE2gWz4Z TB8zddM5tRUF/7Zc0hu3dYOxuZAIasIc/YNQon/JX712cFOLteEIyULeNpE8+9NvkB bTlEzKlMZ7GEILDweHG3ZDJ316ci7Zb52b8e0imob00V8JlD7552azdw/PCALroDDD DJ2N5/6w+OXkrk7V2B9A+TfjblSea43QiBRiutH3Ki47/hyflg7J40avYdooViO1j8 0PL8iXmdDkEZIyMIrdYCYovejuT7DyS/4DHQ/hOGnpsCoXvk7KH3NvrQs3V9l4UKN6 twFVc3pYzPQ4yTc8P/eqYAUcXHZc//Akm0kqkLBZJpzxHycySkBqDc4VqCTCCQSCNR dA64WWeJJf/UHiQ1u5vMiXFI= X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id rsDIS3YbdxM9; Sat, 22 Mar 2025 06:00:44 +0000 (UTC) Received: from localhost (unknown [112.44.105.62]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Sat, 22 Mar 2025 06:00:43 +0000 (UTC) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id bc35146a; Wed, 19 Mar 2025 14:05:02 +0000 (UTC) From: =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN> To: info-guix@HIDDEN Subject: [GCD deliberation] Set search paths without program wrappers In-Reply-To: <87r03s6mtt.fsf@HIDDEN> (=?utf-8?B?IuWui+aWh+atpg==?= via \"Low-traffic mailing list for announcements to Guix users.\""'s message of "Fri, 21 Feb 2025 10:41:50 +0800") References: <87r03s6mtt.fsf@HIDDEN> Date: Wed, 19 Mar 2025 22:05:02 +0800 Message-ID: <87a59hdskx.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76428 Cc: 76428 <at> debbugs.gnu.org, guix-devel@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hello, Below is the final version of GCD for "Set search paths without program wrappers", which means now this GCD start its deliberation period (14 days), so team members please reply to <76428 <at> debbugs.gnu.org> with opinions. Thanks! link: https://git.savannah.gnu.org/cgit/guix/guix-consensus-documents.git/p= lain/004-set-search-paths-without-program-wrappers.md title: Set search paths without program wrappers id: 004 status: submitted discussion: https://issues.guix.gnu.org/76428 authors: =E5=AE=8B=E6=96=87=E6=AD=A6 <iyzsong@HIDDEN> sponsors: Maxim Cournoyer <maxim.cournoyer@HIDDEN> date-submitted: 2025-02-21 date: 2025-02-21 SPDX-License-Identifier: CC-BY-SA-4.0 OR GFDL-1.3-no-invariants-or-later --- # Summary Currently program wrappers are widely used to set search paths via environment variables. Those wrappers have some problems: - environment variables leakage from a process to its child processes; - duplicate entries in environment variables; - obscured process names. To address those problems, we propose a way to set search paths with some per-output configuration files, reduce the need of creating program wrappers. # Motivation To make sure programs work out-of-the-box rather then depend on some external settings, Guix encourages the use of [program wrappers](https://gu= ix.gnu.org/manual/en/html_node/Build-Utilities.html#Wrappers) when define packages. In particular, both `glib-or-gtk-build-system` and `qt-build-system` includes a wrap phase to make program wrappers for ev= ery GNOME and KDE program. Those wrappers have some unsolved issues: - [Program crash due to leaked environment variables](https://issues.guix.g= nu.org/63203) - [Duplicate entries in various environment variables](https://issues.guix.= gnu.org/23118) - [Ansible & others' problems with wrapped '.ansible-real' scripts](https:/= /issues.guix.gnu.org/26752) If we managed to find a way to set search paths without using program wappers, then programs will be more robust. # Detailed Design In addition to environment variables, some programs also allow to set search paths via configuration files, for example you can use [path configuration files](https://docs.python.org/3/library/site.html) to set `sys.path` for Python, and we have a per-output [`ld.so.cache`](http= s://guix.gnu.org/en/blog/2021/taming-the-stat-storm-with-a-loader-cache/) to load shared libraries efficiently. Inspired by them, we are going to pa= tch some programs and libraries, so that when they build a search path from an environment variable, would also honor a per-output search path configurati= on file. The details are how to make those search path configuration files and how to find them when an executable is running. ## Search path configuration files We'll create search path configuration files under the `etc/search-path.d` directory of each package output, with each file specify a search path. The file name and its content are same to the corresponding environment variable. For example the output of the `gnome-console` package would have: ``` bin kgx etc ld.so.cache search-paths.d GUIX_XDG_DATA_DIRS GUIX_GIO_EXTRA_MODULES GUIX_GTK4_PATH lib share ``` The content of its `GUIX_XDG_DATA_DIRS` file would be: ``` /gnu/store/...-shared-mime-info-2.3/share:/gnu/store/...-glib-2.78.0/share:= /gnu/store/...-gsettings-desktop-schemas-44.0/share:/gnu/store/...-libadwai= ta-1.5.2/share:/gnu/store/...-gtk-4.14.5/share:/gnu/store/...-gnome-console= -44.4/share ``` Those search path configuration files would be created by the package build= er, after the `install` phase, replace usages of `wrap-program` when possible. ## Find the location of the current executable To find its search path configuration files when an executable is running, we can first find the location of the executable. Conveniently, Linux provides a pseudo-file `/proc/self/exe` for this exact purpose, which works well for ELF executables. But for an interpreter script, `/proc/self/exe` would return the file name of its interpreter instead of the script, so we patch interpreters to set 2 environment variables: - `GUIX_INTERPRETER_FILE`: absolute file name of the interpreter - `GUIX_MAIN_SCRIPT_FILE`: absolute file name of the script And when the executable's `/proc/self/exe` matches `GUIX_INTERPRETER_FILE`, we can get the script file name from `GUIX_MAIN_SCRIPT_FILE`. Alternativel= y, we can try to construct the script file name from command line arguments, b= ut that won't work when you run a script using a relative file name and its current working directory changed before we figure out the script file name. ## Set search paths with configuration files from search-paths.d Finally, when the program want to build a search path from an environment variable, we patch the code to search its `search-paths.d` first, the result search path value will include both the content of the search path configuration file and the environment variable. This usually happens in C/C++ libraries like GLib, GTK and Qt with a `getenv` call, we need patch these `getenv` calls for each search path we care. ## Implementation plan A WIP implementation can be found in <https://issues.guix.gnu.org/75688>. - Add a new function `g_guix_build_search_path_dirs` to GLib, which returns= a search path as a list of file or directory names from a search path configuration file and an environment variable. - Patch GLib to use `g_guix_build_search_path_dirs` for `GUIX_XDG_DATA_DIRS= `, `GUIX_XDG_CONFIG_DIRS`, `GUIX_GIO_EXTRA_MODULES` and `GUIX_GSETTINGS_SCHEMA_DIR`. - Patch Python to set `GUIX_INTERPRETER_FILE` and `GUIX_MAIN_SCRIPT_FILE`. - Patch Qt to use `g_guix_build_search_path_dirs` for `GUIX_XDG_DATA_DIRS`, `GUIX_XDG_CONFIG_DIRS`, `GUIX_QT_PLUGIN_PATH`, `GUIX_QML_IMPORT_PATH`, `GUIX_QML2_IMPORT_PATH`. - Modify `glib-or-gtk-build-system` to get rid of `wrap-program`. - Modify `qt-build-system` to get rid of `wrap-program`. # The Cost Of Reverting We can revert to program wrappers by manually adding wrap phases on a case = by case basic, if needed. # Drawbacks or Open Questions If implemented, we would likely carry several custom patches for GLib, GTK, Qt, Python, etc. forever. This proposal focuses solving problems caused by program wrappers in desktop environments, namely GNOME and KDE. Individual `wrap-progam` usages are not addressed. We plan to handle that in build systems later, for example: - Handle `GUIX_GI_TYPELIB_PATH` and `GUIX_GDK_PIXBUF_MODULE_FILES` in `glib-or-gtk-build-system` without wrappers. - Handle `GUIX_PYTHONPATH` in `python-build-system` without wrappers. There are still ABI problems caused by environment variables from profiles, which may be addressed later as suggested by Maxime Devos in <https://issues.guix.gnu.org/63203#5>.
guix-patches@HIDDEN
:bug#76428
; Package guix-patches
.
Full text available.Received: (at 76428) by debbugs.gnu.org; 19 Mar 2025 16:27:16 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 19 12:27:15 2025 Received: from localhost ([127.0.0.1]:52726 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tuwG9-0007XO-8o for submit <at> debbugs.gnu.org; Wed, 19 Mar 2025 12:27:15 -0400 Received: from relay.yourmailgateway.de ([188.68.63.102]:42071) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <pelzflorian@HIDDEN>) id 1tuwG2-0007WB-QG for 76428 <at> debbugs.gnu.org; Wed, 19 Mar 2025 12:27:10 -0400 Received: from mors-relay-2502.netcup.net (localhost [127.0.0.1]) by mors-relay-2502.netcup.net (Postfix) with ESMTPS id 4ZHvHD1Grtz64nx; Wed, 19 Mar 2025 17:26:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=pelzflorian.de; s=key2; t=1742401608; bh=9qXhJXaRlaTgUEBHq68xlAh60ANdXPcxyCP9hKePDWo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=LWELEnLqLAshdyz6qbgNJbcASCsYMgwdcECYwCJ7IvHlYaovMce1EQuH5R9cQAPTn 4W5Cu5eBOgdAIUrR7oXQeIR4MfpWqxvLUfSw1/Cr+MYluW0Gaus/MLnN6m+F9Vg+Ef whlL6EJTtW6iKDwtGAm1TvX2Cll/ljdLUGkq9xoUgoecXl8Y5Q1spdFnfcK7ZkBKjK 2wCUaJRfGY0CNM5kusH5YzGzSF7SUQy0RbVaSbU2sdIkx+21/cLQykKnVxd7cBmPvw TxJmvQsXmQof1JZJFSs3ZH0dFIPl/YDdwoKyysiXpLkJ6MPuelDDsFaFdOIHFA0Rwi xuM4XDNPR4tZQ== Received: from policy01-mors.netcup.net (unknown [46.38.225.35]) by mors-relay-2502.netcup.net (Postfix) with ESMTPS id 4ZHvHD0YBvz4xbZ; Wed, 19 Mar 2025 17:26:48 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at policy01-mors.netcup.net X-Spam-Flag: NO X-Spam-Score: -2.897 X-Spam-Level: X-Spam-Status: No, score=-2.897 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no Received: from mxe217.netcup.net (unknown [10.243.12.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by policy01-mors.netcup.net (Postfix) with ESMTPS id 4ZHvHB4Hn5z8t4D; Wed, 19 Mar 2025 17:26:46 +0100 (CET) Received: from florianhp (ipb21a5dbf.dynamic.kabel-deutschland.de [178.26.93.191]) by mxe217.netcup.net (Postfix) with ESMTPSA id 1F2AA84AF6; Wed, 19 Mar 2025 17:26:45 +0100 (CET) From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN> To: 76428 <at> debbugs.gnu.org Subject: Re: [bug#76428] [GCD deliberation] Set search paths without program wrappers In-Reply-To: <87a59hdskx.fsf@HIDDEN> (=?utf-8?B?IuWui+aWh+atpg==?= via Guix-patches via"'s message of "Wed, 19 Mar 2025 22:05:02 +0800") References: <87r03s6mtt.fsf@HIDDEN> <87a59hdskx.fsf@HIDDEN> Date: Wed, 19 Mar 2025 17:27:14 +0100 Message-ID: <87jz8loujh.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Rspamd-Server: rspamd-worker-8404 X-Rspamd-Queue-Id: 1F2AA84AF6 X-NC-CID: aFbJ9iYOOjeFsnwVYtfE5PvPxX8nk+lzEM7NFThLxI6W1zsb8gj5DUH1 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76428 Cc: =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) I support; it is needed and backwards-compatible as said on <https://lists.gnu.org/archive/html/guix-devel/2025-02/msg00450.html>. Regards, Florian
guix-patches@HIDDEN
:bug#76428
; Package guix-patches
.
Full text available.Received: (at 76428) by debbugs.gnu.org; 19 Mar 2025 14:01:02 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 19 10:01:02 2025 Received: from localhost ([127.0.0.1]:51684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tutya-0002sX-0h for submit <at> debbugs.gnu.org; Wed, 19 Mar 2025 10:01:02 -0400 Received: from mail.envs.net ([5.199.136.28]:49974) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <iyzsong@HIDDEN>) id 1tutyT-0002sE-Sx for 76428 <at> debbugs.gnu.org; Wed, 19 Mar 2025 10:00:53 -0400 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id 3F8BC38A3FDD; Wed, 19 Mar 2025 14:00:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=envs.net; s=modoboa; t=1742392848; bh=BpiTnu0ZLsUJjbLYPdhxccO0Sf0/QaIfSJ1AdCzvL5Q=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=QsU938YMe+Ykncbs9RVC2cd33IZJ0+qxeLVoWU3Cxg2zhn+6409UaD+ikuPDKs17j mmOzI90r962fcuSj8KDlJWEdCAWXprR2IEgN1Bu3rLCTKRS5Qazw0v/DC42Y5zpK5d jZFcP1u9HaGuFErSrR1coO0mLw4yldusWqcgRTCHOIMBsQUVJwTDFJJLHHyKtJguFn piObmiuHiTj9lirZSyWrawCZFQc3pm1/0UtADxlwoN9RMSUMNfTiriEF6ngsuh3Inf myfI1Lpts2+HHga9i9Px3HJHBIySuR3UT33noYqSPHjcjORPii75KvO+zc9zUfQVXP DHTO0GVLQbVkLvkp4GW1CwHExzW55vVaq4HK8Ai1bRKHSNrXpxFwZXvkOHcSxtsCjp uYYJBzvz8P5PSorCUhC1I4s946tSQK7I/EHnORJv15EEqY2MtC8/ZceHfoulLqYqPJ k7CpHqPGiUx7GUWWhjQ+nLXj41jG85xtMFD65FxDVCX2bkLatbzaXUQw8WP2T6LTLo AYkrJ6ZuNHgjnFvHpCEciK82DgMJVmUfaSRMq1+u8Ygod5NewbkKgV/0ef0I9jvvqF LsE5iJPX9F3bYnby8+uE1WuPHiUXkOxhh3j/+uQdlEX7dBvAZErDxnFMhkSRCNpBl/ n7HZ04hWYBeUyXjqpfqBjfPo= X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 5wcJpaUJHufc; Wed, 19 Mar 2025 14:00:42 +0000 (UTC) Received: from localhost (unknown [112.44.105.62]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Wed, 19 Mar 2025 14:00:42 +0000 (UTC) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id bc35146a; Wed, 19 Mar 2025 14:05:02 +0000 (UTC) From: =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN> To: info-guix@HIDDEN Subject: [GCD deliberation] Set search paths without program wrappers In-Reply-To: <87r03s6mtt.fsf@HIDDEN> (=?utf-8?B?IuWui+aWh+atpg==?= via \"Low-traffic mailing list for announcements to Guix users.\""'s message of "Fri, 21 Feb 2025 10:41:50 +0800") References: <87r03s6mtt.fsf@HIDDEN> Date: Wed, 19 Mar 2025 22:05:02 +0800 Message-ID: <87a59hdskx.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76428 Cc: 76428 <at> debbugs.gnu.org, guix-devel@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hello, Below is the final version of GCD for "Set search paths without program wrappers", which means now this GCD start its deliberation period (14 days), so team members please reply to <76428 <at> debbugs.gnu.org> with opinions. Thanks! link: https://git.savannah.gnu.org/cgit/guix/guix-consensus-documents.git/p= lain/004-set-search-paths-without-program-wrappers.md title: Set search paths without program wrappers id: 004 status: submitted discussion: https://issues.guix.gnu.org/76428 authors: =E5=AE=8B=E6=96=87=E6=AD=A6 <iyzsong@HIDDEN> sponsors: Maxim Cournoyer <maxim.cournoyer@HIDDEN> date-submitted: 2025-02-21 date: 2025-02-21 SPDX-License-Identifier: CC-BY-SA-4.0 OR GFDL-1.3-no-invariants-or-later --- # Summary Currently program wrappers are widely used to set search paths via environment variables. Those wrappers have some problems: - environment variables leakage from a process to its child processes; - duplicate entries in environment variables; - obscured process names. To address those problems, we propose a way to set search paths with some per-output configuration files, reduce the need of creating program wrappers. # Motivation To make sure programs work out-of-the-box rather then depend on some external settings, Guix encourages the use of [program wrappers](https://gu= ix.gnu.org/manual/en/html_node/Build-Utilities.html#Wrappers) when define packages. In particular, both `glib-or-gtk-build-system` and `qt-build-system` includes a wrap phase to make program wrappers for ev= ery GNOME and KDE program. Those wrappers have some unsolved issues: - [Program crash due to leaked environment variables](https://issues.guix.g= nu.org/63203) - [Duplicate entries in various environment variables](https://issues.guix.= gnu.org/23118) - [Ansible & others' problems with wrapped '.ansible-real' scripts](https:/= /issues.guix.gnu.org/26752) If we managed to find a way to set search paths without using program wappers, then programs will be more robust. # Detailed Design In addition to environment variables, some programs also allow to set search paths via configuration files, for example you can use [path configuration files](https://docs.python.org/3/library/site.html) to set `sys.path` for Python, and we have a per-output [`ld.so.cache`](http= s://guix.gnu.org/en/blog/2021/taming-the-stat-storm-with-a-loader-cache/) to load shared libraries efficiently. Inspired by them, we are going to pa= tch some programs and libraries, so that when they build a search path from an environment variable, would also honor a per-output search path configurati= on file. The details are how to make those search path configuration files and how to find them when an executable is running. ## Search path configuration files We'll create search path configuration files under the `etc/search-path.d` directory of each package output, with each file specify a search path. The file name and its content are same to the corresponding environment variable. For example the output of the `gnome-console` package would have: ``` bin kgx etc ld.so.cache search-paths.d GUIX_XDG_DATA_DIRS GUIX_GIO_EXTRA_MODULES GUIX_GTK4_PATH lib share ``` The content of its `GUIX_XDG_DATA_DIRS` file would be: ``` /gnu/store/...-shared-mime-info-2.3/share:/gnu/store/...-glib-2.78.0/share:= /gnu/store/...-gsettings-desktop-schemas-44.0/share:/gnu/store/...-libadwai= ta-1.5.2/share:/gnu/store/...-gtk-4.14.5/share:/gnu/store/...-gnome-console= -44.4/share ``` Those search path configuration files would be created by the package build= er, after the `install` phase, replace usages of `wrap-program` when possible. ## Find the location of the current executable To find its search path configuration files when an executable is running, we can first find the location of the executable. Conveniently, Linux provides a pseudo-file `/proc/self/exe` for this exact purpose, which works well for ELF executables. But for an interpreter script, `/proc/self/exe` would return the file name of its interpreter instead of the script, so we patch interpreters to set 2 environment variables: - `GUIX_INTERPRETER_FILE`: absolute file name of the interpreter - `GUIX_MAIN_SCRIPT_FILE`: absolute file name of the script And when the executable's `/proc/self/exe` matches `GUIX_INTERPRETER_FILE`, we can get the script file name from `GUIX_MAIN_SCRIPT_FILE`. Alternativel= y, we can try to construct the script file name from command line arguments, b= ut that won't work when you run a script using a relative file name and its current working directory changed before we figure out the script file name. ## Set search paths with configuration files from search-paths.d Finally, when the program want to build a search path from an environment variable, we patch the code to search its `search-paths.d` first, the result search path value will include both the content of the search path configuration file and the environment variable. This usually happens in C/C++ libraries like GLib, GTK and Qt with a `getenv` call, we need patch these `getenv` calls for each search path we care. ## Implementation plan A WIP implementation can be found in <https://issues.guix.gnu.org/75688>. - Add a new function `g_guix_build_search_path_dirs` to GLib, which returns= a search path as a list of file or directory names from a search path configuration file and an environment variable. - Patch GLib to use `g_guix_build_search_path_dirs` for `GUIX_XDG_DATA_DIRS= `, `GUIX_XDG_CONFIG_DIRS`, `GUIX_GIO_EXTRA_MODULES` and `GUIX_GSETTINGS_SCHEMA_DIR`. - Patch Python to set `GUIX_INTERPRETER_FILE` and `GUIX_MAIN_SCRIPT_FILE`. - Patch Qt to use `g_guix_build_search_path_dirs` for `GUIX_XDG_DATA_DIRS`, `GUIX_XDG_CONFIG_DIRS`, `GUIX_QT_PLUGIN_PATH`, `GUIX_QML_IMPORT_PATH`, `GUIX_QML2_IMPORT_PATH`. - Modify `glib-or-gtk-build-system` to get rid of `wrap-program`. - Modify `qt-build-system` to get rid of `wrap-program`. # The Cost Of Reverting We can revert to program wrappers by manually adding wrap phases on a case = by case basic, if needed. # Drawbacks or Open Questions If implemented, we would likely carry several custom patches for GLib, GTK, Qt, Python, etc. forever. This proposal focuses solving problems caused by program wrappers in desktop environments, namely GNOME and KDE. Individual `wrap-progam` usages are not addressed. We plan to handle that in build systems later, for example: - Handle `GUIX_GI_TYPELIB_PATH` and `GUIX_GDK_PIXBUF_MODULE_FILES` in `glib-or-gtk-build-system` without wrappers. - Handle `GUIX_PYTHONPATH` in `python-build-system` without wrappers. There are still ABI problems caused by environment variables from profiles, which may be addressed later as suggested by Maxime Devos in <https://issues.guix.gnu.org/63203#5>.
guix-patches@HIDDEN
:bug#76428
; Package guix-patches
.
Full text available.Received: (at 76428) by debbugs.gnu.org; 26 Feb 2025 04:13:03 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 25 23:13:03 2025 Received: from localhost ([127.0.0.1]:50244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tn8n9-0000wi-0U for submit <at> debbugs.gnu.org; Tue, 25 Feb 2025 23:13:03 -0500 Received: from mail.envs.net ([5.199.136.28]:38538) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <iyzsong@HIDDEN>) id 1tn8mx-0000w0-Pl for 76428 <at> debbugs.gnu.org; Tue, 25 Feb 2025 23:12:53 -0500 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id C1DF038A3F73; Wed, 26 Feb 2025 04:12:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=envs.net; s=modoboa; t=1740543169; bh=cpX+vLYN2XvZRdri4oMfVgOoJIQXeFQ/I35QDRlh2eg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=FoKkTQ5bwM/tlv90OrVzXyCon/RnMNOSQJtpedlSCCyRUE9UixL9m9mS/gTCllzyM jL/5Xa13CZuh6xdIyvd2CVYBVeWSLOZMYT0g01aldzW3lbb/intwawgSxAhXLVcvlR ST3KB5I7vo7QJ9QS/QloX26Waovg1Mx0VYB9PHrtL/wg77C3i0lYbGLimk32qM5eHr lnInDwVLb8dECKeRmOXS8U8YDwSOdeupCKMuLDddpgXZW+KHfwvNVtpevt8caPzdxk O9XGRBzvaAv5w3FLNLVInSJqMaakGinDFXOZo8oRy1WkcbakP5aEDG3xTd1o5jb31w o6+iBZ8Nr+1r1606yPvskS50ZQ7ojoooMEjOiTj9GfoPnWJReWyGqAX8lHOECdM8dL WbrqsGJJMVacMx3KPaVmZwyMPEwmefWcCoVB6gSr8ddJoj/OgvwGcMVxA7KJYjv+2w 6cPzJpISYl7uB6JGWAzHDS2Z/hOHk0AHFswveanLu0S7+JyaghMUrSa6trhT6YbuAI dT4g0XI9GdCLjFyZhbDECd8XSKyofnjj4DNtm21ox2nqHuMm6uoRNGg5+NrzMJvusw Os29TUrizEFksFA5U2Al59/k+twYAfrLSblq6Xyla9pC2uDNKrS09ENC1y5C5GIZ8D 0rx+TRtr/ZH7tqxzYruJyex4= X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id pLtjfBzFUPqn; Wed, 26 Feb 2025 04:12:44 +0000 (UTC) Received: from localhost (unknown [112.44.106.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Wed, 26 Feb 2025 04:12:43 +0000 (UTC) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 6fe97bb2; Wed, 26 Feb 2025 04:16:38 +0000 (UTC) From: =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN> To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Subject: Re: bug#76428: [GCD PATCH] 003-set-search-paths-without-program-wrappers: Submit. In-Reply-To: <871pvmnez7.fsf@HIDDEN> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Tue, 25 Feb 2025 17:53:00 +0100") References: <20250220040827.4127-1-iyzsong@HIDDEN> <871pvmnez7.fsf@HIDDEN> Date: Wed, 26 Feb 2025 12:16:38 +0800 Message-ID: <877c5djq6x.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76428 Cc: 76428 <at> debbugs.gnu.org, =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Ludovic Court=C3=A8s <ludo@HIDDEN> writes: >> [...] >> +Those search path configuration files would be created by the package b= uilder, >> +after the `install` phase, replace usages of `wrap-program` when possib= le. > > One thought came to mind. > > If we are going to provide that sort of metadata along side package > build results, what about providing a =E2=80=98package=E2=80=99 sexp simi= lar to those > found in the =E2=80=98manifest=E2=80=99 file of profiles (see =E2=80=98ma= nifest->gexp=E2=80=99), for > example in =E2=80=98etc/guix/package=E2=80=99? Okay, I guess that can be done in gnu-build-system. > > The sexp could provide info such as: the package name and version, its > search paths, maybe its propagated inputs. > > This could have applications for things like =E2=80=98guix health=E2=80= =99=C2=B9 and maybe > even fixing <https://issues.guix.gnu.org/20255>. That #20255 is already fixed, by 'guix package --search-paths' with multiple profiles. I think you mean <https://issues.guix.gnu.org/22138>: "Search paths of dependencies are not honored" > But now I realize that the main drawback of this approach is that it > would be too hard to parse that in GLib etc. The sexp file and search-paths.d files could coexist, we can build the latter from the former. > So this is probably not a useful comment, but now we have it on record. I see that a package level sexp metadata file would be useful, we could do it indepent of this GCD. Thanks.
guix-patches@HIDDEN
:bug#76428
; Package guix-patches
.
Full text available.Received: (at 76428) by debbugs.gnu.org; 25 Feb 2025 16:53:33 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 25 11:53:33 2025 Received: from localhost ([127.0.0.1]:48187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tmyBY-00041n-Nl for submit <at> debbugs.gnu.org; Tue, 25 Feb 2025 11:53:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38968) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1tmyBU-00041W-Se for 76428 <at> debbugs.gnu.org; Tue, 25 Feb 2025 11:53:30 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1tmyBO-0000gx-Cg; Tue, 25 Feb 2025 11:53:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=SDk8uCQVBIqyec3SVLyKQ6nElgLYU92z1+CPTH5YvtQ=; b=mBVYNONVrOVDBL8phXq0 Xf98Mrt0p6vvQGFo6zLCCIoZbQnEdDcUKc+b/MPHuqNv1McKNbwLVEHdeLXzVmGuaUPKL5s9TxQJK gvGESWHFsNOAmfKqZ1z2JH93ih1rwZbLqMRMwa7jdpE8mvC3fGXlVxiVqf4I8UA0XW957lt0SjFhH da9TuMYvUBXUS0NP4SaWXvNK+ercKidSk64qq5nYN92KPIX4PHRQbLTOF/G76NrKv9EDZcXE+ry8E eACgyrwVwkE1ZjegbGlsHGsFm1smkD31Wv3CnRgbejWoaMPr6HbJIXsPMA8jaXto6gFEaM37cmm2x LC0k/WklwCk8dg==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> To: iyzsong@HIDDEN Subject: Re: bug#76428: [GCD PATCH] 003-set-search-paths-without-program-wrappers: Submit. In-Reply-To: <20250220040827.4127-1-iyzsong@HIDDEN> (iyzsong@HIDDEN's message of "Thu, 20 Feb 2025 12:08:23 +0800") References: <20250220040827.4127-1-iyzsong@HIDDEN> Date: Tue, 25 Feb 2025 17:53:00 +0100 Message-ID: <871pvmnez7.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 76428 Cc: 76428 <at> debbugs.gnu.org, =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi =E5=AE=8B=E6=96=87=E6=AD=A6, iyzsong@HIDDEN skribis: > +etc > + ld.so.cache > + search-paths.d > + GUIX_XDG_DATA_DIRS > + GUIX_GIO_EXTRA_MODULES > + GUIX_GTK4_PATH > +lib > +share > +``` > + > +The content of its `GUIX_XDG_DATA_DIRS` file would be: > +``` > +/gnu/store/...-shared-mime-info-2.3/share:/gnu/store/...-glib-2.78.0/sha= re:/gnu/store/...-gsettings-desktop-schemas-44.0/share:/gnu/store/...-libad= waita-1.5.2/share:/gnu/store/...-gtk-4.14.5/share:/gnu/store/...-gnome-cons= ole-44.4/share > +``` > + > +Those search path configuration files would be created by the package bu= ilder, > +after the `install` phase, replace usages of `wrap-program` when possibl= e. One thought came to mind. If we are going to provide that sort of metadata along side package build results, what about providing a =E2=80=98package=E2=80=99 sexp simila= r to those found in the =E2=80=98manifest=E2=80=99 file of profiles (see =E2=80=98mani= fest->gexp=E2=80=99), for example in =E2=80=98etc/guix/package=E2=80=99? The sexp could provide info such as: the package name and version, its search paths, maybe its propagated inputs. This could have applications for things like =E2=80=98guix health=E2=80=99= =C2=B9 and maybe even fixing <https://issues.guix.gnu.org/20255>. But now I realize that the main drawback of this approach is that it would be too hard to parse that in GLib etc. So this is probably not a useful comment, but now we have it on record. :-) Thanks, Ludo=E2=80=99. =C2=B9 https://issues.guix.gnu.org/31444
guix-patches@HIDDEN
:bug#76428
; Package guix-patches
.
Full text available.Received: (at 76428) by debbugs.gnu.org; 22 Feb 2025 03:52:25 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 21 22:52:25 2025 Received: from localhost ([127.0.0.1]:42408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tlgYz-0002uo-9k for submit <at> debbugs.gnu.org; Fri, 21 Feb 2025 22:52:25 -0500 Received: from mail.envs.net ([5.199.136.28]:37734) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <iyzsong@HIDDEN>) id 1tlgYx-0002uM-86 for 76428 <at> debbugs.gnu.org; Fri, 21 Feb 2025 22:52:23 -0500 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id 6999438A3ED5; Sat, 22 Feb 2025 03:52:22 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id WtBPl8E5o80u; Sat, 22 Feb 2025 03:52:16 +0000 (UTC) Received: from localhost (unknown [112.44.106.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Sat, 22 Feb 2025 03:52:16 +0000 (UTC) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id fae60f79; Sat, 22 Feb 2025 03:56:16 +0000 (UTC) From: =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN> To: Simon Tournier <zimon.toutoune@HIDDEN> Subject: Re: [bug#76428] [PATCH v2] 004-set-search-paths-without-program-wrappers: Submit. In-Reply-To: <87bjuvry05.fsf@HIDDEN> (Simon Tournier's message of "Fri, 21 Feb 2025 18:47:06 +0100") References: <20250220040827.4127-1-iyzsong@HIDDEN> <20250221023100.2257-1-iyzsong@HIDDEN> <87bjuvry05.fsf@HIDDEN> Date: Sat, 22 Feb 2025 11:56:16 +0800 Message-ID: <87eczqr5sv.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76428 Cc: 76428 <at> debbugs.gnu.org, =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Simon Tournier <zimon.toutoune@HIDDEN> writes: > =E5=97=A8 =E5=AE=8B=E6=96=87=E6=AD=A6! > > More or less copy/pasting [1] what I wrote to Liliana about GCD 003. > > Now, the GCD=E2=80=99s submitted \o/, I recommend to push the two first > revisions and then each new revision to a dedicated branch, say > =E2=80=99wip-set-search-paths-without-program-wrapper=E2=80=99 directly t= o the GCDs > repository. Done, thanks. It now can be view from: https://git.savannah.gnu.org/cgit/guix/guix-consensus-documents.git/tree/00= 4-set-search-paths-without-program-wrappers.md?h=3Dwip-set-search-paths-wit= hout-program-wrappers
guix-patches@HIDDEN
:bug#76428
; Package guix-patches
.
Full text available.Received: (at 76428) by debbugs.gnu.org; 22 Feb 2025 03:49:25 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 21 22:49:25 2025 Received: from localhost ([127.0.0.1]:42354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tlgW5-0002PI-0c for submit <at> debbugs.gnu.org; Fri, 21 Feb 2025 22:49:25 -0500 Received: from mail.envs.net ([5.199.136.28]:42448) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <iyzsong@HIDDEN>) id 1tlgW0-0002OH-9O for 76428 <at> debbugs.gnu.org; Fri, 21 Feb 2025 22:49:21 -0500 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id 3DF0738A3ED5; Sat, 22 Feb 2025 03:49:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 0S5IPH78H1KN; Sat, 22 Feb 2025 03:49:12 +0000 (UTC) Received: from localhost (unknown [112.44.106.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Sat, 22 Feb 2025 03:49:11 +0000 (UTC) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 9732e49a; Sat, 22 Feb 2025 03:53:07 +0000 (UTC) From: =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN> To: =?utf-8?B?5a6L5paH5q2m?= via "Development of GNU Guix and the GNU System distribution." <guix-devel@HIDDEN> Subject: Re: [GCD] Set search paths without program wrappers In-Reply-To: <877c5isnv1.fsf@HIDDEN> (=?utf-8?B?IuWui+aWh+atpg==?= via \"Development of GNU Guix and the GNU System distribution.\""'s message of "Sat, 22 Feb 2025 10:40:50 +0800") References: <87tt9dq6zc.fsf@HIDDEN> <3b03b83e-ad9b-4bb2-82b8-9285a8949d33@HIDDEN> <877c5isnv1.fsf@HIDDEN> Date: Sat, 22 Feb 2025 11:53:07 +0800 Message-ID: <871pvqskik.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76428 Cc: 76428 <at> debbugs.gnu.org, Hartmut Goebel <h.goebel@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) =E5=AE=8B=E6=96=87=E6=AD=A6 via "Development of GNU Guix and the GNU System= distribution." <guix-devel@HIDDEN> writes: > Hartmut Goebel <h.goebel@HIDDEN> writes: > >> Hi, >> >> I don't understand what solution you propose. >> >> The GCD talks about setting some Env variable, like >> `GUIX_INTERPRETER_FILE` and `GUIX_MAIN_SCRIPT_FILE` (for Python). >> What is happening then? Isn't there some code required for reading >> the files in search-paths.d and set the variables >> accordingly? Add a small section to clarify where search-paths.d is used: https://git.savannah.gnu.org/cgit/guix/guix-consensus-documents.git/commit/= 004-set-search-paths-without-program-wrappers.md?h=3Dwip-set-search-paths-w= ithout-program-wrappers&id=3D990d1a273018a2782666089de2c9878f02cfe6e6 The lastest version of this GCD can be viewed from: https://git.savannah.gnu.org/cgit/guix/guix-consensus-documents.git/plain/0= 04-set-search-paths-without-program-wrappers.md?h=3Dwip-set-search-paths-wi= thout-program-wrappers Hope it helps, thanks.
guix-patches@HIDDEN
:bug#76428
; Package guix-patches
.
Full text available.Received: (at 76428) by debbugs.gnu.org; 21 Feb 2025 19:23:58 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 21 14:23:57 2025 Received: from localhost ([127.0.0.1]:36355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tlYcv-0000FS-9t for submit <at> debbugs.gnu.org; Fri, 21 Feb 2025 14:23:57 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:46283) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <zimon.toutoune@HIDDEN>) id 1tlYcd-0000BU-3T for 76428 <at> debbugs.gnu.org; Fri, 21 Feb 2025 14:23:41 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-38f2b7ce2f3so1818655f8f.0 for <76428 <at> debbugs.gnu.org>; Fri, 21 Feb 2025 11:23:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740165813; x=1740770613; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=y7bkX4PkoHOdNaIBom7d7NhxnXsTABIwHiBZ+V2vUbE=; b=jTuvvFseERw9yGIm4zHz68dR87mo4fI1o4tm2tKJ03O6HmB4XAZ1AoEgVZKFL2kYsI ulfvlJaZqKd+egj1ZLE6FXAt9I+M9hOKWr7fspGHs198OdsIAS2qVYsAkwPDDAgCz3lN 2qpluP9xqk2i8Hm0rHadf0WiJ1Dux5vkaHjvIbcDCSUPcx0Pgk0gZoFZgGIJUwdEj11L WXL9rrLWaV/V5LyFBsBUecp2GoA9r+MIjjG2ncpS68wbzPijRdiuMupoeXl/C1fEd+H1 s7Z9HRN3dIVTUyw+wDZ+29DiJ7zFkcXOn53iSLGyJhx+AmbpoEjWOJi2beMn8deMiZPe aXuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740165813; x=1740770613; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y7bkX4PkoHOdNaIBom7d7NhxnXsTABIwHiBZ+V2vUbE=; b=DsVZ2CgzPsWzFjpz6SN2gpRJAZAQjwtEvMSlTnhb0jZD2FyEu/usBxcrtW658K8IQQ 2vl5yP08fy0And63j/bWCXWLa2zU+r7TL7J64rbjnBNNMqtR4yG2mmZIMwPvz2KI8ZAh WoFJNs0lEutB0Id9JrQ4eld/M0rc5+yOZuMNgclzrvnQYp3+3Fj10qy0nEN4oTz9O7Wg /lYIYQ6N+sGasiW5tgp+wJZ4ZkhrSacBbV8WYZAc6NdMhSSM4PAWDEokfbzRvbJEFdyQ DBZvqF8vhj4zooDkcIeOL6Mtx6h/yZhM8eMN6c7a8Vqzelw0sXBngr+h/qG+a96hk4Dj Mf4w== X-Forwarded-Encrypted: i=1; AJvYcCVBpfoLeaJfvcz87Lu+XHGZm39ZOaIjTmvyPGjTK1EEhkwBQ1asu9puaX3/qJlJLWQ7s/oRww==@debbugs.gnu.org X-Gm-Message-State: AOJu0YznDCHr1s5uyUqNkGMi93ykbr+zn2xJBkmTeoVoKB4f5WBtESWm aW8Ygtsyua8v+raUCRqLhLmGYNjd/N5fdr2l6oboaqj7og4QFLapfjePBA== X-Gm-Gg: ASbGncsrQpniK6ktRwHlTOjBTH9y8NodDKxf8qGm1psuNnnvu7T1qL434NKaoEIsR26 CkY3BPeP7lNPkjlxiFYFGIWYbVvBJHw+NCSdmVO0/nIbTN2gCBSaqmbGZ5Wa7O+wCrymLWScP9w K0LdSZ7SrThYYHmuxFb7GteJhpRi+js8o8ebBxnkr2Z+vZti7F8KXF0uc5i85+JzOkCByPVGf72 i47aS6ynqk6c4TxrdZgJoHRB3wvuWU/XpcgQg1+fPtwNd7MisET/Pkn1xsHLbGxbErkP9Al65no A57/ZhbbtwShwryXaSap82mzl0unL/smInZAyXDetaLRIO4F4SKaKZJ7O2fA8tveaYPJ32f4XK8 /h8PalPW65z0= X-Google-Smtp-Source: AGHT+IHXcoGgYL8AjOA2yOeIt9r/lPJjzK1eSdumqRa0xw6NC/pH/12rICuvmbQKKjjJbCsRhPWZOA== X-Received: by 2002:adf:e309:0:b0:38f:2b59:b550 with SMTP id ffacd0b85a97d-38f70857b6bmr3183893f8f.50.1740165812645; Fri, 21 Feb 2025 11:23:32 -0800 (PST) Received: from lili (roam-nat-fw-prg-194-254-61-44.net.univ-paris-diderot.fr. [194.254.61.44]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-439b02d519dsm25534855e9.11.2025.02.21.11.23.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Feb 2025 11:23:32 -0800 (PST) From: Simon Tournier <zimon.toutoune@HIDDEN> To: iyzsong@HIDDEN, 76428 <at> debbugs.gnu.org Subject: Re: [bug#76428] [PATCH v2] 004-set-search-paths-without-program-wrappers: Submit. In-Reply-To: <20250221023100.2257-1-iyzsong@HIDDEN> References: <20250220040827.4127-1-iyzsong@HIDDEN> <20250221023100.2257-1-iyzsong@HIDDEN> Date: Fri, 21 Feb 2025 18:47:06 +0100 Message-ID: <87bjuvry05.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76428 Cc: =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) =E5=97=A8 =E5=AE=8B=E6=96=87=E6=AD=A6! More or less copy/pasting [1] what I wrote to Liliana about GCD 003. Now, the GCD=E2=80=99s submitted \o/, I recommend to push the two first revisions and then each new revision to a dedicated branch, say =E2=80=99wip-set-search-paths-without-program-wrapper=E2=80=99 directly to = the GCDs repository. https://git.savannah.gnu.org/cgit/guix/guix-consensus-documents.git You can take example from wip-default-branch-name. :-) At the end of the process, this branch will be merged to =E2=80=99main=E2=80=99. Why? Based on the experience of 001, it can quickly become a mess. :-) There is several revisions in different emails and all becomes harder and harder to follow. Do I read the last revision? This one? Ah no there is this yet another email? And that MUA screwed up the subject=E2=80= =A6 Is it really the last revision? etc. Hard to follow; especially for the ones who just want to read the last current revision. Moreover, it=E2=80=99s more comfortable to read a plain file than a diff or= a patch, IMHO. For example, one specific revision of 001: https://git.savannah.gnu.org/cgit/guix/guix-consensus-documents.git/tre= e/0001-rfc-process.md?id=3D7da54b980efcd23ce662040b00712bd7fa76982e (It perfectly works with Emacs browser EWW so it works for any browser. ;-)) Last, having all the revisions in a dedicated branch allows to easily diff between each revision. So for the next revision, you could announce a link for the new revision (for example of a link, the one above) in addition to the patch or plain file. My 2 cents. :-) Cheers, simon 1: [bug#76407] [GCD] A better name for the default branch Simon Tournier <zimon.toutoune@HIDDEN> Thu, 20 Feb 2025 18:25:02 +0100 id:87frk8lea9.fsf@HIDDEN https://issues.guix.gnu.org/76407 https://issues.guix.gnu.org/msgid/87frk8lea9.fsf@HIDDEN https://yhetil.org/guix/87frk8lea9.fsf@HIDDEN
guix-patches@HIDDEN
:bug#76428
; Package guix-patches
.
Full text available.Received: (at 76428) by debbugs.gnu.org; 21 Feb 2025 02:38:07 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 20 21:38:06 2025 Received: from localhost ([127.0.0.1]:47474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tlIvQ-0007b0-Jq for submit <at> debbugs.gnu.org; Thu, 20 Feb 2025 21:38:05 -0500 Received: from mail.envs.net ([5.199.136.28]:52350) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <iyzsong@HIDDEN>) id 1tlIvL-0007a5-Nx for 76428 <at> debbugs.gnu.org; Thu, 20 Feb 2025 21:37:59 -0500 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id 3362038A3F62; Fri, 21 Feb 2025 02:37:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 0lDVQkR88FjW; Fri, 21 Feb 2025 02:37:50 +0000 (UTC) Received: from localhost (unknown [112.44.101.188]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Fri, 21 Feb 2025 02:37:50 +0000 (UTC) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id f70ac00f; Fri, 21 Feb 2025 02:41:50 +0000 (UTC) From: =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN> To: info-guix@HIDDEN Subject: [GCD] Set search paths without program wrappers Date: Fri, 21 Feb 2025 10:41:50 +0800 Message-ID: <87r03s6mtt.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76428 Cc: 76428 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Hi Guix, "GCD 004: Set search paths without program wrappers" was submitted to address the issues of program wrappers. Discuss via email in <76428 <at> debbugs.gnu.org>, thanks. --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline; filename=004-set-search-paths-without-program-wrappers.md Content-Transfer-Encoding: quoted-printable title: Set search paths without program wrappers id: 004 status: submitted discussion: https://issues.guix.gnu.org/76428 authors: =E5=AE=8B=E6=96=87=E6=AD=A6 <iyzsong@HIDDEN> sponsors: Maxim Cournoyer <maxim.cournoyer@HIDDEN> date-submitted: 2025-02-21 date: 2025-02-21 SPDX-License-Identifier: CC-BY-SA-4.0 OR GFDL-1.3-no-invariants-or-later --- # Summary Currently program wrappers are widely used to set search paths via environment variables. Those wrappers have some problems: - environment variables leakage from a process to its child processes; - duplicate entries in environment variables; - obscured process names. To address those problems, we propose a way to set search paths with some per-output configuration files, reduce the need of creating program wrappers. # Motivation To make sure programs work out-of-the-box rather then depend on some external settings, Guix encourages the use of [program wrappers](https://gu= ix.gnu.org/manual/en/html_node/Build-Utilities.html#Wrappers) when define packages. In particular, both `glib-or-gtk-build-system` and `qt-build-system` includes a wrap phase to make program wrappers for ev= ery GNOME and KDE program. Those wrappers have some unsolved issues: - [Program crash due to leaked environment variables](https://issues.guix.g= nu.org/63203) - [Duplicate entries in various environment variables](https://issues.guix.= gnu.org/23118) - [Ansible & others' problems with wrapped '.ansible-real' scripts](https:/= /issues.guix.gnu.org/26752) If we managed to find a way to set search paths without using program wappers, then programs will be more robust. # Detailed Design In addition to environment variables, some programs also allow to set search paths via configuration files, for example you can use [path configuration files](https://docs.python.org/3/library/site.html) to set `sys.path` for Python, and we have a per-output [`ld.so.cache`](http= s://guix.gnu.org/en/blog/2021/taming-the-stat-storm-with-a-loader-cache/) to load shared libraries efficiently. Inspired by them, we are going to pa= tch some programs and libraries, so that when they build a search path from an environment variable, would also honor a per-output search path configurati= on file. The details are how to make those search path configuration files and how to find them when an executable is running. ## Search path configuration files We'll create search path configuration files under the `etc/search-path.d` directory of each package output, with each file specify a search path. The file name and its content are same to the corresponding environment variable. For example the output of the `gnome-console` package would have: ``` bin kgx etc ld.so.cache search-paths.d GUIX_XDG_DATA_DIRS GUIX_GIO_EXTRA_MODULES GUIX_GTK4_PATH lib share ``` The content of its `GUIX_XDG_DATA_DIRS` file would be: ``` /gnu/store/...-shared-mime-info-2.3/share:/gnu/store/...-glib-2.78.0/share:= /gnu/store/...-gsettings-desktop-schemas-44.0/share:/gnu/store/...-libadwai= ta-1.5.2/share:/gnu/store/...-gtk-4.14.5/share:/gnu/store/...-gnome-console= -44.4/share ``` Those search path configuration files would be created by the package build= er, after the `install` phase, replace usages of `wrap-program` when possible. ## Find the location of the current executable To find its search path configuration files when an executable is running, we can first find the location of the executable. Conveniently, Linux provides a pseudo-file `/proc/self/exe` for this exact purpose, which works well for ELF executables. But for an interpreter script, `/proc/self/exe` would return the file name of its interpreter instead of the script, so we patch interpreters to set 2 environment variables: - `GUIX_INTERPRETER_FILE`: absolute file name of the interpreter - `GUIX_MAIN_SCRIPT_FILE`: absolute file name of the script And when the executable's `/proc/self/exe` matches `GUIX_INTERPRETER_FILE`, we can get the script file name from `GUIX_MAIN_SCRIPT_FILE`. Alternativel= y, we can try to construct the script file name from command line arguments, b= ut that won't work when you run a script using a relative file name and its current working directory changed before we figure out the script file name. ## Implementation plan A WIP implementation can be found in <https://issues.guix.gnu.org/75688>. - Add a new function `g_guix_build_search_path_dirs` to GLib, which returns= a search path as a list of file or directory names from a search path configuration file and an environment variable. - Patch GLib to use `g_guix_build_search_path_dirs` for `GUIX_XDG_DATA_DIRS= `, `GUIX_XDG_CONFIG_DIRS`, `GUIX_GIO_EXTRA_MODULES` and `GUIX_GSETTINGS_SCHEMA_DIR`. - Patch Python to set `GUIX_INTERPRETER_FILE` and `GUIX_MAIN_SCRIPT_FILE`. - Patch Qt to use `g_guix_build_search_path_dirs` for `GUIX_XDG_DATA_DIRS`, `GUIX_XDG_CONFIG_DIRS`, `GUIX_QT_PLUGIN_PATH`, `GUIX_QML_IMPORT_PATH`, `GUIX_QML2_IMPORT_PATH`, `GUIX_QTWEBENGINEPROCESS_PATH`. - Modify `glib-or-gtk-build-system` to get rid of `wrap-program`. - Modify `qt-build-system` to get rid of `wrap-program`. # The Cost Of Reverting We can revert to program wrappers by manually adding wrap phases on a case = by case basic, if needed. # Drawbacks or Open Questions If implemented, we would likely carry several custom patches for GLib, GTK, Qt, Python, etc. forever. This proposal focuses solving problems caused by program wrappers in desktop environments, namely GNOME and KDE. Individual `wrap-progam` usages are not addressed. We plan to handle that in build systems later, for example: - Handle `GUIX_GI_TYPELIB_PATH` and `GUIX_GDK_PIXBUF_MODULE_FILES` in `glib-or-gtk-build-system` without wrappers. - Handle `GUIX_PYTHONPATH` in `python-build-system` without wrappers. There are still ABI problems caused by environment variables from profiles, which may be addressed later as suggested by Maxime Devos in <https://issues.guix.gnu.org/63203#5>. --=-=-=--
guix-patches@HIDDEN
:bug#76428
; Package guix-patches
.
Full text available.Received: (at 76428) by debbugs.gnu.org; 21 Feb 2025 02:27:53 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 20 21:27:53 2025 Received: from localhost ([127.0.0.1]:47320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tlIld-000668-1t for submit <at> debbugs.gnu.org; Thu, 20 Feb 2025 21:27:53 -0500 Received: from mail.envs.net ([5.199.136.28]:46084) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <iyzsong@HIDDEN>) id 1tlIla-00065e-Qv for 76428 <at> debbugs.gnu.org; Thu, 20 Feb 2025 21:27:51 -0500 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id F03BE38A3E53; Fri, 21 Feb 2025 02:27:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id vCuFGfhXrxbI; Fri, 21 Feb 2025 02:27:45 +0000 (UTC) Received: from localhost (unknown [112.44.101.188]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Fri, 21 Feb 2025 02:27:45 +0000 (UTC) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id e7660d49; Fri, 21 Feb 2025 02:31:45 +0000 (UTC) From: =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN> To: Simon Tournier <zimon.toutoune@HIDDEN> Subject: Re: bug#76428: [GCD PATCH] 003-set-search-paths-without-program-wrappers: Submit. In-Reply-To: <87eczseolc.fsf@HIDDEN> (Simon Tournier's message of "Thu, 20 Feb 2025 14:24:15 +0100") References: <20250220040827.4127-1-iyzsong@HIDDEN> <87eczseolc.fsf@HIDDEN> Date: Fri, 21 Feb 2025 10:31:44 +0800 Message-ID: <87v7t46nan.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76428 Cc: 76428 <at> debbugs.gnu.org, =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Simon Tournier <zimon.toutoune@HIDDEN> writes: > Hi, > > On Thu, 20 Feb 2025 at 12:08, iyzsong@HIDDEN wrote: > >> * 003-set-search-paths-without-program-wrappers.md: New file. > > [...] > >> +id: 003 > > Please consider that bug#76407 [1] is already 003. Well, the numbering > changes nothing at this point. The final number of this GCD =E2=80=9CSet= search > paths without program wrappers=E2=80=9D will be 004 though. > > >> +SPDX-License-Identifier: CC-BY-SA-4.0 OR GFDL-1.3-no-invariants-only > > I think this should be: GFDL-1.3-no-invariants-or-later as GCD 001 and > 000-template.md mentions it [2,3]. > > Except if you specifically want to be =E2=80=9C-only=E2=80=9D instead. :-) > Updated in v2, thank you!
guix-patches@HIDDEN
:bug#76428
; Package guix-patches
.
Full text available.Received: (at 76428) by debbugs.gnu.org; 21 Feb 2025 02:27:16 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 20 21:27:16 2025 Received: from localhost ([127.0.0.1]:47313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tlIl2-00061P-1z for submit <at> debbugs.gnu.org; Thu, 20 Feb 2025 21:27:16 -0500 Received: from mail.envs.net ([5.199.136.28]:33888) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <iyzsong@HIDDEN>) id 1tlIkx-00060f-Lj for 76428 <at> debbugs.gnu.org; Thu, 20 Feb 2025 21:27:13 -0500 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id E54C238A3E53; Fri, 21 Feb 2025 02:27:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id zyWQi67Cx3IK; Fri, 21 Feb 2025 02:27:06 +0000 (UTC) Received: from localhost (unknown [112.44.101.188]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Fri, 21 Feb 2025 02:27:06 +0000 (UTC) Received: from localhost.localdomain (localhost.lan [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id b0d4bb36; Fri, 21 Feb 2025 02:31:01 +0000 (UTC) From: iyzsong@HIDDEN To: 76428 <at> debbugs.gnu.org Subject: [PATCH v2] 004-set-search-paths-without-program-wrappers: Submit. Date: Fri, 21 Feb 2025 10:30:58 +0800 Message-ID: <20250221023100.2257-1-iyzsong@HIDDEN> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 76428 Cc: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) From: 宋文武 <iyzsong@HIDDEN> * 004-set-search-paths-without-program-wrappers.md: New file. --- ...t-search-paths-without-program-wrappers.md | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 004-set-search-paths-without-program-wrappers.md diff --git a/004-set-search-paths-without-program-wrappers.md b/004-set-search-paths-without-program-wrappers.md new file mode 100644 index 0000000..39fb473 --- /dev/null +++ b/004-set-search-paths-without-program-wrappers.md @@ -0,0 +1,146 @@ +title: Set search paths without program wrappers +id: 004 +status: submitted +discussion: https://issues.guix.gnu.org/76428 +authors: 宋文武 <iyzsong@HIDDEN> +sponsors: Maxim Cournoyer <maxim.cournoyer@HIDDEN> +date-submitted: 2025-02-20 +date: 2025-02-21 +SPDX-License-Identifier: CC-BY-SA-4.0 OR GFDL-1.3-no-invariants-or-later +--- + +# Summary + +Currently program wrappers are widely used to set search paths via +environment variables. Those wrappers have some problems: + + - environment variables leakage from a process to its child + processes; + - duplicate entries in environment variables; + - obscured process names. + +To address those problems, we propose a way to set search paths with +some per-output configuration files, reduce the need of creating +program wrappers. + + +# Motivation + +To make sure programs work out-of-the-box rather then depend on some +external settings, Guix encourages the use of [program wrappers](https://guix.gnu.org/manual/en/html_node/Build-Utilities.html#Wrappers) +when define packages. In particular, both `glib-or-gtk-build-system` +and `qt-build-system` includes a wrap phase to make program wrappers for every +GNOME and KDE program. + +Those wrappers have some unsolved issues: + +- [Program crash due to leaked environment variables](https://issues.guix.gnu.org/63203) +- [Duplicate entries in various environment variables](https://issues.guix.gnu.org/23118) +- [Ansible & others' problems with wrapped '.ansible-real' scripts](https://issues.guix.gnu.org/26752) + +If we managed to find a way to set search paths without using program +wappers, then programs will be more robust. + + +# Detailed Design + +In addition to environment variables, some programs also allow to set search +paths via configuration files, for example you can use +[path configuration files](https://docs.python.org/3/library/site.html) +to set `sys.path` for Python, and we have a per-output [`ld.so.cache`](https://guix.gnu.org/en/blog/2021/taming-the-stat-storm-with-a-loader-cache/) +to load shared libraries efficiently. Inspired by them, we are going to patch +some programs and libraries, so that when they build a search path from an +environment variable, would also honor a per-output search path configuration +file. The details are how to make those search path configuration files and +how to find them when an executable is running. + +## Search path configuration files + +We'll create search path configuration files under the `etc/search-path.d` +directory of each package output, with each file specify a search path. +The file name and its content are same to the corresponding environment +variable. For example the output of the `gnome-console` package would have: + +``` +bin + kgx +etc + ld.so.cache + search-paths.d + GUIX_XDG_DATA_DIRS + GUIX_GIO_EXTRA_MODULES + GUIX_GTK4_PATH +lib +share +``` + +The content of its `GUIX_XDG_DATA_DIRS` file would be: +``` +/gnu/store/...-shared-mime-info-2.3/share:/gnu/store/...-glib-2.78.0/share:/gnu/store/...-gsettings-desktop-schemas-44.0/share:/gnu/store/...-libadwaita-1.5.2/share:/gnu/store/...-gtk-4.14.5/share:/gnu/store/...-gnome-console-44.4/share +``` + +Those search path configuration files would be created by the package builder, +after the `install` phase, replace usages of `wrap-program` when possible. + + +## Find the location of the current executable + +To find its search path configuration files when an executable is running, +we can first find the location of the executable. Conveniently, Linux +provides a pseudo-file `/proc/self/exe` for this exact purpose, which works +well for ELF executables. But for an interpreter script, `/proc/self/exe` +would return the file name of its interpreter instead of the script, so +we patch interpreters to set 2 environment variables: + + - `GUIX_INTERPRETER_FILE`: absolute file name of the interpreter + - `GUIX_MAIN_SCRIPT_FILE`: absolute file name of the script + +And when the executable's `/proc/self/exe` matches `GUIX_INTERPRETER_FILE`, +we can get the script file name from `GUIX_MAIN_SCRIPT_FILE`. Alternatively, +we can try to construct the script file name from command line arguments, but +that won't work when you run a script using a relative file name and its +current working directory changed before we figure out the script file name. + + +## Implementation plan + +A WIP implementation can be found in <https://issues.guix.gnu.org/75688>. + +- Add a new function `g_guix_build_search_path_dirs` to GLib, which returns a + search path as a list of file or directory names from a search path + configuration file and an environment variable. +- Patch GLib to use `g_guix_build_search_path_dirs` for `GUIX_XDG_DATA_DIRS`, + `GUIX_XDG_CONFIG_DIRS`, `GUIX_GIO_EXTRA_MODULES` and + `GUIX_GSETTINGS_SCHEMA_DIR`. +- Patch Python to set `GUIX_INTERPRETER_FILE` and `GUIX_MAIN_SCRIPT_FILE`. +- Patch Qt to use `g_guix_build_search_path_dirs` for `GUIX_XDG_DATA_DIRS`, + `GUIX_XDG_CONFIG_DIRS`, `GUIX_QT_PLUGIN_PATH`, `GUIX_QML_IMPORT_PATH`, + `GUIX_QML2_IMPORT_PATH`, `GUIX_QTWEBENGINEPROCESS_PATH`. +- Modify `glib-or-gtk-build-system` to get rid of `wrap-program`. +- Modify `qt-build-system` to get rid of `wrap-program`. + + +# The Cost Of Reverting + +We can revert to program wrappers by manually adding wrap phases on a case by +case basic, if needed. + + +# Drawbacks or Open Questions + +If implemented, we would likely carry several custom patches for GLib, +GTK, Qt, Python, etc. forever. + + +This proposal focuses solving problems caused by program wrappers in desktop +environments, namely GNOME and KDE. Individual `wrap-progam` usages are not +addressed. We plan to handle that in build systems later, for example: + + - Handle `GUIX_GI_TYPELIB_PATH` and `GUIX_GDK_PIXBUF_MODULE_FILES` in + `glib-or-gtk-build-system` without wrappers. + - Handle `GUIX_PYTHONPATH` in `python-build-system` without wrappers. + + +There are still ABI problems caused by environment variables from +profiles, which may be addressed later as suggested by Maxime Devos in +<https://issues.guix.gnu.org/63203#5>. -- 2.48.1
guix-patches@HIDDEN
:bug#76428
; Package guix-patches
.
Full text available.Received: (at 76428) by debbugs.gnu.org; 20 Feb 2025 17:25:40 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 20 12:25:40 2025 Received: from localhost ([127.0.0.1]:39711 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tlAIs-0003ZS-IQ for submit <at> debbugs.gnu.org; Thu, 20 Feb 2025 12:25:40 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:47544) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <zimon.toutoune@HIDDEN>) id 1tlAIp-0003Y0-EU for 76428 <at> debbugs.gnu.org; Thu, 20 Feb 2025 12:25:36 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-439a1e8ba83so11792095e9.3 for <76428 <at> debbugs.gnu.org>; Thu, 20 Feb 2025 09:25:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740072329; x=1740677129; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ad4STafod6Nq70gYfA84jojg5TYUeK/Lj3qnyl7csx8=; b=JjumS4dHsDzoo8QGZEBPin6f7He57ueX+EZcGEwhGm0t0u5w1jMoB0m8VvVAtjg1Hy 4SrMTKHpRdsSgxI4+EfKQ5qbi2eSRNo/PcqhzfXfZcE4yns2Bndz1rqYBxfk7fqzNqHJ jVSNOqgpyDlHcxdluObM1ZjLT5NhobsdcZfgHD3HOUN3ChbrIo1RbSADuU7m8jtF5l19 IPcpea6969KqlLIftDlfXtYROHfY8xVFJaNCyVFT7IDfTIThAMOYTSGEQPCbw39Nu8er nEln6JIyNYC5LjMzqU1qqFUXsCRDkmyBTj8iQLwlmUX6zpFjyyCbsz7t1RZ2DzikHL6K lWJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740072329; x=1740677129; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Ad4STafod6Nq70gYfA84jojg5TYUeK/Lj3qnyl7csx8=; b=fxNXsSuamNog8t9KADskxO3+AKxjacufDVDd8ImshoZRiUfyc8/hALJtlWE5Vs4XmC XZrsK/Hm7hZ3XN28agmMcSu4cgn0sIaHFg/TxtS6M3B2sNyeZoPSWazdFBSTWheLcd6z VZ7GccPk8fmC/JqQtNps8QSC5NVp6PSpjcZlCiY4K4MlRDUxhnCLR1cJioHZ+Y1+7WLx iDXs0HAAhY163IxlMueKIvJq7nTl9vn+EYn3+2dJfB63/ZwHT/uCX0R7u8Sm9sA4IFnk jdfEuu3LgFAT79sS9KFE1GMQB/9oAp192ZbNULpjzVXVQuSjTxpF/vcCDqy8744c5RDy g0sA== X-Gm-Message-State: AOJu0YwTky6Ek/1zHO9Y9YgM8Fe0631wb8gPpDc82fpZcbsobYlXM44h BTHQrMboDXuhL4xWxXJ+dU7B3htu+Z8vvFcrFrwU7db9N6qpOIyr X-Gm-Gg: ASbGncvkYtDy3EwTe+odsgXmmhNjPWZHaQbZrBDdqQ9x7mOQCHu70FhDN1yCOHnspyI i+A8GF2EHPHrw3UPcqWfJ/cHPfwiQw/jPyW0jPS8BLLh/NjTzayD+0+f6zdEuxHOqJUOsqK2aRC az3sbRTr86mfEjmjPEwNiqaiIU/FmfXQ5oWuVgc/rineUCQc2UjVsHvPoHP05Hf/9NBN3tGQ6K/ pNlUsuJqDdOB63JnOo5owpnQHwEwhMny95ji41xsPqEuIOmtCnxFXTXGFYGHpZpSnu+eefyiw04 Zcpw90Q871/FuKrMgObXnluUWeTdbF5PjYjsbysHlatUWEJ9rTsl8QjodHemRXeQAuBpmy6g0C+ 1 X-Google-Smtp-Source: AGHT+IGyMJTXM6fu0OGe6D983TU+qZjNQPdY5ojbh2fu3e8UbYagb7wmgHPhrgT2aHAeBTGGANWAAA== X-Received: by 2002:a05:6000:1863:b0:38f:2ffc:10b0 with SMTP id ffacd0b85a97d-38f6e978a1emr97610f8f.27.1740072327772; Thu, 20 Feb 2025 09:25:27 -0800 (PST) Received: from lili (roam-nat-fw-prg-194-254-61-47.net.univ-paris-diderot.fr. [194.254.61.47]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f259fdce7sm21382203f8f.96.2025.02.20.09.25.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2025 09:25:27 -0800 (PST) From: Simon Tournier <zimon.toutoune@HIDDEN> To: iyzsong@HIDDEN Subject: Re: bug#76428: [GCD PATCH] 003-set-search-paths-without-program-wrappers: Submit. In-Reply-To: <20250220040827.4127-1-iyzsong@HIDDEN> (iyzsong@HIDDEN's message of "Thu, 20 Feb 2025 12:08:23 +0800") References: <20250220040827.4127-1-iyzsong@HIDDEN> Date: Thu, 20 Feb 2025 14:24:15 +0100 Message-ID: <87eczseolc.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, On Thu, 20 Feb 2025 at 12:08, > * 003-set-search-paths-without-program-wrappers.md: New file. Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:32c listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 1.1 DATE_IN_PAST_03_06 Date: is 3 to 6 hours before Received: date 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (zimon.toutoune[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Debbugs-Envelope-To: 76428 Cc: 76428 <at> debbugs.gnu.org, =?utf-8?B?5a6L5paH5q2m?= <iyzsong@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.1 (/) Hi, On Thu, 20 Feb 2025 at 12:08, iyzsong@HIDDEN wrote: > * 003-set-search-paths-without-program-wrappers.md: New file. [...] > +id: 003 Please consider that bug#76407 [1] is already 003. Well, the numbering changes nothing at this point. The final number of this GCD =E2=80=9CSet s= earch paths without program wrappers=E2=80=9D will be 004 though. > +SPDX-License-Identifier: CC-BY-SA-4.0 OR GFDL-1.3-no-invariants-only I think this should be: GFDL-1.3-no-invariants-or-later as GCD 001 and 000-template.md mentions it [2,3]. Except if you specifically want to be =E2=80=9C-only=E2=80=9D instead. :-) Cheers, simon 1: [bug#76407] [GCD] A better name for the default branch Liliana Marie Prikler <liliana.prikler@HIDDEN> Tue, 18 Feb 2025 23:07:07 +0100 id:b900cd17b88123af3ae95f4e7d572e540f86e879.camel@HIDDEN https://issues.guix.gnu.org/76407 https://issues.guix.gnu.org/msgid/b900cd17b88123af3ae95f4e7d572e540f86e879.= camel@HIDDEN https://yhetil.org/guix/b900cd17b88123af3ae95f4e7d572e540f86e879.camel@gmai= l.com 2: https://git.savannah.gnu.org/cgit/guix/guix-consensus-documents.git/tree= /001-gcd-process.md?id=3Dc6a594ceb316e23bea975928eb2f40b7df450c94#n8 3: https://git.savannah.gnu.org/cgit/guix/guix-consensus-documents.git/tree= /000-template.md?id=3Dc6a594ceb316e23bea975928eb2f40b7df450c94#n8
guix-patches@HIDDEN
:bug#76428
; Package guix-patches
.
Full text available.Received: (at submit) by debbugs.gnu.org; 20 Feb 2025 04:05:12 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 19 23:05:12 2025 Received: from localhost ([127.0.0.1]:57203 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tkxoB-0000hm-O8 for submit <at> debbugs.gnu.org; Wed, 19 Feb 2025 23:05:12 -0500 Received: from lists.gnu.org ([2001:470:142::17]:37004) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <iyzsong@HIDDEN>) id 1tkxo9-0000cB-6D for submit <at> debbugs.gnu.org; Wed, 19 Feb 2025 23:05:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <iyzsong@HIDDEN>) id 1tkxnx-0003kz-Fw for guix-patches@HIDDEN; Wed, 19 Feb 2025 23:04:53 -0500 Received: from mail.envs.net ([5.199.136.28]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <iyzsong@HIDDEN>) id 1tkxnt-0000fF-Vk for guix-patches@HIDDEN; Wed, 19 Feb 2025 23:04:52 -0500 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id 48BC038A3E89; Thu, 20 Feb 2025 04:04:40 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id FmLO5oPLJfz9; Thu, 20 Feb 2025 04:04:36 +0000 (UTC) Received: from localhost (unknown [112.44.101.188]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Thu, 20 Feb 2025 04:04:36 +0000 (UTC) Received: from localhost.localdomain (localhost.lan [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id aef8af97; Thu, 20 Feb 2025 04:08:31 +0000 (UTC) From: iyzsong@HIDDEN To: guix-patches@HIDDEN Subject: [GCD PATCH] 003-set-search-paths-without-program-wrappers: Submit. Date: Thu, 20 Feb 2025 12:08:23 +0800 Message-ID: <20250220040827.4127-1-iyzsong@HIDDEN> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=5.199.136.28; envelope-from=iyzsong@HIDDEN; helo=mail.envs.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.1 (/) From: 宋文武 <iyzsong@HIDDEN> * 003-set-search-paths-without-program-wrappers.md: New file. --- ...t-search-paths-without-program-wrappers.md | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 003-set-search-paths-without-program-wrappers.md diff --git a/003-set-search-paths-without-program-wrappers.md b/003-set-search-paths-without-program-wrappers.md new file mode 100644 index 0000000..1a75bcb --- /dev/null +++ b/003-set-search-paths-without-program-wrappers.md @@ -0,0 +1,146 @@ +title: Set search paths without program wrappers +id: 003 +status: submitted +discussion: https://issues.guix.gnu.org/<number assigned by issue tracker> +authors: 宋文武 <iyzsong@HIDDEN> +sponsors: Maxim Cournoyer <maxim.cournoyer@HIDDEN> +date-submitted: 2025-02-20 +date: 2025-02-20 +SPDX-License-Identifier: CC-BY-SA-4.0 OR GFDL-1.3-no-invariants-only +--- + +# Summary + +Currently program wrappers are widely used to set search paths via +environment variables. Those wrappers have some problems: + + - environment variables leakage from a process to its child + processes; + - duplicate entries in environment variables; + - obscured process names. + +To address those problems, we propose a way to set search paths with +some per-output configuration files, reduce the need of creating +program wrappers. + + +# Motivation + +To make sure programs work out-of-the-box rather then depend on some +external settings, Guix encourages the use of [program wrappers](https://guix.gnu.org/manual/en/html_node/Build-Utilities.html#Wrappers) +when define packages. In particular, both `glib-or-gtk-build-system` +and `qt-build-system` includes a wrap phase to make program wrappers for every +GNOME and KDE program. + +Those wrappers have some unsolved issues: + +- [Program crash due to leaked environment variables](https://issues.guix.gnu.org/63203) +- [Duplicate entries in various environment variables](https://issues.guix.gnu.org/23118) +- [Ansible & others' problems with wrapped '.ansible-real' scripts](https://issues.guix.gnu.org/26752) + +If we managed to find a way to set search paths without using program +wappers, then programs will be more robust. + + +# Detailed Design + +In addition to environment variables, some programs also allow to set search +paths via configuration files, for example you can use +[path configuration files](https://docs.python.org/3/library/site.html) +to set `sys.path` for Python, and we have a per-output [`ld.so.cache`](https://guix.gnu.org/en/blog/2021/taming-the-stat-storm-with-a-loader-cache/) +to load shared libraries efficiently. Inspired by them, we are going to patch +some programs and libraries, so that when they build a search path from an +environment variable, would also honor a per-output search path configuration +file. The details are how to make those search path configuration files and +how to find them when an executable is running. + +## Search path configuration files + +We'll create search path configuration files under the `etc/search-path.d` +directory of each package output, with each file specify a search path. +The file name and its content are same to the corresponding environment +variable. For example the output of the `gnome-console` package would have: + +``` +bin + kgx +etc + ld.so.cache + search-paths.d + GUIX_XDG_DATA_DIRS + GUIX_GIO_EXTRA_MODULES + GUIX_GTK4_PATH +lib +share +``` + +The content of its `GUIX_XDG_DATA_DIRS` file would be: +``` +/gnu/store/...-shared-mime-info-2.3/share:/gnu/store/...-glib-2.78.0/share:/gnu/store/...-gsettings-desktop-schemas-44.0/share:/gnu/store/...-libadwaita-1.5.2/share:/gnu/store/...-gtk-4.14.5/share:/gnu/store/...-gnome-console-44.4/share +``` + +Those search path configuration files would be created by the package builder, +after the `install` phase, replace usages of `wrap-program` when possible. + + +## Find the location of the current executable + +To find its search path configuration files when an executable is running, +we can first find the location of the executable. Conveniently, Linux +provides a pseudo-file `/proc/self/exe` for this exact purpose, which works +well for ELF executables. But for an interpreter script, `/proc/self/exe` +would return the file name of its interpreter instead of the script, so +we patch interpreters to set 2 environment variables: + + - `GUIX_INTERPRETER_FILE`: absolute file name of the interpreter + - `GUIX_MAIN_SCRIPT_FILE`: absolute file name of the script + +And when the executable's `/proc/self/exe` matches `GUIX_INTERPRETER_FILE`, +we can get the script file name from `GUIX_MAIN_SCRIPT_FILE`. Alternatively, +we can try to construct the script file name from command line arguments, but +that won't work when you run a script using a relative file name and its +current working directory changed before we figure out the script file name. + + +## Implementation plan + +A WIP implementation can be found in <https://issues.guix.gnu.org/75688>. + +- Add a new function `g_guix_build_search_path_dirs` to GLib, which returns a + search path as a list of file or directory names from a search path + configuration file and an environment variable. +- Patch GLib to use `g_guix_build_search_path_dirs` for `GUIX_XDG_DATA_DIRS`, + `GUIX_XDG_CONFIG_DIRS`, `GUIX_GIO_EXTRA_MODULES` and + `GUIX_GSETTINGS_SCHEMA_DIR`. +- Patch Python to set `GUIX_INTERPRETER_FILE` and `GUIX_MAIN_SCRIPT_FILE`. +- Patch Qt to use `g_guix_build_search_path_dirs` for `GUIX_XDG_DATA_DIRS`, + `GUIX_XDG_CONFIG_DIRS`, `GUIX_QT_PLUGIN_PATH`, `GUIX_QML_IMPORT_PATH`, + `GUIX_QML2_IMPORT_PATH`, `GUIX_QTWEBENGINEPROCESS_PATH`. +- Modify `glib-or-gtk-build-system` to get rid of `wrap-program`. +- Modify `qt-build-system` to get rid of `wrap-program`. + + +# The Cost Of Reverting + +We can revert to program wrappers by manually adding wrap phases on a case by +case basic, if needed. + + +# Drawbacks or Open Questions + +If implemented, we would likely carry several custom patches for GLib, +GTK, Qt, Python, etc. forever. + + +This proposal focuses solving problems caused by program wrappers in desktop +environments, namely GNOME and KDE. Individual `wrap-progam` usages are not +addressed. We plan to handle that in build systems later, for example: + + - Handle `GUIX_GI_TYPELIB_PATH` and `GUIX_GDK_PIXBUF_MODULE_FILES` in + `glib-or-gtk-build-system` without wrappers. + - Handle `GUIX_PYTHONPATH` in `python-build-system` without wrappers. + + +There are still ABI problems caused by environment variables from +profiles, which may be addressed later as suggested by Maxime Devos in +<https://issues.guix.gnu.org/63203#5>. -- 2.48.1
iyzsong@HIDDEN
:guix-patches@HIDDEN
.
Full text available.guix-patches@HIDDEN
:bug#76428
; Package guix-patches
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.