Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[package] ncurses/6.2: TERMINFO compiled into library not valid path #25266

Open
darakelian opened this issue Sep 14, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@darakelian
Copy link
Contributor

Description

After upgrading to conan2, our binaries that link against ncurses are no longer able to properly use the library at runtime. With the old recipe of this package, ncurses was looking for the terminfo at /usr/bin/share/terminfo which has the correct info at least for our hosts. Now, it appears that it tries loading the data from //res/terminfo which is a non-existing path. The code compiles and links properly, this appears to be a runtime configuration issue entirely.

Package and Environment Details

  • Package Name/Version: ncurses/6.2
  • Operating System+version: Linux SLES12SP5
  • Compiler+version: GCC 8
  • Conan version: conan 2.7.0
  • Python version: Python 3.11.3

Conan profile

[settings]
os=Linux
arch=x86_64
compiler=gcc
compiler.version=8
compiler.libcxx=libc++
build_type=Release
[options]
[conf]
[build_requires]
ncurses/6.2
[env]

Steps to reproduce

conan install . -pr:a= -sbuild_type=Release
cmake --preset
cmake --build --preset --target install
./install/bin/

Logs

Click to expand log Logs are on a company box that I can't copy from but this is the error our application prints when trying to init the terminal. ``` Error opening terminal: xterm-256color ```

strace was ran on the binary and I can confirm that it tries to check ~/.terminfo (which on my machine does not exist) then //res/terminfo (which also doesnt exist)

@darakelian darakelian added the bug Something isn't working label Sep 14, 2024
@Steampunkery
Copy link

It appears that this happens because the option --prefix=/ is the default with the AutotoolsToolchain recipe helper. This is then used to expand --datarootdir=${prefix}/res, which results in //res.

It appears that the way this conan package wants to be used is through the conanbuild.env and conanrun.env scripts to set the TERMINFO variable. I think that having to source an environment script before running or building is a fairly brittle solution.

ncurses has an option --with-default-terminfo-dir=DIR which could be used along with a recipe option to optionally enable forcing the standard system path (/usr/share/terminfo) into the list of paths to check.

@darakelian
Copy link
Contributor Author

I incorrectly stated that the old package was looking for the terminfo at /usr/share/terminfo it appears that we were actually improperly pulling the system wide ncurses that was properly configured so this issue would impact both old Conan1 and new Conan 1/Conan 2 recipes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants