Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
iritkatriel merged 19 commits intopython:mainfromiritkatriel:expose_codegen
Nov 14, 2022

Conversation

iritkatriel
Copy link
Member

@iritkatrieliritkatriel commentedNov 4, 2022
edited by bedevere-bot
Loading

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

@iritkatrieliritkatriel self-assigned thisNov 4, 2022
@iritkatrieliritkatriel added testsTests in the Lib/test dir skip news interpreter-core(Objects, Python, Grammar, and Parser dirs) labelsNov 5, 2022
@iritkatrieliritkatriel added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 5, 2022
@bedevere-bot
Copy link

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

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

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 5, 2022
@iritkatrieliritkatriel added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 8, 2022
@bedevere-bot
Copy link

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

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

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 8, 2022
@iritkatrieliritkatriel added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 8, 2022
@bedevere-bot
Copy link

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

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

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 8, 2022
@iritkatrieliritkatriel added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 9, 2022
@bedevere-bot
Copy link

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

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

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 9, 2022
@iritkatrieliritkatriel added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 10, 2022
@bedevere-bot
Copy link

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

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

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelNov 10, 2022
Copy link
Member

@markshannonmarkshannon left a comment

Choose a reason for hiding this comment

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

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

@@ -40,6 +40,13 @@ extern int _PyAST_Optimize(
_PyASTOptimizeState *state);

/* Access compiler internals for unit testing */

PyAPI_FUNC(PyObject*) _PyCompile_CodeGen(
Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Can _testinternalcapi import them otherwise?

Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

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
MemberAuthor

Choose a reason for hiding this comment

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

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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@markshannonmarkshannonmarkshannon left review comments

@brandtbucherbrandtbucherAwaiting requested review from brandtbucher

Assignees

@iritkatrieliritkatriel

Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)skip newstestsTests in the Lib/test dir
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@iritkatriel@bedevere-bot@markshannon

[8]ページ先頭

©2009-2025 Movatter.jp