Skip to content

Broken cmake caching #7110

@dimatcimbal

Description

@dimatcimbal

Apparently libgit2 repo contains conflicting installs in src/libgit2/CMakeLists.txt.

The first line https://github.com/libgit2/libgit2/blob/main/src/libgit2/CMakeLists.txt#L135 installs a placeholder file ${PROJECT_SOURCE_DIR}/include/git2/experimental.h and then second https://github.com/libgit2/libgit2/blob/main/src/libgit2/CMakeLists.txt#L137 overrides it with the generated version ${PROJECT_BINARY_DIR}/include/git2/experimental.h.

# src/libgit2/CMakeLists.txt
L135: install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/git2/
L136:        DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${LIBGIT2_FILENAME}")
L137: install(FILES ${PROJECT_BINARY_DIR}/include/git2/experimental.h
L138:        DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${LIBGIT2_FILENAME}")

This nullifies cmake cache (please find repeated Installing lines below) and forces a rebuild of dependent projects.

-- Up-to-date: /Users/dimatcimbal/code/libgit2/installdir/include/git2/refs.h
-- Up-to-date: /Users/dimatcimbal/code/libgit2/installdir/include/git2/reset.h
-- Up-to-date: /Users/dimatcimbal/code/libgit2/installdir/include/git2/filter.h
-- Up-to-date: /Users/dimatcimbal/code/libgit2/installdir/include/git2/transaction.h
-- Installing: /Users/dimatcimbal/code/libgit2/installdir/include/git2/experimental.h
-- Up-to-date: /Users/dimatcimbal/code/libgit2/installdir/include/git2/stdint.h
-- Up-to-date: /Users/dimatcimbal/code/libgit2/installdir/include/git2/commit.h
-- Up-to-date: /Users/dimatcimbal/code/libgit2/installdir/include/git2/refdb.h
-- Installing: /Users/dimatcimbal/code/libgit2/installdir/include/git2/experimental.h
-- Up-to-date: /Users/dimatcimbal/code/libgit2/installdir/include/git2.h
-- Up-to-date: /Users/dimatcimbal/code/libgit2/installdir/bin/git2

The fix: #7109

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