Skip to content
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

make regen-all doesn't pass -f to argument clinic #126206

Closed
nineteendo opened this issue Oct 30, 2024 · 5 comments · Fixed by #126244
Closed

make regen-all doesn't pass -f to argument clinic #126206

nineteendo opened this issue Oct 30, 2024 · 5 comments · Fixed by #126244
Labels
build The build process and cross-build topic-argument-clinic type-feature A feature request or enhancement

Comments

@nineteendo
Copy link
Contributor

nineteendo commented Oct 30, 2024

Bug report

Bug description:

Output:

python3.13 ./Tools/clinic/clinic.py --make --exclude Lib/test/clinic.test.c --srcdir .
Error in file 'Modules/posixmodule.c' on line 13087:
Checksum mismatch! Expected '9756767bdbdabe94', computed '1da32369b7d9fd4b'. Suggested fix: remove all generated code including the end marker, or use the '-f' option.
make: *** [clinic] Error 1

This makes it harder to fix merge conflicts, see: https://discuss.python.org/t/reducing-merge-conflicts-in-generated-code/68537/8

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

@nineteendo nineteendo added the type-bug An unexpected behavior, bug, or error label Oct 30, 2024
@ZeroIntensity ZeroIntensity added build The build process and cross-build topic-argument-clinic labels Oct 30, 2024
@erlend-aasland
Copy link
Contributor

If you get conflicts in generated code you should examine the conflict. If there are real issues, fix them; if not, regenerate clinic code using -f, as suggested by the error message. See also the devguide and the Argument Clinic HOWTO.

@nineteendo
Copy link
Contributor Author

Sure, if the generated code is in .c files should probably be examined as it might contain incompatible changes. But why can't it overwrite .c.h files automatically? That code is fully generated (at least for Modules/posixmodule.c).

I know that I can run Tools/clinic/clinic.py -f Modules/posixmodule.c, but this just a waste of time.

@erlend-aasland
Copy link
Contributor

There is no discussion of using -f in the original issue nor in the commit message that added the clinic target. I'm not sure why we don't forcefully recreate generated code, but I would be fine with such a change. The clinic-tests target, for example, uses the -f option when running clinic.py.

@erlend-aasland erlend-aasland added type-feature A feature request or enhancement and removed type-bug An unexpected behavior, bug, or error labels Oct 31, 2024
erlend-aasland added a commit to erlend-aasland/cpython that referenced this issue Oct 31, 2024
@erlend-aasland
Copy link
Contributor

Adding -f would not conflict with the check-generated-files CI check, so we should be fine CI wise.

@erlend-aasland
Copy link
Contributor

Thanks for the suggestion; make clinic (and any other target that implicitly depends on clinic) now forcefully regenerates clinic code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build topic-argument-clinic type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants