2.54.3+18.04.2ubuntu0.1 update on bionic breaks fish shell

Bug #1961365 reported by Xavier Delaruelle
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
snapd (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

The recent 2.54.3+18.04 update made for ubuntu bionic provides a `/usr/share/fish/vendor_conf.d/snapd.fish` file which does not seem compatible with the version of the fish shell shipped on this distribution release (2.7.1).

Here are the error message obtained when starting the fish shell with the new snapd package:

```
fish: Unknown command 'fish_add_path -aP /snap/bin'
/usr/share/fish/vendor_conf.d/snapd.fish (line 3):
fish_add_path -aP $snap_bin_path
^
from sourcing file /usr/share/fish/vendor_conf.d/snapd.fish
      called on line 250 of file /usr/share/fish/config.fish

from sourcing file /usr/share/fish/config.fish
      called during startup

fish: Unknown command '! contains /var/lib/snapd/desktop'
/usr/share/fish/vendor_conf.d/snapd.fish (line 9):
if ! contains $snap_xdg_path $XDG_DATA_DIRS
   ^
from sourcing file /usr/share/fish/vendor_conf.d/snapd.fish
      called on line 250 of file /usr/share/fish/config.fish

from sourcing file /usr/share/fish/config.fish
      called during startup
```

I use the bionic container on Github Action to check the behavior of my project (https://github.com/cea-hpc/modules) against fish shell. Somehow, snapd is included on this container. Things were fine until yesterday morning. Unfortunately I cannot identify the previous version of snapd used, as it seems to be installed prior any specific installation made for my test in the CI environment.

Commit https://github.com/snapcore/snapd/commit/2a94f057cfe52f004ba6dd60cd9d8646080118fe may help to fix this issue. Package on bionic should be updated to include this fix. Strange things is that the fixed file is said to be part of 2.54, but the 2.54.3+18.04 package on bionic still contain the previous code.

Revision history for this message
Alberto Mardegan (mardy) wrote :

Hi Xavier, thanks for reporting this issue, and sorry for the regression!

Do you think that this is the same bug as https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1960972? Comment #2 in that bug has a workaround; can you please try and see if that helps you too?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package snapd - 2.54.3+21.10.1ubuntu0.1

---------------
snapd (2.54.3+21.10.1ubuntu0.1) impish-security; urgency=medium

  * SECURITY REGRESSION: Fix fish shell compatibility
    - data/env/snapd.fish.in: fix fish env for all versions of fish, unexport
      local vars, export XDG_DATA_DIRS.
    - LP: #1961365

 -- Paulo Flabiano Smorigo <email address hidden> Fri, 18 Feb 2022 21:21:29 +0000

Changed in snapd (Ubuntu):
status: New → Fix Released
Revision history for this message
Xavier Delaruelle (xdelaruelle) wrote :

Hi Alberto & all,

I have just tested snapd 2.54.3+18.04.2ubuntu0.1 on ubuntu 18.04 and the data/env/snapd.fish.in fix does not totally correct the issue. Here is the new error message obtain:

```
set: Unknown option '--path'
/usr/share/fish/vendor_conf.d/snapd.fish (line 11):
set --path --export XDG_DATA_DIRS $XDG_DATA_DIRS
^
from sourcing file /usr/share/fish/vendor_conf.d/snapd.fish
   called on line 250 of file /usr/share/fish/config.fish
```

So the --path option is not supported by the version of fish shell available on ubuntu 18.04 (fish 2.7.1)

Changed in snapd (Ubuntu):
status: Fix Released → Incomplete
status: Incomplete → New
summary: - 2.54.3+18.04 update on bionic breaks fish shell
+ 2.54.3+18.04.2ubuntu0.1 update on bionic breaks fish shell
Revision history for this message
Xavier Delaruelle (xdelaruelle) wrote :

There was an attempt to mark this bug as duplicate of #1957948.

The fix provided in 2.54.3+18.04.2ubuntu0.1 should fix #1957948 but not this bug as the --path option of set command is not supported on fish 2.7 (version shipped in ubuntu 18.04).

Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

Yes, sorry my bad. Fish in bionic is even older, and thus requires more contrived workaround.

Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

This should work even for fish 2.7: https://github.com/snapcore/snapd/pull/11416 Anyone wants to give it a try?

Revision history for this message
Xavier Delaruelle (xdelaruelle) wrote :

I have just tested the /usr/share/fish/vendor_conf.d/snapd.fish file proposed in pull request 11416 on a ubuntu 18.04 environment. The new file works correctly. So the pull request should fix this issue.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in snapd (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.