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

gh-87092: expose the compiler's codegen to python for unit tests by iritkatriel · Pull Request #99111 · python/cpython · GitHub

/ cpython Public

gh-87092: expose the compiler's codegen to python for unit tests - #99111

Merged
iritkatriel merged 19 commits into
python:mainfrom
iritkatriel:expose_codegen
Nov 14, 2022
Merged

gh-87092: expose the compiler's codegen to python for unit tests#99111
iritkatriel merged 19 commits into
python:mainfrom
iritkatriel:expose_codegen

Conversation

iritkatriel commented Nov 4, 2022
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

With this we can run just codegen from python, and get the un-optimized instruction sequence for an AST.

iritkatriel self-assigned this Nov 4, 2022
iritkatriel added tests Tests in the Lib/test dir skip news interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Nov 5, 2022
iritkatriel added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 5, 2022

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit a2a1c17 🤖

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

bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 5, 2022
iritkatriel added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 8, 2022

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit 3c1c647 🤖

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

bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 8, 2022
iritkatriel added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 8, 2022

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit d98f150 🤖

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

bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 8, 2022
iritkatriel added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 9, 2022

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit 00aea64 🤖

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

bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 9, 2022
iritkatriel added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 10, 2022

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit ab3f67c 🤖

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

bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 10, 2022

markshannon left a comment

Copy link
Copy Markdown
Member

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

This is a nice improvement.
I have a few questions and comments.


/* Access compiler internals for unit testing */

PyAPI_FUNC(PyObject*) _PyCompile_CodeGen(

Copy link
Copy Markdown
Member

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

Does this (or the other functions) need to be an API function?

Copy link
Copy Markdown
Member 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

Can _testinternalcapi import them otherwise?

Copy link
Copy Markdown
Member

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

I think so, that why it has "internal" in the name.
It defines Py_BUILD_CORE_BUILTIN

Copy link
Copy Markdown
Member 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

It doesn't seem to work:

[ERROR] _testinternalcapi failed to import: dlopen(/Users/iritkatriel/src/cpython-654/build/lib.macosx-13.0-x86_64-3.12-pydebug/_testinternalcapi.cpython-312d-darwin.so, 0x0002): symbol not found in flat namespace '__PyCompile_CodeGen'

Copy link
Copy Markdown
Member 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

I'll merge this PR now, it's getting into merge conflicts all the time. We can remove these from the API later if it's possible.

Comment thread Lib/test/support/bytecode_helper.py Outdated
Comment thread Python/compile.c Outdated
Comment thread Python/compile.c Outdated
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 join this conversation on GitHub. Already have an account? Sign in to comment

Labels

interpreter-core (Objects, Python, Grammar, and Parser dirs) skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL