InsightSoftwareConsortium / InsightSoftwareConsortium/ITK
Remote modules fail to checkout git tag but succeed with commit hash
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 748
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 64
Description
### Description
An issue was recently uncovered where ITK fails to checkout updated remote modules when a named git tag is used. Checkout succeeds when the equivalent commit hash is provided instead.
https://github.com/InsightSoftwareConsortium/ITK/commit/065c5d853987d399887eee13b2dc92e56813088d attempted to use tags for ITKMinimalPathExtraction and ITKTubeTK modules, which resulted in CMake configuration failures: https://open.cdash.org/build/8323654
```
-- Performing Test CXX_HAS_DISABLE_OPTIMIZATION_FLAG - Failed
ATTENTION: You have enabled the use of FFTW. This library is distributed under a GPL license. By enabling this option, the ITK libraries binary that is built will be covered by a GPL license and so will any executable that is linked against these libraries.
-- Found Python3: /usr/bin/python3.8 (found suitable version "3.8.10", minimum required is "3.7") found components: Interpreter
-- AnalyzeObjectMap has been renamed to AnalyzeObjectLabelMap
fatal: Needed a single revision
CMake Error at CMake/ITKModuleRemote.cmake:81 (message):
Failed to get the hash for tag
'/home/kitware/Dashboards/Tests/ITK/Modules/Remote/MinimalPathExtraction'
Call Stack (most recent call first):
CMake/ITKModuleRemote.cmake:137 (_git_update)
CMake/ITKModuleRemote.cmake:236 (_fetch_with_git)
Modules/Remote/MinimalPathExtraction.remote.cmake:45 (itk_fetch_module)
Modules/Remote/CMakeLists.txt:10 (include)
-- Configuring incomplete, errors occurred!
```
Updating to use hashes in https://github.com/InsightSoftwareConsortium/ITK/commit/fd386e4c2911a18561bdce9151f8a719bfcc6883 succeeded.
### Steps to Reproduce
1. Tag an ITK remote module in that module's git history, i.e. `[ITKMinimalPathExtraction@v1.2.4](https://github.com/InsightSoftwareConsortium/ITKMinimalPathExtraction/releases/tag/v1.2.4)`
2. Update the remote module's `.remote.cmake` file with the given tag string, such as at https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Remote/MinimalPathExtraction.remote.cmake#L50
3. Configure ITK:
```
> cd path/to/ITK-build
> cmake -DModule_MinimalPathExtraction:BOOL=ON path/to/ITK-src
```
### Expected behavior
Configuration succeeds. The remote module repo is made available at `ITK-src/Modules/Remote/ITKMinimalPathExtraction` and is checked out at the given tag, i.e. `v1.2.4`.
### Actual behavior
Module fails to checkout the given tag and CMake config fails. See description.
### Reproducibility
100%
### Versions
ITK v5.3.0
ITKMinimalPathExtraction v1.2.4
### Environment
Ubuntu 20.04
CMake 3.22
### Additional Information
It is possible that this issue is limited to existing ITK source trees where the remote module was already cloned in the past.
Contributor guide
Assessment
This issue has not been assessed yet.