DescentDevelopers / Descent3

Descent 3 by Outrage Entertainment
GNU General Public License v3.0
2.74k stars 231 forks source link

[Runtime Issue]: ./Descent3: /lib64/libncurses.so.6: version `NCURSES6_5.0.19991023' not found (required by ./Descent3) #404

Closed DAK404 closed 1 month ago

DAK404 commented 1 month ago

Build Version

v1.5 <0ff98a7> and below

Operating System Environment

CPU Environment

Game Modes Affected

Game Environment

No response

Description

OS: Linux Distribution: OpenSUSE Tumbleweed

Seems like if i try to run Descent3 the game does not start. Therefore, starting the game in terminal, the following output is seen:

./Descent3: /lib64/libncurses.so.6: versionNCURSES6_5.0.19991023' not found (required by ./Descent3)`

I did try to grab ncurses-devel but it did not help.

I am unsure if it is a game issue or if it is something on my end.

Regression Status

No response

Steps to Reproduce

No response

winterheart commented 1 month ago

I guess you've downloaded Descent 3 binary from artifacts page on Github Actions? If so, executable was linked with Ubuntu's ncurses library which may be incompatible with yours.

You may compile Descent 3 by self using building instructions and try it on your Linux environment.

DAK404 commented 1 month ago

I'll give it a try soon, will update once i do so!

Lgt2x commented 1 month ago

The dynamic loading of the library in dyna_curses.h is a problem in itself and should be removed

GravisZro commented 1 month ago

The dynamic loading of the library in dyna_curses.h is a problem in itself and should be removed

I disagree completely because ncurses shouldn't be a requirement unless you are running dedicated server mode because it's the ONLY place it's used.

Lgt2x commented 1 month ago

The dynamic loading of the library in dyna_curses.h is a problem in itself and should be removed

I disagree completely because ncurses shouldn't be a requirement unless you are running dedicated server mode because it's the ONLY place it's used.

Opening the library via dl_open when you need it is not the way you setup an optional library dependency, see how that breaks the game in this situation. Dedicated server mode should be hidden behind a compilation option that requires ncurses.

winterheart commented 1 month ago

As far I can tell, there only one symbol from ncurses is used and I don't see what is so important, that require whole external dependency. Better to rid of it completely.

GravisZro commented 1 month ago

Dedicated server mode should be hidden behind a compilation option that requires ncurses.

If you do that then you end up with linking errors due to various version of the library and which distribution you use. That is exactly what happened to the person who opened the ticket.

GravisZro commented 1 month ago

As far I can tell, there only one symbol from ncurses is used

That is incorrect. See also: https://github.com/DescentDevelopers/Descent3/blob/main/linux/lnxcon.cpp There are nine imported symbols in con_Update alone.

Lgt2x commented 1 month ago

What do you suggest to fix the problem then?

GravisZro commented 1 month ago

What do you suggest to fix the problem then?

The obvious solution is to utilize dynamic loading. There aren't any drawbacks to using dynamic loading which is why your opposition to it has taken me by surprise.

We should be dynamically loading everything except for libc, just like the original D3 did. The choice to use dynamic loading wasn't a fluke, it was a wise decision. It's the reason that D3 would work with any Linux distro using a compatible glibc (which they also distributed) while the dependencies were able to be dealt with in a way that didn't require package versioning. However, we have the advantage of being able to statically link libc on Linux which would make D3 exceptionally portable. The way we're going now, any installation package made will need to be updated every few months for every distro not because changes need to be made to the code but to keep the library versions used by D3 in sync with each distro, something not needed with dynamic loading.

I don't know who decided that dynamic loading should be discarded but they should seriously reconsider.

JeodC commented 1 month ago

IIRC nobody decided it--it was never a policy, just an approach. The last time I recall any discussion of it happening was when I brought up a general philosophy of having as few third party dependencies as possible. Some of the decision to make libraries static may have been born from that.

But, unlike windows, the mac and linux steam releases statically link a chunk of their libraries; I know dmfc is static there.

GravisZro commented 1 month ago

But, unlike windows, the mac and linux steam releases statically link a chunk of their libraries; I know dmfc is static there.

Statically linking everything is an option... but load-time shared link libraries are the worst of all options.

JeodC commented 1 month ago

Right I'm only saying that there was no executive decision on any policy for this sort of thing.

GravisZro commented 1 month ago

There definitely should be because as of this ticket, it's an issue.

winterheart commented 1 month ago

Ncurses gets loaded only when -svgalib and -dedicated options is called. Without -svgalib game uses Console_raw mode. Assuming that svgalib is pretty ancient technology on Linux and in-game support somehow already broken on arrival (I cannot properly use it in modern Linux system), I suggest just strip Console_normal mode which also removes ncurses dependency requirement.

GravisZro commented 1 month ago

@winterheart is correct that curses is only loaded in combination with -svgalib. I used the flag and the actual dlopen function failed which seems to be a result of linker options. I'm investigating further to see if it's worth saving or if we should exclude curses entirely. One thing is certain, it should not be an execution requirement.

Lgt2x commented 1 month ago

See #407 removing ncurses entirely

DAK404 commented 1 month ago

I just tested the #407 binaries created by GitHub actions.

I can now confirm that the game launches successfully. I did however find that when pressing "New Game" it asked me to insert Descent 3 CD 1. After pressing Ok, it launched the training mission successfully. Additionally, the aspect ratio of the main menu is extremely stretched.

winterheart commented 1 month ago

Yes, these issues are expected on current stage of project development (except message about inserting CD. I thought we removed this part of code). Aspect ratio is stretched because game menu internally runs on 640x480 and on widescreen monitors it stretched to fit to new resolution.

JeodC commented 1 month ago

Linux has different init in lnxmain, only init.cpp got cd calls and messages removed.

JeodC commented 1 month ago

Linux has different init in lnxmain, only init.cpp got cd calls and messages removed.

Actually, spotted cd refs in lnxcdrom.cpp and gamesequence.cpp, and this particular instance might be handled in descent.cpp