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-85283: Build termios extension with the limited C API by vstinner · Pull Request #116928 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Mar 17, 2024 •
edited by github-actions Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
  • Issue: [C API] Convert a few stdlib extensions to the limited C API (PEP 384) #85283

📚 Documentation preview 📚: https://cpython-previews--116928.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

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

All reactions
@vstinner
pythongh-85283: Build termios extension with the limited C API
db85353
@bedevere-app bedevere-app Bot added the awaiting core review label Mar 17, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Mar 17, 2024
[C API] Convert a few stdlib extensions to the limited C API (PEP 384) #85283
Closed
@vstinner
vstinner enabled auto-merge (squash) March 17, 2024 14:50
@vstinner
vstinner merged commit 1cf0301 into python:main Mar 17, 2024
@vstinner
vstinner deleted the limited_termios branch March 17, 2024 15:12
@bedevere-app bedevere-app Bot removed the awaiting core review label Mar 17, 2024
@kulikjak

kulikjak commented Mar 19, 2024

Copy link
Copy Markdown
Contributor

Hi! After this commit, I am seeing the following errors when building main on Solaris:

/..../cpython/Modules/termios.c:430:20: error: 'errno' undeclared (first use in this function)
  430 |     if (r == -1 && errno == EINVAL) {
      |                    ^~~~~
/..../cpython/Modules/termios.c:56:1: note: 'errno' is defined in header '<errno.h>'; did you forget to '#include <errno.h>'?
   55 | #include "clinic/termios.c.h"
  +++ |+#include <errno.h>

AFAICT, this is because of the newly added #define Py_LIMITED_API 0x030d0000, which "hides" the errno.h include in Python.h (same as the newly added string.h include). When I add the missing include, it compiles again.

Should I create a PR with a fix?

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented Mar 19, 2024

Copy link
Copy Markdown
Member Author
/..../cpython/Modules/termios.c:430:20: error: 'errno' undeclared (first use in this function)
  430 |     if (r == -1 && errno == EINVAL) {

That's strange. I cannot find this line in the main branch.

Do you have a patch on top of the main branch? If yes, you should consider to propose it upstream?

In main, I have:

    if (r == -1) {
        return PyErr_SetFromErrno(state->TermiosError);  // LINE 430
    }
All reactions

Sorry, something went wrong.

Uh oh!

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

@kulikjak

kulikjak commented Mar 19, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Oh, I am very sorry. This is indeed from an internal patch and not in the termios.c sources...

It's a patch that workarounded an issue with the TIOCGWINSZ ioctl on Solaris, which is already fixed, and which I forgot to remove it (and since it was just a temporary workaround, I didn't upstream it).

vstinner 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.

@vstinner

vstinner commented Mar 19, 2024

Copy link
Copy Markdown
Member Author

It's a patch that workarounded an issue with the TIOCGWINSZ ioctl on Solaris, which I forgot to remove before (and since it was just a temporary workaround, I didn't upstream it).

Well, either remove it, or propose it upstream. If you keep it, just add <errno.h> include ;-)

kulikjak 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.

vstinner added a commit to vstinner/cpython that referenced this pull request Mar 20, 2024
@vstinner
pythongh-85283: Build termios extension with the limited C API (pytho…
80ef6c2
…n#116928)
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
@vstinner @adorilson
pythongh-85283: Build termios extension with the limited C API (pytho…
87dbfab
…n#116928)
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
@vstinner @diegorusso
pythongh-85283: Build termios extension with the limited C API (pytho…
73c9faa
…n#116928)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

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.

2 participants

@vstinner @kulikjak
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.