Skip to content

Ignore parent repositories for CMake version detection#1861

Open
puneetdixit200 wants to merge 1 commit into
libevent:masterfrom
puneetdixit200:fix-version-git-worktree-check
Open

Ignore parent repositories for CMake version detection#1861
puneetdixit200 wants to merge 1 commit into
libevent:masterfrom
puneetdixit200:fix-version-git-worktree-check

Conversation

@puneetdixit200
Copy link
Copy Markdown

Summary:

  • verify PROJECT_SOURCE_DIR is the Git worktree root before using git describe for CMake version detection
  • keep extracted libevent source trees from adopting tags from a parent repository
  • add a CTest regression that configures a fake extracted libevent tree inside a tagged parent Git repo

Tests:

  • cmake -D SOURCE_DIR=$PWD -D TEST_ROOT=/tmp/libevent-version-via-git-test -P test/version-via-git-parent-repository.cmake
  • cmake -S . -B /tmp/libevent-build -DCMAKE_BUILD_TYPE=Debug
  • ctest --test-dir /tmp/libevent-build -R version-via-git-parent-repository --output-on-failure
  • cmake --build /tmp/libevent-build -j 4
  • cmake --build /tmp/libevent-build --target verify -j 4
  • git diff --cached --check
  • git diff --cached | /opt/homebrew/bin/bash ./checkpatch.sh -p

Fixes #1837

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

cmake/VersionViaGit assumes any git repository is libevent's

2 participants