Skip to content

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

Closed

Description

@nineteendo

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

Activity

  1. erlend-aasland commented on Oct 31, 2024

    @erlend-aasland
    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.

  2. nineteendo commented on Oct 31, 2024

    @nineteendo
    ContributorAuthor

    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.

  3. erlend-aasland commented on Oct 31, 2024

    @erlend-aasland
    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.

  4. added
    type-featureA feature request or enhancement
    and removed
    type-bugAn unexpected behavior, bug, or error
    on Oct 31, 2024
  5. added a commit that references this issue on Oct 31, 2024
  6. erlend-aasland commented on Oct 31, 2024

    @erlend-aasland
    Contributor

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

  7. added 3 commits that reference this issue on Oct 31, 2024
  8. erlend-aasland commented on Nov 1, 2024

    @erlend-aasland
    Contributor

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

  9. added a commit that references this issue on Dec 8, 2024
  10. added a commit that references this issue on Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions