pkgxdev / pantry

pkg manifests
https://pkgx.dev/pkgs/
162 stars 114 forks source link

Error logged "no version information available" #6510

Open mbbyn opened 1 week ago

mbbyn commented 1 week ago

Hello,

I see an error whenever I open a new shell, either bash or zsh, with the following output:

/usr/bin/zsh: [$HOME]/.pkgx/invisible-island.net/ncurses/v6.4.0/lib/libtinfo.so.6: no version information available (required by /usr/bin/zsh)

From what I understand, the LD_LIBRARY_PATH is being modified to include installed packages, and somehow this is conflicting with the system libraries for system applications.

What I don't understand is, ZSH should already be running by the time pkgx starts modifying PATH and LD_LIBRARY_PATH, so why would it complain about this? The other question is, why would this dependency be missing the version information or is incompatible with the system? (Ubuntu 20.04, WSL 2)

Appreciate the help, and thanks for this amazing project.

dosubot[bot] commented 1 week ago

Hello, @mbbyn! I'm here to help you with any issues or questions you may have. Let's figure out what's going on with your shell error together.

The error /usr/bin/zsh: [$HOME]/.pkgx/invisible-island.net/ncurses/v6.4.0/lib/libtinfo.so.6: no version information available (required by /usr/bin/zsh) indicates that the libtinfo.so.6 library being used by zsh does not have version information available, which is required by zsh.

To resolve this issue, you can try the following steps:

  1. Ensure Compatibility: Make sure that the version of ncurses installed is compatible with your version of zsh. You might need to install a different version of ncurses that includes the required version information.

  2. Reinstall ncurses: Reinstall ncurses using your system's package manager to ensure it includes the necessary version information.

  3. Update pkgx: Ensure that pkgx is up to date, as there might be updates that resolve this compatibility issue.

  4. Set Library Path: You can set the LD_LIBRARY_PATH to point to the correct version of libtinfo.so.6 that includes the version information.

Here is an example of how you can set the LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=/usr/lib:/lib:$LD_LIBRARY_PATH

This command adds the standard library paths to the LD_LIBRARY_PATH environment variable, which might help zsh find the correct version of libtinfo.so.6.

If the issue persists, you might need to manually specify the path to the correct libtinfo.so.6 in your .zshrc or .zprofile file:

export LD_LIBRARY_PATH=/path/to/correct/libtinfo.so.6:$LD_LIBRARY_PATH

Replace /path/to/correct/libtinfo.so.6 with the actual path to the correct library file [1].

To continue talking to Dosu, mention @dosu.

jhheider commented 1 week ago

Hi, @mbbyn, this is a non-harmful message due to https://github.com/pkgxdev/pantry/blob/d432ac7118e7251d66c3b3f6520f0e8ac7823a33/projects/invisible-island.net/ncurses/package.yml#L49-L63

ideally, we'd figure out some way to suppress this, or be selective about using the other curses library names, but nothing obvious has presented itself yet for linux. if you have ideas or want to look into it, by all means, go ahead. perhaps we should move them out to a shims package so we don't have to pollute everything.

jhheider commented 1 week ago

it's possible it might be as simple as --with-termlib generate separate terminfo library. i'll try it out.

jhheider commented 1 week ago

Once https://github.com/pkgxdev/pantry/actions/runs/9667518772 completes for your architecture, you should be able replace it with the rebuilt version via rm -rf ~/.pkgx/invisible-island.net/ncurses; pkgx +invisible-island.net/ncurses@latest.

mbbyn commented 1 week ago

Simply by running the mentioned command to replace ncurses, I get a segmentation fault when running nano for example:

image

jhheider commented 1 week ago

Interesting; it worked for me on a docker image for ubuntu:20.04:

$ docker run -it --rm --platform linux/amd64 ubuntu:20.04
Unable to find image 'ubuntu:20.04' locally
20.04: Pulling from library/ubuntu
9ea8908f4765: Download complete
Digest: sha256:0b897358ff6624825fb50d20ffb605ab0eaea77ced0adb8c6a4b756513dec6fc
Status: Downloaded newer image for ubuntu:20.04
root@ca433941f063:/# apt-get update
...
Reading package lists... Done
root@ca433941f063:/# apt-get install curl
...
done.
root@ca433941f063:/# curl -LS pkgx.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   167  100   167    0     0   2879      0 --:--:-- --:--:-- --:--:--  3150
100  4111  100  4111    0     0  13567      0 --:--:-- --:--:-- --:--:-- 13567
installing: /usr/local/bin/pkgx
######################################################################## 100.0%
pkgx 1.1.6
ensure you have the  pre-requisites installed:

now type: pkgx --help
root@ca433941f063:/# pkgx nano
 ✓  ~/.pkgx/zlib.net/v1.3.1
 ✓  ~/.pkgx/gnome.org/libxml2/v2.13.1
 ✓  ~/.pkgx/tukaani.org/xz/v5.6.2
 ✓  ~/.pkgx/nano-editor.org/v8.0.0
 ✓  ~/.pkgx/invisible-island.net/ncurses/v6.4.0
 ✓  ~/.pkgx/gnu.org/gettext/v0.22.5
root@ca433941f063:/#

so, something odd is up. it might be WSL2-related, of course. what does: ldd ~/.pkgx/nano-editor.org/v*/bin/nano show? you might try, of course, rm -rf ~/.pkgx/nano-editor.org and see if there's something amiss there. i suppose it could also be a TERM var or similar, but that'd be odd.

mbbyn commented 1 week ago

Sorry for not clarifying earlier, pkgx nano works just fine, but /usr/bin/nano was the one crashing.

jhheider commented 1 week ago

oh! hm. clearly linked against an incompatible version of ncurses. ncurses shouldn't be in your env unless you're in a dev environment. if you use nano a lot, then adding nano-editor.org to your dev pkgx.yaml should prevent getting the "wrong" one. conversely, pkgx install nano will install the shim to ~/.local/bin/nano, which should take precidence.

in general, though, unless you're in a pkgx environment, local nano shouldn't see pkgx ncurses. confirmable via echo $LD_LIBRARY_PATH.