mpv-player / mpv-build

🔨 Helper scripts to compile mpv on Linux
http://mpv.io
404 stars 104 forks source link

version `NCURSES6_TINFO_6.2.current' not found (required by /lib/x86_64-linux-gnu/libncursesw.so.6 #163

Closed Phxntxm closed 3 years ago

Phxntxm commented 3 years ago

I can't seem to figure this one out now, when trying to run mpv after building it I'm receiving the error in the title...

{path}/mpv: {path}/libtinfo.so.6: version 'NCURSES6_TINFO_6.2.current' not found (required by /lib/x86_64-linux-gnu/libncursesw.so.6)

Additional information: This is being bundled with a packaged python application, and only when running it in that packaged application does this appear. Trying to run the binary directly from command line works fine. I don't know why this would be causing an issue though.

I also feel like for this I maybe wanted the --enable-static-build flag? I'm not really sure, I tried but couldn't get that to build either:

/home/phantom/test/mpv-build/mpv/build/../player/scripting.c:305: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: cannot find -ldrm
/usr/bin/ld: cannot find -lEGL
/usr/bin/ld: cannot find -lva-drm
/usr/bin/ld: cannot find -lva
/usr/bin/ld: cannot find -lva-x11
/usr/bin/ld: cannot find -lva
/usr/bin/ld: cannot find -lvdpau

But they do exist:

sudo ldconfig -p | grep libdrm
...
    libdrm.so.2 (libc6,x86-64) => /usr/local/lib/libdrm.so.2
    libdrm.so.2 (libc6,x86-64) => /lib/x86_64-linux-gnu/libdrm.so.2
    libdrm.so.2 (libc6) => /lib/i386-linux-gnu/libdrm.so.2
    libdrm.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libdrm.so
sudo ldconfig -p | grep libEGL
    libEGL_nvidia.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
    libEGL_nvidia.so.0 (libc6) => /lib/i386-linux-gnu/libEGL_nvidia.so.0
    libEGL_mesa.so.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libEGL_mesa.so.0
    libEGL.so.1 (libc6,x86-64) => /usr/local/lib/libEGL.so.1
    libEGL.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libEGL.so.1
    libEGL.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libEGL.so
sudo ldconfig -p | grep libva-drm
    libva-drm.so.2 (libc6,x86-64) => /usr/local/lib/libva-drm.so.2
    libva-drm.so.2 (libc6,x86-64) => /lib/x86_64-linux-gnu/libva-drm.so.2
    libva-drm.so (libc6,x86-64) => /lib/x86_64-linux-gnu/libva-drm.so

etc.

avih commented 3 years ago

Additional information: This is being bundled with a packaged python application, and only when running it in that packaged application does this appear. Trying to run the binary directly from command line works fine.

I completely don't understand what you mean here. What is bundled with python? how does it get bundled with python? what's that "packaged application" and who created it? what's the binary which is not part of this "packaged application"?

Clearly, according to you, it's not an issue of mpv itself but rather something related to this "bundle".

mpv doesn't have anything to do with this bundle and we don't know what/why does this bundle exist, therefore we can't help you with that.

(mpv doesn't use ncurses and doesn't require it. Similarly, mpv is not bundled with python).

Phxntxm commented 3 years ago

"This" as in MPV, it's getting bundled by me with pyinstaller. That's what I'm talking about in that sentence and why I posted it here, the mpv binary is the one that fails... and is the only binary packaged with the installer that fails (that's why I posted it here). I'm aware of the possibility that the first half of the issue is probably related to pyinstaller.... but the second half is obviously only MPV related.

Please read the entire issue, you only focused on the first half which was more of the "background" to explain why I think the second half was needed.

avih commented 3 years ago

I did read all of it, and didn't understand parts of it.

I did fully understand this: "Trying to run the binary directly from command line works fine."

mpv-build is only concerned with creating this binary. If this binary works for you then your resulting mpv is fine, and it's not an issue of mpv itself.

Now, as far as I understand your issue start when you bundle mpv and then try to run this bundle. Unless you explain better why you think this could be an mpv issue despite the fact that the mpv binary didn't have any issue, then we can't help you further.

Phxntxm commented 3 years ago

Okay let's just ignore everything until after the "additional information" part, I'm talking about trying to use --enable-static-build

And the error received when trying to do that, maybe providing the background info for why I was trying that just confused things, sorry. I'm receiving those errors /usr/bin/ld: cannot find * after doing ./scripts/mpv-build with only that option in mpv_options

avih commented 3 years ago

So, if I understand correctly, if you do:

echo --enable-static-build > ./mpv_options
./rebuild

then you get errors similar to /usr/bin/ld: cannot find -ldrm at the end of the build, correct? i.e. before trying to run mpv - the build just didn't succeed?

However, if you do:

rm ./mpv_options
./rebuild

Then the builds succeeds, and the resulting binary works fine?

In that case, you most likely don't have static libs available on your system, but do have the dynamic libs. You should consult your package manager, and installing the static libs is really out of scope for mpv-build.

If the scenarios above do not describe exactly what you tried and what the result was, then please follow my example and make me understand exactly:

Phxntxm commented 3 years ago

What you explained is precisely it, I will look into the "static libs" for those packages. I installed all I could find, but maybe there's something specifically "static" related that'll be the key to finding it

Phxntxm commented 3 years ago

Actually before we get to that, your first response regarding MPV not using ncurses (from as far as I understand it, I could be wrong) seems wrong:

phantom@phantom-desktop:~/test/mpv-build$ ldd mpv/build/mpv | grep ncurses
    libncursesw.so.6 => /lib/x86_64-linux-gnu/libncursesw.so.6 (0x00007f669cdfa000)
avih commented 3 years ago

I will look into the "static libs" for those packages

It might or might not be available for your system and/or using the package manager.

If it's not available and you insist on a static build, then your only choice is to build all the missing libs for static linking on your own.

Hint, you most probably don't want to get into building all the libs for static linking. That's likely to be too painful and take way too much of your time.

regarding MPV not using ncurses

mpv does not use it (you can search the mpv source code). However, it's possible that some of libs which mpv uses does, for instance, if you enabled caca then it could be it. Or maybe some other lib.

Phxntxm commented 3 years ago

I did enable caca... disabling that made it all work, thanks!

avih commented 3 years ago

Nice :)