libgit2 / libgit2/libgit2

Broken cmake caching

Open
#7,110 0 comments 0 reactions 0 assignees View on GitHub

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

The fix: https://github.com/libgit2/libgit2/pull/7109

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.