From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id wDJ6GhjGyF8jPAAA0tVLHw (envelope-from ) for ; Thu, 03 Dec 2020 11:03:52 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id aP1CFhjGyF9xCAAAbx9fmQ (envelope-from ) for ; Thu, 03 Dec 2020 11:03:52 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C7E9F9409F1 for ; Thu, 3 Dec 2020 11:03:51 +0000 (UTC) Received: from localhost ([::1]:46132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkmOr-0005vR-7m for larch@yhetil.org; Thu, 03 Dec 2020 06:03:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkmKE-0001Db-EI for bug-guix@gnu.org; Thu, 03 Dec 2020 05:59:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:55288) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kkmKD-0003Vt-UY for bug-guix@gnu.org; Thu, 03 Dec 2020 05:59:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kkmKD-0003Pr-UA for bug-guix@gnu.org; Thu, 03 Dec 2020 05:59:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#23118: Duplicate entries in various environment variables Resent-From: Leo Prikler Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 03 Dec 2020 10:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23118 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Chris Marusich Received: via spool by 23118-submit@debbugs.gnu.org id=B23118.160699312713083 (code B ref 23118); Thu, 03 Dec 2020 10:59:01 +0000 Received: (at 23118) by debbugs.gnu.org; 3 Dec 2020 10:58:47 +0000 Received: from localhost ([127.0.0.1]:38595 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kkmJy-0003Ox-Op for submit@debbugs.gnu.org; Thu, 03 Dec 2020 05:58:47 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:48330) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kkmJw-0003On-Os for 23118@debbugs.gnu.org; Thu, 03 Dec 2020 05:58:45 -0500 Received: from nijino.local (217-149-166-73.nat.highway.telekom.at [217.149.166.73]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4Cmt9r2rp4z1LBCr; Thu, 3 Dec 2020 11:58:40 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4Cmt9r2rp4z1LBCr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1606993120; bh=iZ2WKAiQU19E+L7RSufjHCuqwyDyfbFA2vNDqiAhhm8=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=A3ek2Bqw4NvSYh2rvLFxiKLlCBl2vvoaw1k/lRrpBBQ7vBjWPVZMlS3o5/Oc4lNgD SAT5raxJexBlQunCX2NRf3Jo/RNez3BQa1q+7ypdVZWKNJcl6ydmgXk0jbyO9qnCPx bBQnT7jMwkoRQm8pPjfzRG+ThtyC8n/8fYhZP4Bo= Message-ID: <6ca9bc2b5bb96b0ea6740c3412d6aa4379d553e9.camel@student.tugraz.at> From: Leo Prikler Date: Thu, 03 Dec 2020 11:58:39 +0100 In-Reply-To: <874mbt28k4.fsf@gmail.com> References: <874mbt28k4.fsf@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 23118@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.18 Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=tugraz.at header.s=mailrelay header.b=A3ek2Bqw; dmarc=fail reason="SPF not aligned (relaxed)" header.from=student.tugraz.at (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: C7E9F9409F1 X-Spam-Score: -1.18 X-Migadu-Scanner: ns3122888.ip-94-23-21.eu X-TUID: 25o4ZctPrYCf Hello, Chris Am Freitag, den 25.03.2016, 20:59 -0700 schrieb Chris Marusich: > Hi, > > I've noticed that my environment variables contain duplicate > (sometimes > more) entries. This occurs regardless of whether the user logs in > directly via a tty or via a desktop environment like GNOME. > > [...] > > As you can see, there are some environment variables with up to 9 > duplicate entries. Is this expected? Is it a problem? Why is it > happening? Assuming that it is not expected and that it is a > problem, > how can we prevent it from happening? It has been pointed out, that this is somewhat expected when wrapping the same environment variable multiple times. For instance, you as a GNOME user might already have gtk+ in your GTK path if you run GNOME, but GNOME applications can not rely on that and thus need to add their own. As the number of software components, that use it increases, so does the number of mentions. In the special case of gnome-terminal, this is user-visible by printing out env, but other applications get launched in a similar manner all the time without you noticing. Perhaps one could patch GNOME terminal to clear those variables before spawning the shell, but that's going to be a bit fiddly. Alternatively, one could enforce GTK_PATH by using "=" instead of prefix. More generally, this can become an issue when environment variables reach a certain size (and has led to bug reports in Guix before, which have since been fixed). POSIX mandates a syntax, that would allow removing already present components first (see [1]), but I can hardly imagine what monstrosities we would need to cook up to do this reliably. Not to mention, that some otherwise POSIX-compliant shells might not implement that syntax (correctly). Regards, Leo [1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02