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

cross-compiling python 3.13 readline error - unable to find ncurses.pc while ncursesw.pc is available #125452

Closed
th0ma7 opened this issue Oct 14, 2024 · 6 comments
Labels
3.13 bugs and security fixes build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@th0ma7
Copy link

th0ma7 commented Oct 14, 2024

Bug report

Bug description:

python package maintainer for the SynoCommunity. Preparing the migration path from our python 3.11 to 3.13 but the installer changed since previous version, no longer using setup.py.

Long-story short, the configure script finds ncursesw properly, altough testing for readline later on fails as only assuming ncurses.pc (vs the w variant).

error from our logs:

The necessary bits to build these optional modules were not found:
_tkinter                  readline                                         
To find the necessary bits, look in configure.ac and config.log.

Checked 112 modules (33 built-in, 61 shared, 1 n/a on linux-x86_64, 15 disabled, 2 missing, 0 failed on import)
make[4]: Leaving directory '/home/spksrc/python-wheels/spksrc/spk/python313/work-x64-7.1/Python-3.13.0'
===>  Installing for python313
find /home/spksrc/python-wheels/spksrc/spk/python313/work-x64-7.1/install//var/packages/python313/target/../ \! -type d -printf '%P\n' | sed 's?^target/??g' | sort > /home/spksrc/python-wheels/spksrc/spk/python313/work-x64-7.1/python313.plist.tmp

I've been digging into the configure.ac in hope to find why but no luck just yet... configure detection of ncursesw:

checking for ncursesw... yes
checking for ncursesw/curses.h... no
checking for ncursesw/ncurses.h... no
checking for ncursesw/panel.h... no
checking for ncurses/curses.h... no
checking for ncurses/ncurses.h... no
checking for ncurses/panel.h... no
checking for curses.h... yes
checking for ncurses.h... yes
checking for curses function is_pad... yes
checking for curses function is_term_resized... yes
checking for curses function resize_term... yes
checking for curses function resizeterm... yes
checking for curses function immedok... yes
checking for curses function syncok... yes
checking for curses function wchgat... yes
checking for curses function filter... yes
checking for curses function has_key... yes
checking for curses function typeahead... yes
checking for curses function use_env... yes
checking for stdlib extension module _curses... yes
checking for stdlib extension module _curses_panel... yes

I presume relatively simple to fix, but haven't found how just yet.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

And sections from the config.log

configure:24789: checking for readline
configure:24796: $PKG_CONFIG --exists --print-errors "readline"
Package ncurses was not found in the pkg-config search path.
Perhaps you should add the directory containing `ncurses.pc' 
to the PKG_CONFIG_PATH environment variable
Package 'ncurses', required by 'readline', not found
configure:24799: $? = 1
configure:24813: $PKG_CONFIG --exists --print-errors "readline"
Package ncurses was not found in the pkg-config search path.
Perhaps you should add the directory containing `ncurses.pc'
to the PKG_CONFIG_PATH environment variable
Package 'ncurses', required by 'readline', not found
configure:24816: $? = 1
configure:24830: result: no
Package 'ncurses', required by 'readline', not found
@th0ma7 th0ma7 added the type-bug An unexpected behavior, bug, or error label Oct 14, 2024
@hacscred

This comment was marked as off-topic.

@th0ma7
Copy link
Author

th0ma7 commented Oct 14, 2024

Hey, nice to meet you too @hacscred!
My latest PR relatively to python packaging is SynoCommunity/spksrc#6200
Our python packages are available here: https://synocommunity.com/package/python311
(3.10+3.11 package builds undergoing+publishing)

Now, Synology is a linux distribution called DSM. Their toolchain are made available on which since years we've develop a framework to build from source and make available open sources packages through our repository that you can then install on your Synology NAS. We support cross-compiling from multiple archs, armv5-7-8, ppc, i686 and x86_64.

In hope to remediate at this, here's an early draft of my next PR SynoCommunity/spksrc#6282. I had not yet intented to push that online, but in hope this helps subsequent discussions.

@th0ma7
Copy link
Author

th0ma7 commented Oct 14, 2024

Adding, here the build log output (kept the python part only): build-x64-7.1.log
And here is the config.log

Just le me know if you need anything else.

@hacscred

This comment was marked as off-topic.

@picnixz picnixz added build The build process and cross-build 3.13 bugs and security fixes labels Oct 14, 2024
@ZeroIntensity
Copy link
Member

Apologies @th0ma7 for the nuisance, typically people are nicer on here

@th0ma7
Copy link
Author

th0ma7 commented Oct 14, 2024

I can confirm that the bug isn't with python but rather with readline. As readline is compiled against ncursesw only, there is an issue in its resulting readline.pc pkg-config file whereas it depends to ncurses instead of ncursesw.

Now fixed with a local build patch: SynoCommunity/spksrc@9c764a7

Note that this patch will probably be moved to its own PR due to numerous dependencies, thus history may get broken for future reference.

And thnx @ZeroIntensity for intervening, civility being much appreciated.

@th0ma7 th0ma7 closed this as completed Oct 14, 2024
@erlend-aasland erlend-aasland closed this as not planned Won't fix, can't repro, duplicate, stale Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes build The build process and cross-build type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

5 participants