FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Allow compilation on python 3.10.0a6 by Theelx · Pull Request #155 · python/typed_ast · GitHub

This repository was archived by the owner on Jul 5, 2023. It is now read-only.

Repository navigation

Allow compilation on python 3.10.0a6 - #155

Merged
gvanrossum merged 2 commits into
python:masterfrom
Theelx:master
Mar 7, 2021
Merged

gvanrossum merged 2 commits into
python:masterfrom
Theelx:master

Conversation

Theelx commented Mar 3, 2021

Copy link
Copy Markdown
Contributor

It seems that pydebug.h and pyarena.h were moved from /Include/ to /Include/cpython/ in the latest 3.10 alpha (a6).

Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@Theelgirl

This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

Theelx commented Mar 3, 2021

Copy link
Copy Markdown
Contributor Author

Just signed the CLA, waiting the "one business day" now for it to be processed.

hauntsaninja left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thank you for this!

Comment thread ast27/Parser/tokenizer.c Outdated
#include "pydebug.h"
#endif /* PGEN */

#if PY_MINOR_VERSION >= 10

hauntsaninja Mar 3, 2021 •
edited
Loading

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

https://docs.python.org/dev/whatsnew/3.10.html#id2 says we can just include Python.h instead, which we already do. So let's only include pydebug.h if PY_MINOR_VERSION < 10...
Actually, I just checked Python 3.5's Python.h (the oldest Python typed_ast supports) and it includes both pydebug and pyarena. So I think we can just remove the troublesome includes entirely?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

That's possible, I didn't think of that because I don't know C. I'll test that out.

Copy link
Copy Markdown
Member

I've tested this with Python 3.10a6 in a few places, and it's not quite 100% successful.

  1. On Windows 10 it works.
  2. On macOS 11.2.2 it does not work. I get many errors during compilation including #error architecture not supported. Note that my Mac is an Intel Mac, but the compiler apparently tries to compile for the new Apple CPU as well, and fails. Now I realize I have an old version of Xcode installed, so I'll try to refresh that and see how it goes. (If anyone remembers how to install the latest command line compilers without first installing Xcode let me know -- it's an uncomfortably large download and I never use the UI.)

I'll get back here if I get it compiling on macOS.

Copy link
Copy Markdown
Member

Well, according to https://devguide.python.org/setup/#macos-and-os-x I should just run xcode-select --install, which tells me to go use "Software Update" instead, which tells me I'm up to date. Still waiting for Xcode download to finish...

Theelx commented Mar 7, 2021 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

Have you tried the previous version of my PR, where I encased the problematic includes in an if check for python 3.10? I don't know any C or anything in depth about compilers, so that might not work, but the way I see it, its worth a shot.

Edit: Could it be an incompatibility introduced by supporting the M1 chip? Have you tried this on other python versions that support M1?

Copy link
Copy Markdown
Collaborator

This works fine for me on macOS 10.15.7, so I propose merging and figuring out support for Apple Silicon in another place.
I don't know much about Apple Silicon, but might be worth looking at what cibuildwheel does, e.g. does this get things compiling for you? https://github.com/joerick/cibuildwheel/blob/c9451facbd7a4bb54d580a093c9e381d524c6170/cibuildwheel/macos.py#L248

Copy link
Copy Markdown
Member

Okay, will merge, and mark as closing #156. And I'll open a separate ticket for Apple Silicon.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL