Commit Graph

18 Commits

Author SHA1 Message Date
Brad King
cde63efaea Tests/ExternalProject: Update sample projects to require CMake 3.31 2024-11-20 10:54:01 -05:00
Craig Scott
1512dc43cb ExternalProject: Avoid reconfigure when updates are disconnected
When UPDATE_DISCONNECTED is true, create separate update_disconnected
and patch_disconnected targets which have ALWAYS set to false.
Make the configure step depend on patch_disconnected in this case too.
This ensures the configure, build, install and test steps are not
executed unnecessarily when updates are disconnected.

Make the update and patch commands depend on the details of those
steps. This ensures they are re-executed when any of those details
change, even if updates are disconnected.

Allow updates to occur even if UPDATE_DISCONNECTED is true, but don't
contact the remote in that case. If asked to update to a ref that isn't known
locally, that is now detected and causes a fatal error when updates are
disconnected. Previously, the build would have silently and erroneously
continued to use the old ref.

Fixes: #16419, #19703, #21146
2023-05-23 22:39:44 +10:00
Craig Scott
ac6a4d4884 ExternalProject: Improve robustness of update step
Refactor the update logic to make it easier to follow. The following
fixes/improvements are some consequences of this change:

* Absorb a confusing git checkout failure message when the failure
  is allowed and we act on that failure appropriately.
* Fix an unnecessary fetch in some scenarios when checking out a
  git hash we already have locally.
* Stash and restore any local changes even when not rebasing.
* Avoid unsafe rebasing where we are not on a branch that is
  already tracking the requested branch.
* When fetching, use --tags --force to ensure we get all the tags
  and commits leading up to them regardless of whether the tags
  are on branches or not. Also update our local tags if they move
  on the remote.

Fixes: #20677
2021-01-28 09:32:35 -05:00
Brad King
c69567e56a Merge topic 'FindGit-cache-version'
76fdeb6d13 Tests: FindGit already provides the git version, re-use it
315a200f0c FindGit: Cache the GIT_EXECUTABLE version for the current run

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5712
2021-01-21 09:27:04 -05:00
Craig Scott
76fdeb6d13 Tests: FindGit already provides the git version, re-use it 2021-01-20 10:16:21 +11:00
Craig Scott
ac4a8002a5 ExternalProject: Don't git stash ignored files
The change to the binary gitrepo.tgz file adds a commit which
adds a .gitignore file.

Fixes: #21278
2021-01-16 18:12:00 +11:00
Craig Scott
e71c2807ba ExternalProject: Remote checkout needs to include the remote name
Commit 0aea435aa1 (ExternalProject: Provide choice of
git update strategies, 2020-02-12) added the git update
strategies, but the CHECKOUT strategy was not handling
remote refs correctly. The local ref would be checked out
instead and no warning or error would have been emitted.
The test that should have caught this was also malformed
and did not actually move the local master branch as intended.
2020-05-29 12:10:32 -04:00
Craig Scott
0aea435aa1 ExternalProject: Provide choice of git update strategies
Fixes: #16528

Co-Authored-By: Michael Wake <macwake@gmail.com>
2020-05-23 22:27:38 +10:00
Felix Geyer
49e82c15d5 Fix spelling typos in comments and documentation (#16037)
The Debian package checker tool (lintian) detected several typos in
CMake.
2016-03-29 14:31:02 -04:00
Daniele E. Domenichelli
aba5cec6b2 ExternalProject: Add unit tests for UPDATE_DISCONNECTED 2014-11-06 15:09:44 +01:00
Brad King
d506fee81c Tests: Use -A option to pass generator platform selection
This is less verbose than defining CMAKE_GENERATOR_PLATFORM.
2014-09-15 10:26:59 -04:00
Brad King
09ab207c66 Tests: Add generator platform support
Propagate CMAKE_GENERATOR_PLATFORM through the test hierarchy so that all
tests can build with the selected generator platform, if any.
2014-09-10 11:21:50 -04:00
Brad King
9f5bd180c8 Tests: Drop CMAKE_TEST_GENERATOR(|_TOOLSET) variables
s/CMAKE_TEST_GENERATOR/CMAKE_GENERATOR/g
2014-03-03 15:26:49 -05:00
Brad King
56ca8d4e63 Tests: Add generator toolset support
Propagate CMAKE_GENERATOR_TOOLSET through the test hierarchy so that all
tests can build with the selected generator toolset, if any.
2013-02-07 11:09:56 -05:00
Matt McCormick
a41d3a40be ExternalProjectUpdateTest: Only support Git 1.6.5 and greater. 2012-11-13 13:35:09 -05:00
Matt McCormick
de760c1fa3 ExternalProject: Verify when a fetch occurs during update test.
The performance feature of only performing a git fetch when needed
during the ExternalProject update step is verified during the test.
A fetch is identified by removing the FETCH_HEAD file and checking for
its reincarnation.
2012-11-13 13:35:07 -05:00
Matt McCormick
9b66c8faf5 ExternalProject: Always do a git fetch for a remote ref.
Remote git refs always require a git fetch, because the remote may move around
where the ref points.
2012-11-13 13:34:43 -05:00
Matt McCormick
2619f4d87a ExternalProject: Add tests for UPDATE_COMMAND.
Tests are added for UPDATE_COMMAND to ensure it is working properly.  Testing
infrastructure is added along with tests for Git, but tests for other version
control systems could easily be added in the future.
2012-11-13 13:34:22 -05:00