Skip to content

Caching config.cache in GitHub Actions is unsafe #139596

@mhsmith

Description

@mhsmith

Bug report

Bug description:

This was discovered in #131882 (comment), which involved a configure check that used a header file. The PR changed the header file, but not the configure script. So the build reused a config.cache file from a different branch (probably main), the check wasn't rerun, and the fact that the change broke the build wasn't discovered until much later.

Because the configure script could depend on anything in the repository, I don't think there's any way to make this safe, not even within the scope of a single PR. So I suggest removing the cache action from the workflow.

This is a separate thing from ccache, which is still safe as far as I know.

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildinfraCI, GitHub Actions, buildbots, Dependabot, etc.type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions