From mboxrd@z Thu Jan 1 00:00:00 1970 From: Meiyo Peng Subject: bug#30265: Fish shell has wrong path variables Date: Sat, 27 Jan 2018 17:11:46 +0800 Message-ID: <87inbnpsx9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1efMXp-0000nH-Ob for bug-guix@gnu.org; Sat, 27 Jan 2018 04:13:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1efMXm-0001YH-7r for bug-guix@gnu.org; Sat, 27 Jan 2018 04:13:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:36435) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1efMXm-0001XS-3D for bug-guix@gnu.org; Sat, 27 Jan 2018 04:13:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1efMXl-0000Gn-Qx for bug-guix@gnu.org; Sat, 27 Jan 2018 04:13:01 -0500 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1efMX0-0000bz-GC for bug-guix@gnu.org; Sat, 27 Jan 2018 04:12:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1efMWx-0000kr-9X for bug-guix@gnu.org; Sat, 27 Jan 2018 04:12:14 -0500 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:43808) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1efMWx-0000iq-3Q for bug-guix@gnu.org; Sat, 27 Jan 2018 04:12:11 -0500 Received: by mail-pg0-x243.google.com with SMTP id n17so1571398pgf.10 for ; Sat, 27 Jan 2018 01:12:10 -0800 (PST) Received: from sid ([27.17.20.242]) by smtp.gmail.com with ESMTPSA id g69sm11367846pgc.32.2018.01.27.01.12.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 27 Jan 2018 01:12:07 -0800 (PST) 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" To: 30265@debbugs.gnu.org Hi, I am using GuixSD 0.14. After upgrading fish shell to latest version(v2.7.1) and running `guix gc`, fish shell does not work well. #+BEGIN_EXAMPLE meiyo@guix ~$ fish fish: echo $_ " "; __fish_pwd ^ in command substitution called on standard input fish: __fish_pwd ^ in command substitution called on standard input in command substitution called on standard input fish: echo $_ " "; __fish_pwd ^ in command substitution called on standard input #+END_EXAMPLE __fish_pwd is a fish function. It's defined in `share/fish/functions/__fish_pwd.fish`. The error message shows that fish cannot load __fish_pwd's function definition from disk. After doing some research, I found out that the error was caused by wrong environment variables. Fish shell is installed in: #+BEGIN_EXAMPLE /gnu/store/ajbbi9cgj9j0my7v5habp0lcysaf2a51-fish-2.7.1/ #+END_EXAMPLE But the environment variable $fish_function_path does not exist. And these environment variables point to non-existent paths: #+BEGIN_EXAMPLE __fish_bin_dir /gnu/store/4jkxcz8kpy621ycmqn3rvs0fv6c98h6p-fish-2.7.1/bin __fish_datadir /gnu/store/4jkxcz8kpy621ycmqn3rvs0fv6c98h6p-fish-2.7.1/share/fish #+END_EXAMPLE Setting $fish_function_path to the correct path reduces the error message. #+BEGIN_EXAMPLE set fish_function_path /gnu/store/ajbbi9cgj9j0my7v5habp0lcysaf2a51-fish-2.7.1/share/fish/functions #+END_EXAMPLE `share/fish/config.fish` states $__fish_datadir is set by fish.cpp, and $fish_function_path is derived from $__fish_datadir. #+BEGIN_SRC fish # __fish_datadir, __fish_sysconfdir, __fish_help_dir, __fish_bin_dir # are expected to have been set up by read_init from fish.cpp # Set up function and completion paths. Make sure that the fish # default functions/completions are included in the respective path. if not set -q fish_function_path set fish_function_path $configdir/fish/functions $__fish_sysconfdir/functions $__extra_functionsdir $__fish_datadir/functions end if not contains -- $__fish_datadir/functions $fish_function_path set fish_function_path $fish_function_path $__fish_datadir/functions end #+END_SRC In conclusion, I think some path related variables are not set correctly when fish is compiled from source code and that caused the bug I met. But since I'm not good at C++ programming, I will not dive deeper. I hope that the information provided above is helpful. Meiyo Peng