Broken cmake caching
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 10.6k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read src/libgit2/CMakeLists.txt around lines 135-138 and compare the source and generated experimental.h install entries. Reproduce the repeated Installing output from the issue, then verify installation no longer reports duplicate work and dependent projects are not forced to rebuild; PR 7109 is cited as the fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100