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

[3.12] gh-113565: Improve and harden detection of curses dependencies (#119816) #121222

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Jul 1, 2024

(cherry picked from commit f80376b)

  1. Use pkg-config to check for ncursesw/panelw. If that fails, use
    pkg-config to check for ncurses/panel.
  2. Regardless of pkg-config output, search for curses/panel headers, so
    we're sure we have all defines in pyconfig.h.
  3. Regardless of pkg-config output, check if libncurses or libncursesw
    contains the 'initscr' symbol; if it does and pkg-config failed
    earlier, add the resulting -llib linker option to CURSES_LIBS.
    Ditto for 'update_panels' and PANEL_LIBS.
  4. Wrap the rest of the checks with WITH_SAVE_ENV and make sure we're
    using updated LIBS and CPPFLAGS for those.

Add the PY_CHECK_CURSES convenience macro.

…encies (python#119816)

(cherry picked from commit f80376b)

1. Use pkg-config to check for ncursesw/panelw. If that fails, use
   pkg-config to check for ncurses/panel.
2. Regardless of pkg-config output, search for curses/panel headers, so
   we're sure we have all defines in pyconfig.h.
3. Regardless of pkg-config output, check if libncurses or libncursesw
   contains the 'initscr' symbol; if it does _and_ pkg-config failed
   earlier, add the resulting -llib linker option to CURSES_LIBS.
   Ditto for 'update_panels' and PANEL_LIBS.
4. Wrap the rest of the checks with WITH_SAVE_ENV and make sure we're
   using updated LIBS and CPPFLAGS for those.

Add the PY_CHECK_CURSES convenience macro.
@erlend-aasland
Copy link
Contributor Author

Marked as DO-NOT-MERGE and left to @Yhg1s to decide. See #119816 (comment).

@erlend-aasland
Copy link
Contributor Author

@Yhg1s
Copy link
Member

Yhg1s commented Aug 2, 2024

It's difficult, but I think this is too invasive for 3.12. It's too easy for this to break other systems doing automated/scripted builds, both because of the autoconf changes and the differences in which defines are used. We don't want to play use-case-whackamole where we keep breaking one system in our attempts to fix another.

@erlend-aasland erlend-aasland deleted the backport-3.12-autoconf-curses branch August 3, 2024 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants