Skip to content

Skip fetch only works when CPM_SOURCE_CACHE is defined #577

Open
@ScottBailey

Description

@ScottBailey

When the environment variable CPM_SOURCE_CACHE is set, re-running cmake does not cause a fetch and patch.

When unset, fetch and patch both occur.

The problem observed (see #572 for more discussion) is that the unset path fetch does not overwrite the source and so the patch command fails.

#572 suggests a fix that could ignore errors during patching. I think this could be an issue when a user is testing version updates; it would be nice if we just, say, updated package A to latest version and running CMake told us the patches were incompatible/not applied. I don't think -t reports that?

In my testing, I see that when the environment variable is set, we skip the fetch and patch steps. Maybe we can add a cache variable to indicate the initial fetch and patch skips were successful?

Recreation of this is relatively simple, see https://github.com/ScottBailey/cpm-cmake-test-577 for an automated working example.

@lemire

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions