From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 28 02:58:08 2021 Received: (at 20255) by debbugs.gnu.org; 28 Jun 2021 06:58:08 +0000 Received: from localhost ([127.0.0.1]:50796 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxlDc-0001HP-Gn for submit@debbugs.gnu.org; Mon, 28 Jun 2021 02:58:08 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:50544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxlDa-0001HF-Ds for 20255@debbugs.gnu.org; Mon, 28 Jun 2021 02:58:07 -0400 Received: from nijino.local (62-116-34-49.adsl.highway.telekom.at [62.116.34.49]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4GCz2d0Tlfz3wmX; Mon, 28 Jun 2021 08:58:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1624863483; bh=72iDOKLKQRikC7e38nTpYxuJwN+RPtPQ0tt7CRPnAMM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=kNmt3RzMbHss7h/2OB32THb89XDI8pRnAQ8TWKDvd6gSNfq8Mjz5RMWQAWwS9Ra4W /nJe7evknKMaFWjITeRQjcA/UT2QyB5Nc+QE6Ut4GMYUX9goE2pUw+6yAeR245puKF aGbgQnh12Vj8Z0iylajsEwS3TTZZbNsqR2/2KFoI= Message-ID: Subject: Re: bug#20255: 'search-paths' should respect both user and system profile. From: Leo Prikler To: Maxim Cournoyer Date: Mon, 28 Jun 2021 08:58:00 +0200 In-Reply-To: <87mtrawqq8.fsf@gmail.com> References: <87eeun97ur.fsf@gmail.com> <874kdlxsfl.fsf_-_@gmail.com> <5f385b99827c7c069094e1ed0fb2bd52f5345445.camel@student.tugraz.at> <87mtrawqq8.fsf@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.116 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20255 Cc: zimoun , mhw@netris.org, Alex Kost , 20255@debbugs.gnu.org, iyzsong@gmail.com, Ludovic =?ISO-8859-1?Q?Court=E8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Am Montag, den 28.06.2021, 00:35 -0400 schrieb Maxim Cournoyer: > Hi Leo, > > [...] > > > I think there is a solution, that works not only for the case of > > disabling this unwanted feature, but also to add in support for > > multiple profiles, i.e. if the user has more than just their .guix- > > profile to load. > > > > If we made this feature opt-in in that a user would first have to > > write > > their profiles to $HOME/.config/guix/default-profiles or a > > similarly > > named file in $HOME/.config/guix, we could simply not run the > > command > > if the file doesn't exist, and if it exists run it using the > > profiles > > in there. > > > > Most users will likely have > > > > /home/myself/.guix-profile > > /run/current-system/profile > > > > in it, but you could also have > > > > /home/myself/.guix-extra-profiles/emacs > > /home/myself/.guix-extra-profiles/hundreds-of-npm-packages > > /home/myself/.guix-extra-profiles/rusty-rust > > /home/myself/.guix-profile > > /run/current-system/profile > > > > Of course, having to type out /home/myself is somewhat weird, and > > the > > last two lines are a bit of boilerplate, that one might want to > > avoid. > > We could alternatively make it so that an empty file means "use > > $HOME/.guix-profile and /run/current-system/profile", such that > > those > > are always sourced no matter what. WDYT? > > I like this later idea (does what a user would reasonably expect by > default, which is to consider both the system and the user profile by > default). A user specifying that file manually could then override > the > default behavior to have it source extra profiles, or none at all. > > Some small difference I'd propose: > > An non-existing $HOME/.config/guix/default-profiles file would be > equivalent to an existing file containing: > > - $HOME/.guix-profile > - /run/current-system/profile > > as the default behavior. The behaviour for a missing default-profiles is nothing so as to address the concerns raised by Alex Kost about running the guix binary without the user's consent. It still runs external binaries such as test, but IIRC those are already run in our existing setup, so that's not really a concern worth raising. I do agree, that your solution is more reasonable if there's nothing else to consider. > Now we'd need to look at how feasible it is to implement such a > feature. A naïve implementation would be a pipe with sed and xargs, but I don't know how well that'd guard against shell code exploits. A more complicated approach might take a few lines of shell code, but I don't think it would be excessively large. > Thanks for this clever suggestion! It seems we may be able to find a > good middle ground :-). > > Maxim