From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 03 01:51:37 2019 Received: (at 36021) by debbugs.gnu.org; 3 Jun 2019 05:51:37 +0000 Received: from localhost ([127.0.0.1]:41421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hXfsc-0005jR-Sq for submit@debbugs.gnu.org; Mon, 03 Jun 2019 01:51:36 -0400 Received: from mx1.riseup.net ([198.252.153.129]:41446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hXfsa-0005jH-Ht for 36021@debbugs.gnu.org; Mon, 03 Jun 2019 01:51:33 -0400 Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.riseup.net (Postfix) with ESMTPS id 5E98E1A1995; Sun, 2 Jun 2019 22:51:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1559541091; bh=v0TobErMAAitzvjI8npQwj4KpDka7dywVvcZ9JBjdnE=; h=References:From:To:Cc:Subject:In-reply-to:Date:From; b=Qa0XGBU4+OOwW9UTH8LnR+Q8yDYR4C4ruujzSdQFQVLbLahULSmMRSpczfsmpdLfF 7tA1aahQ/WQiahQgYappMi2SDyTjfb1WpT4r3x0mmTb9jfg0wzlMfbghFb7Noy/rOv gMgdlU+XHssOO7kQdRnduO5F2BHE+Tbeex3OJ9dQ= X-Riseup-User-ID: 66CAC49A7FE8F09D508CB3F9EBD476AD039532295C401C66B7D82E396BA13BC8 Received: from [127.0.0.1] (localhost [127.0.0.1]) by capuchin.riseup.net (Postfix) with ESMTPSA id B2654120025; Sun, 2 Jun 2019 22:51:30 -0700 (PDT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 3ad4f8fd; Mon, 3 Jun 2019 05:51:27 +0000 (UTC) References: <20190531103630.6739-1-dfrumin@cs.ru.nl> <4c3d1d91-18ae-954f-2f0f-a979a974fb2c@cs.ru.nl> From: Meiyo Peng To: Dan Frumin Subject: Re: [bug#36021] [PATCH] search-paths: 'environment-variable-definition' output for fish In-reply-to: <4c3d1d91-18ae-954f-2f0f-a979a974fb2c@cs.ru.nl> Date: Mon, 03 Jun 2019 13:51:27 +0800 Message-ID: <87o93fkyhs.fsf@riseup.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 36021 Cc: 36021@debbugs.gnu.org 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: -1.7 (-) Hi Dan, Dan Frumin writes: > Some background on this patch: > Right now whenever I do any Guix operation that requires me to modify > environment variables (e.g. installing a Guile library requires me to update > $GUILE_LOAD_PATH afterwards), Guix helpful tells me what commands I have to run > to update the variables. > > However, those commands are currently in bash/POSIX(?) format `export > VAR=VALUE`. I've modified the `environment-variable-definition` function to > support the syntax for Fish shell as well. I don't know if this method of > looking at the $SHELL variable is sound, but it works on my machine. > > Documentation for the `set' function in Fish: https://fishshell.com/docs/current/commands.html#set > > PS: this is my first non-package patch for Guix so I apologize if there is something wrong with the patch I think this patch will cause more trouble than good. Does this patch replaces etc/profile with fish syntax script? etc/profile is supposed to be in POSIX shell syntax. Fish shell has it's own configuration files in /etc/fish/config.fish and /etc/fish/conf.d/*.fish. If you really want to generate fish syntax scripts, please put them in /etc/fish/config.fish or /etc/fish/conf.d/*.fish. See: 1. https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00071.html 2. https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00333.html 3. https://issues.guix.gnu.org/issue/34153 Have you tried the fish-foreign-env package? You can source bash scripts in fish via `fenv source ~/.guix-profile/etc/profile`. That's how the fish shell in Guix set up environment variables upon login. Perhaps we can handle this better. Do you have any suggestions? My idea: 1. The fish-foreign-env package is very useful but it's not installed by default in order to avoid polluting user's profiles according to the Guix convention. In this case I think it's a useful utility rather than pollution. Do you want it to be installed together with the fish package by default? 2. etc/profile is supposed to be sourced by a login shell. And we should avoid sourcing it from a non-login shell. That's why I made the fish package in Guix only sources it upon login. That means starting a new fish shell won't source it automatically. So please source it manually if you need the new environment variables (fenv source ~/.guix-profile/etc/profile). 3. We can write better documentations explaining how to deal with fish shell in Guix. There's an old discussion about having a Guix wiki or a Guix book. -- Meiyo Peng https://www.pengmeiyu.com/