Git-ubuntu issue with core 2.35.2

The classic snap git-ubuntu is using the awk binary from the core snap. This used to work but with the most recent update of the core snap this no longer works.

The reason is the following:

  • The core used to ship the following symlinks: /usr/bin/awk -> /etc/alternatives/awk -> /usr/bin/gawk

  • The git-ubuntu snap is setting PATH=/snap/core/current/usr/bin:…

  • This means that /snap/core/current/usr/bin/awk pointed the host /etc/alternative/awk which in turn points (usually) to /usr/bin/gawk which is the awk on the host

  • With 2.35.2 the core snap no longer ships /etc/alternatives - instead /usr/bin/awk in the core snap is a symlink to “awk” (in the same dir)

  • This means that now /snap/core/current/usr/bin/awk is the gawk from the core snap (and not the host)

  • The gawk from core is from xenial and needs libreadline.so.6 but when this is run on a bionic system only libreadline.so.7 is available by default on the host. So running /snap/core/current/usr/bin/awk leads to an error that libreadline.so.6 cannot be found.

Note that classic snaps that use binaries from core all face this problem, e.g. gpg from core also needs libreadline. This happend to work for awk on ubuntu by chance because /etc/alternatives was shipped in the core.

We are currently exploring the best fix for this, one obvious way is to set LD_LIBRARY_PATH into core when using PATH on core.

3 Likes

Isn’t the basic message that classic snaps should not invoke binaries from the core snap? (e.g. anything that sets RPATH won’t work right either, although I guess only a couple of things in the core snap do this)

Enforcing this seems hopeless though, but maybe we can socialize it somehow?

Yes, I think this is a reasonable. When using binaries from the core snap on classic care must be taken so that the right libs are picked up. And of course in the rpath case things simply won’t work.

1 Like