From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: bug#20255: 'search-paths' should respect both user and system profile. Date: Sun, 22 Nov 2015 10:52:29 +0300 Message-ID: <87r3jisc76.fsf@gmail.com> References: <877ftschjt.fsf@gmail.com> <87fv8fip01.fsf@gnu.org> <87d23j1bxk.fsf@gmail.com> <871tjyfnl8.fsf@gnu.org> <876199q4z1.fsf@gmail.com> <87ioca4ojo.fsf@gnu.org> <87lh9tvcws.fsf@gnu.org> <87h9kguwc4.fsf@gmail.com> <87ziy7d90z.fsf@gnu.org> <874mgfkxee.fsf@gmail.com> <87wptb5d1y.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0PSO-0005mf-1a for bug-guix@gnu.org; Sun, 22 Nov 2015 02:53:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0PSI-0005AU-WA for bug-guix@gnu.org; Sun, 22 Nov 2015 02:53:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:57884) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0PSI-0005AQ-Sr for bug-guix@gnu.org; Sun, 22 Nov 2015 02:53:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a0PSI-0005YU-Kx for bug-guix@gnu.org; Sun, 22 Nov 2015 02:53:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87wptb5d1y.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sat, 21 Nov 2015 21:10:17 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 20255@debbugs.gnu.org Ludovic Court=C3=A8s (2015-11-21 23:10 +0300) wrote: > Alex Kost skribis: > >> Ludovic Court=C3=A8s (2015-11-21 11:57 +0300) wrote: >> >>> Alex Kost skribis: >>> >>>> Ludovic Court=C3=A8s (2015-11-20 01:32 +0300) wrote: >>>> >>>>> -# Load the system profile's settings. >>>>> +if [ -x /run/current-system/profile/bin/guix ] >>>>> +then >>>>> + # Crucial variables such as 'MANPATH' or 'INFOPATH' may be missing= from the >>>>> + # profiles' individual 'etc/profile'. Thus, combine both profiles= when >>>>> + # computing the search paths. >>>>> + # >>>>> + # This may take a few hundred milliseconds, but it's OK because th= is is >>>>> + # performed for log-in shells only. >>>>> + eval `/run/current-system/profile/bin/guix package \\ >>>>> + -p /run/current-system/profile \\ >>>>> + -p \"$HOME/.guix-profile\" --search-paths` >>>> >>>> Sorry, but it's not OK for me. As a user, I'm *strongly* against >>>> running 'guix' (or any other program) in /etc/profile. >>> >>> Why? (Honest question.) >> >> At first, because of the slowdown: it may be a few hundred milliseconds >> for you, but it's several seconds for me. > > Really? Can you show the output of: > > time guix package -p /run/current-system/profile \ > -p ~/.guix-profile --search-paths real 0m2.634s user 0m0.568s sys 0m0.080s Of course, on the second run the real time reduces (for me it's about 0.5), as HDD already "knows" what I want, but since it is for login shell, it will always be 2-3 seconds because of HDD. >> But actually, even if it was several milliseconds, I still wouldn't >> like it, as (IMHO) /etc/profile should only set variables, and not run >> external programs. > > I don=E2=80=99t buy this =E2=80=9Cprinciple=E2=80=9D: /etc/profile is a p= rogram, and the output > of --search-paths is trusted to contain only environment variable > setting. Sure, it's just my opinion (OK, let call it "faith"): I consider running external programs in "/etc/profile" malicious. > In the discussion of this bug, we tried hard to avoid resorting to > invoking a program, but ultimately no other solution came out. I don't need a solution for this bug, I just want to have an option to avoid invoking "guix package --search-paths" in my "/etc/profile". >>>> I would really like to have an option to avoid this. Is it possible? >>> >>> Not that I know of. Please read . >> >> What about making some environment variable which will be honored by >> 'operating-system-etc-service' procedure. So depending on this variable >> that 'eval ...' command will or will not be added to "/etc/profile" >> during 'guix system ...' process. >> >> For example, when I do: >> >> GUIX_IGNORE_SYSTEM_PROFILE_ENV=3D1 guix system build my-config.scm >> >> the "etc/profile" of the built system will not contain those 'eval ...' >> lines. WDYT? > > This would be unreasonable. We=E2=80=99re talking about a basic feature = here. > If basic features are broken to the point that we prefer to offer ways > to bypass them, and have a semi-broken system, then there=E2=80=99s a pro= blem, > IMO. Sorry, but I would really like to bypass this feature, as I don't like it. For me, what you suggest sounds: =C2=ABWe'll not give a freedom to a user to disable this feature, because we know better what is good for him/her=C2=BB. All I ask is to give me such a freedom. Using --search-paths with several profiles is a great feature (thank you for it!) and I like it, but consider the following use-case: for some reason I like to manage several profiles instead of a single "~/.guix-profile", so I can put: eval `guix package -p /run/current-system/profile \ -p ~/.guix-profile \ -p ~/my-guix-profiles/foo \ -p ~/my-guix-profiles/bar \ --search-paths` in my "~/.bash_profile". So I don't like to have the same command but only for 2 profiles in my "/etc/profile". Please, give me an option to disable this feature. --=20 Alex