Skip to content

Update compiler.rst for more precision about new opcode #416

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 17, 2018
Merged

Update compiler.rst for more precision about new opcode #416

merged 2 commits into from
Sep 17, 2018

Conversation

psyker156
Copy link
Contributor

When adding a new opcode, if the guide is followed as is, the following error will be emitted as regen-importlib expects the new opcode target to be present in ceval.c before the command is added. I simply added a quick precision in the guide. Will create an issue with this in a few seconds.

gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I. -I./Include -DPy_BUILD_CORE -o Python/ceval.o Python/ceval.c In file included from Python/ceval.c:629:0: Python/ceval.c: In function ‘_PyEval_EvalFrameDefault’: Python/opcode_targets.h:119:5: error: label ‘TARGET_LOAD_BUILTIN’ used but not defined &&TARGET_LOAD_BUILTIN, ^ Makefile:1613: recipe for target 'Python/ceval.o' failed make: *** [Python/ceval.o] Error 1

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your 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 your contribution, we look forward to reviewing it!

@psyker156
Copy link
Contributor Author

I have just signed the CLA.

Copy link
Collaborator

@willingc willingc left a comment

Choose a reason for hiding this comment

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

Thanks @psyker156 for the PR. A small wording suggestion for clarity.

compiler.rst Outdated
will take effect only after running ``make regen-importlib``.
will take effect only after running ``make regen-importlib``. Running this
command before adding the new bytecode to :file:`Python/ceval.c` will result
in an error. You should proceed to the next step before importlib is
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should ... regenerated

Instead, you should add the new bytecode and then run make regen-importlib.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point. What would you think of:
"Running this command before adding the new bytecode target to :file:Python/ceval.c will result in an error. You should only run make regen-importlib after the new bytecode target has been added."

Or maybe we can remove the second sentence. I was referring to the next step as that one is the one explaining how to deal with the ceval.c file. Thanks for your input!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Your suggested wording works for me @psyker156 Thanks 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright! I will patch it up! Thanks a lot!

@willingc willingc merged commit d55145f into python:master Sep 17, 2018
@willingc
Copy link
Collaborator

Thanks @psyker156 for the contribution.

@psyker156
Copy link
Contributor Author

@willingc My pleasure! Nice community. I look forward to a more active contribution pattern!

will take effect only after running ``make regen-importlib``.
will take effect only after running ``make regen-importlib``. Running this
command before adding the new bytecode target to :file:`Python/ceval.c` will
result in an error. You should only run ``make regen-importlib`` after the new
Copy link
Member

Choose a reason for hiding this comment

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

Aren't the last two sentences just repeat the same?

AA-Turner pushed a commit to AA-Turner/devguide that referenced this pull request Jun 17, 2022
Closes python#417.

* Update compiler.rst for more precision about new opcode

* Update compiler.rst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants