Skip to content

Issues building Python main on Solaris #91962

Closed

Description

@kulikjak

As previously mentioned here #89886 (comment), Python main branch currently doesn't build on Solaris due to a problem with hstrerror detection and libncurses library.

hstrerror not found issue

hstrerror detection changed in #89886 (changing from AC_LINK_IFELSE to AC_COMPILE_IFELSE) and because on Oracle Solaris you can compile a program with hstrerror but need -lresolv for linking, it's now detected as available. Later, this results in hstrerror compilation failing at the end with relocation error "symbol hstrerror: referenced symbol not found".

I think that the real issue is in the "needs -lresolv" detection few lines above:

dnl On some systems (e.g. Solaris 9), hstrerror and inet_aton are in -lresolv
dnl On others, they are in the C library, so we to take no action
AC_CHECK_LIB(c, inet_aton, [$ac_cv_prog_TRUE],
  AC_CHECK_LIB(resolv, inet_aton)
)

The problem here is that while hstrerror still needs -lresolv, inet_aton does not, and since only the latter is checked here, the system incorrectly determines that it's not necessary. When this detection gets updated to check both, -lresolv is correctly appended to PATH and this issue is gone.

curses build issue

The curses build issue is related to several missing defines and include path. With those added for Solaris, the build of _curses module succeeds.

Linked PRs

Activity

  1. encukou commented on Jan 31, 2024

    @encukou
    Member

    Just got to this issue. Could you update the linked PRs, and check that they still help Solaris? I have no problem merging them for 3.13 -- they're small, clearly platform-specific, and shouldn't break other builds. Making sure that they continue working is of course up to you.

  2. encukou commented on Jan 31, 2024

    @encukou
    Member

    Jakub, would you like to help me figure out what “community support” for a platform should look like, with Solaris as guinea pig № 2?
    If so, please check out https://discuss.python.org/t/community-support-for-a-platform/44621, and python/devguide#1267

  3. kulikjak commented on Feb 1, 2024

    @kulikjak
    ContributorAuthor

    Hi Petr, thank you! I will rebase/update linked PRs onto the current main as soon as possible.

    As for the "community support", I am all for it. Solaris (both Oracle and OpenSolaris forks) depend on Python a lot, and while it is not officially supported here, we support it internally. Being informed about issues reported here makes sense, as we would most likely hit those soon anyway.

    Also, once this gets merged, we should hopefully have a working (green) Solaris buildbot worker (https://buildbot.python.org/all/#/workers/47 - currently offline due to maintenance, but should be up again soon); that should also help us with the support.

  4. added a commit that references this issue on Feb 1, 2024
  5. kulikjak commented on Feb 13, 2024

    @kulikjak
    ContributorAuthor

    The hsterror detection PR is rebased and seems to work as expected.

    The ncurses related PR was just closed because setup.py is no longer used (it's in Python 3.11, but I don't think you will backport such a change all the way there).

    I wanted to create a similar patch for main and found that it works much better now and that while I need to pass some additional env variables to the build (specifically CFLAGS=-I/usr/include/ncurses and LIBREADLINE_LIBS=-lncursesw -lreadline), touching _XOPEN_SOURCE_EXTENDED or HAVE_NCURSESW is no longer required.

  6. kulikjak commented on Feb 13, 2024

    @kulikjak
    ContributorAuthor

    Oh, and I need to correct the info about Solaris buildbot worker a little. This won't make the test suite green, but it should make it successfully build all extensions (configure and compile steps).

    We have it green internally, but several more PRs will have to be merged to make the tests green here.

  7. added a commit that references this issue on Oct 30, 2024
  8. kulikjak commented on Oct 30, 2024

    @kulikjak
    ContributorAuthor

    After the recent merge, the Solaris SPARC buildbot successfully builds all the modules. Thank you!

    https://buildbot.python.org/#/builders/742

  9. added a commit that references this issue on Dec 8, 2024
  10. added a commit that references this issue on Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions