From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre Neidhardt Subject: Re: Profiles/manifests-related command line interface enhancements Date: Fri, 25 Oct 2019 11:29:39 +0200 Message-ID: <87ftjhtbp8.fsf@ambrevar.xyz> References: <87mudrxvs8.fsf@ambrevar.xyz> <87d0emwm95.fsf@netris.org> <87imoewks8.fsf@ambrevar.xyz> <20191024184246.014d810e@scratchpost.org> <87tv7yt3e2.fsf@ambrevar.xyz> <875zkevtel.fsf@netris.org> <87o8y5ucyj.fsf@ambrevar.xyz> <87v9sdvnb9.fsf@netris.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:57516) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNvun-0002ZI-Nw for guix-devel@gnu.org; Fri, 25 Oct 2019 05:29:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNvul-0004FV-4V for guix-devel@gnu.org; Fri, 25 Oct 2019 05:29:49 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:36627) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNvuk-0004CU-1A for guix-devel@gnu.org; Fri, 25 Oct 2019 05:29:47 -0400 In-Reply-To: <87v9sdvnb9.fsf@netris.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Mark H Weaver Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Mark! Mark H Weaver writes: > It doesn't remove them, but it overwrites them, thus losing the > information of what the previous environment was. Now, it's true that > for *most* of those environment variables, the previous value is a > suffix of the new value, but that's not always the case. One notable > counter-example is GUIX_PROFILE itself, which is simply overwritten. > Others include GIT_EXEC_PATH and ASPELL_DICT_DIR. =2D ASPELL_DICT_DIR is broken: #29686. We should fix it anyways. =2D What's the use of GUIX_PROFILE once a profile is loaded? I believe it's only there for the user to know which was the last loaded profile. Which is a bit broken in my opinion: I believe GUIX_PROFILE should point to the default profile, but this is not possible when using multiple profiles. With my `guix-activate` proposal, GUIX_PROFILE would not have to be overridden. Although we could also fix this by modifying the etc/profile file so that they don't depend on GUIX_PROFILE being set to themselves (which is the actual bug here). =2D You are right about GIT_EXEC_PATH, any clue why it has to be overridden? > There's no way to change the environment variable in Emacs without > running Emacs lisp code, e.g. by running M-x setenv. Indeed, for Emacs `guix-activate` would run some Elisp code. It would essentially work for every program that can edit its own environment. > Note that I'm not passing judgement on the merits of your proposals, I'm > merely letting you know that they cannot be implemented as envisioned, > at least not if I understand correctly. With the shell/Emacs/etc. specialization we discussed, I believe it would be :) To clarify: what I'm proposing is a more universal, better encapsulated way to activate profiles. Currently we can do =2D-8<---------------cut here---------------start------------->8--- GUIX_PROFILE=3D/path/to/profile ; . $GUIX_PROFILE/etc/profile =2D-8<---------------cut here---------------end--------------->8--- which has some shortcomings: =2D It only works for Bourne-style shells. Activating profiles for different shells / programs require some work from the user; we should do this work upstream I believe. =2D It exposes too many implementation details. =2D It's too long ;) Cheers! =2D-=20 Pierre Neidhardt https://ambrevar.xyz/ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl2ywIMACgkQm9z0l6S7 zH8MbQf/b93r4jUb8cc4R74MdarlqK5oEsjOG8gJ6JGLBGCjeHzswMGRiVz9JZzQ FUEFsKUYtXtnDWzRHEB9PA4e4aNH8mgi/P1+mbSbbs1iVNX9+to+Qys1gol6AOoW 2cqz6uGZZlebSQ1Xru0aTntjH1Fc/5JS1hnaewg9dPTlFDeW8Dc3pheZK/zZX3RH glNX3bc7ozWkcO4y6Pc9vED4bRQhlxcNkHPSi8UizfbCU2w8KBggwvkKn1J52y6Y SzGCci13qPoJ+nUNAj/mMLHjg8z4maa6ItWEPvRQB0irugjmYKf0Kcjxx4eY1cXp VQSzLh+QpMzbKYEU/owkVtmYDn0Uyw== =GA1l -----END PGP SIGNATURE----- --=-=-=--