GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-90005: Port readline and curses to PY_STDLIB_MOD (GH-94452) by tiran · Pull Request #94452 · python/cpython

Conversation

@tiran

@tiran tiran commented Jun 30, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: Port module setup to PY_STDLIB_MOD() macro and addext() #90005

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added the awaiting core review label Jun 30, 2022
@tiran tiran added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jun 30, 2022
@bedevere-bot

bedevere-bot commented Jun 30, 2022

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @tiran for commit 33d9e296124d7daeef89fca957bdab51e1e1d11b 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jun 30, 2022
@tiran
tiran requested a review from erlend-aasland June 30, 2022 19:30
@tiran
tiran force-pushed the gh-90005-readline-curses branch from 8a61447 to dd59373 Compare June 30, 2022 19:40
@tiran tiran added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jun 30, 2022
@bedevere-bot

bedevere-bot commented Jun 30, 2022

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @tiran for commit dd5937322e181781c03213621eddb0fb88527c48 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jun 30, 2022
@tiran
tiran marked this pull request as ready for review June 30, 2022 21:23
@tiran tiran mentioned this pull request Jul 1, 2022
gh-93939: Build C extensions without setup.py #94474
Merged
erlend-aasland
erlend-aasland reviewed Jul 1, 2022
View reviewed changes

@erlend-aasland erlend-aasland left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! I left some comments.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread configure.ac Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread configure.ac Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread configure.ac Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread configure.ac Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread configure.ac Outdated
Comment on lines 5848 to 5850

@erlend-aasland erlend-aasland Jul 1, 2022

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this will create havoc for WASM/Emscripten static builds; multiple -l switches are passed to the compiler:

config.log:

29899 configure:21034: checking for rl_pre_input_hook in -lreadline
29900 configure:21059: gcc -o conftest     conftest.c -lreadline  -lreadline -lintl -ldl  >&5
29901 configure:21059: $? = 0
29902 configure:21069: result: yes
29903 configure:21080: checking for rl_completion_display_matches_hook in -lreadline
29904 configure:21105: gcc -o conftest     conftest.c -lreadline  -lreadline -lintl -ldl  >&5
29905 configure:21105: $? = 0
29906 configure:21115: result: yes
29907 configure:21126: checking for rl_resize_terminal in -lreadline
29908 configure:21151: gcc -o conftest     conftest.c -lreadline  -lreadline -lintl -ldl  >&5

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tiran tiran Jul 1, 2022

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, should I place a WITH_SAVE_ENV around each check? By the way, readline is not yet supported on Emscripten.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@erlend-aasland erlend-aasland Jul 1, 2022

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WITH_SAVE_ENV can't be nested :( But your LIBS_SAVE workaround should work well.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@erlend-aasland erlend-aasland Jul 1, 2022

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, it does not work. They're still there.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@erlend-aasland erlend-aasland Jul 1, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AC_CHECK_LIB might be adding the library before running the check.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@tiran tiran Jul 1, 2022

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we need a different approach here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@erlend-aasland erlend-aasland Jul 1, 2022

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. This reminds me I've got an open PR for the exact same issue for sqlite3 dependency detection :) I've tried various approaches, but I haven't found a neat way to solve it yet. (I haven't looked at it for a week either, though.)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
tiran added 4 commits July 1, 2022 21:50
@tiran
pythongh-90005: Port readline and curses to PY_STDLIB_MOD
4c97453
@tiran
_XOPEN_SOURCE handling
bd467ae
@tiran
Refactor readline block
a0caa1f
@tiran
Address review comments
a72b632
@tiran
tiran force-pushed the gh-90005-readline-curses branch from dd59373 to a72b632 Compare July 1, 2022 20:08
erlend-aasland
erlend-aasland reviewed Jul 1, 2022
View reviewed changes

@erlend-aasland erlend-aasland left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These suggestions should work. You should be able to apply them as a batch.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread configure.ac Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread configure.ac Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread configure.ac Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread configure.ac Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread configure.ac Resolved

Uh oh!

There was an error while loading. Please reload this page.

tiran and others added 3 commits July 1, 2022 22:21
@tiran @erlend-aasland
Consolidate readline_includes
550d323
Co-authored-by: Erlend Egeberg Aasland <[email protected]>
@tiran
Regenerate configure, add missing )
64bba74
@tiran
Use AC_LINK_IFELSE instead of AC_CHECK_LIB
96d60d9
@tiran

tiran commented Jul 5, 2022

Copy link
Copy Markdown
Member Author

@erlend-aasland I have refactored the code. There is a bit of repetition but IMHO it's ok for a few lookups. We could add our own variant of AC_CHECK_LIB at a later point in time.

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tiran
tiran requested a review from erlend-aasland July 5, 2022 08:17
@tiran tiran changed the title gh-90005: Port readline and curses to PY_STDLIB_MOD gh-90005: Port readline and curses to PY_STDLIB_MOD (GH-94452) Jul 6, 2022
@tiran
tiran merged commit e925241 into python:main Jul 6, 2022
@tiran
tiran deleted the gh-90005-readline-curses branch July 6, 2022 09:56
@bedevere-bot bedevere-bot removed the awaiting core review label Jul 6, 2022
@tiran

tiran commented Jul 6, 2022

Copy link
Copy Markdown
Member Author

I have merged the PR. It works on all tested platforms. We can review and address the general issue with AC_CHECK_LIB in a future PR.

erlend-aasland reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Jul 7, 2022

Copy link
Copy Markdown
Member

The change triggered a reference leak on Fedora: #94644

erlend-aasland reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit that referenced this pull request Jul 14, 2022
@tiran
gh-93939: Build C extensions without setup.py (GH-94474)
81dca70
Combines GH-93940, GH-94452, and GH-94433
@kulikjak

kulikjak commented Jul 18, 2022

Copy link
Copy Markdown
Contributor

Hi, I think I found an issue.

On Solaris, even a simple code like:

char readline ();
int main (void) {
  return readline ();
}

needs to be linked with both -lreadline and -lncurses; that means that checking for readline in -lreadline fails. I thought that passing LIBREADLINE_LIBS would fix that, but the content of that variable is not used until the test passes, and LIBS="-lreadline $LIBS" is always used. (AFAICT, automatic pkg-config would also do nothing, although I didn't test that).

Is there something I am missing or something I can try?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tiran

tiran commented Jul 18, 2022

Copy link
Copy Markdown
Member Author

The problem should be fixed by GH-94802.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kulikjak

kulikjak commented Jul 18, 2022

Copy link
Copy Markdown
Contributor

Ah, it's indeed fixed. I am sorry, I thought I am looking into latest main but it was 12 days old (when this was pushed).

Thanks for help!

tiran reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@native-api native-api mentioned this pull request Jan 13, 2023
Readline issues on new install of FreeBSD 13.1 pyenv/pyenv#2585
Closed
11 tasks done
@erlend-aasland erlend-aasland mentioned this pull request Aug 21, 2023
curses "insstr" does not handle newline properly on Mac OS #107267
Closed
@sorcio sorcio mentioned this pull request Oct 29, 2023
Restore ncurses widechar support on macOS #111460
Closed
@sorcio sorcio mentioned this pull request Nov 9, 2023
gh-111460: restore ncurses widechar support on macOS #111878
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@erlend-aasland erlend-aasland Awaiting requested review from erlend-aasland erlend-aasland is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@tiran @bedevere-bot @vstinner @kulikjak @erlend-aasland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.