sample_restraint CMake scripting breaks with current googletest source.
Summary
The -DDOWNLOAD_GOOGLETEST=ON
option for the sample project no longer works correctly due to upstream changes in googletest
distribution. This is expected to affect all releases (all repository branches).
Exact steps to reproduce
See, for example, https://gitlab.com/gromacs/gromacs/-/jobs/1785962077, and https://gitlab.com/gromacs/gromacs/-/blob/master/admin/ci-scripts/build-and-test-sample_restraint-2021.sh
For developers: Why is this important?
The most immediately observable affect is the failure of CI jobs, but it also indicates that the documentation for the sample code may need updates.
If this is a bug, (1) what happens, and (2) what did you expect to happen?
Note the error:
[ 22%] Performing download step (git clone) for 'googletest'
Cloning into 'googletest-src'...
fatal: invalid reference: master
CMake Error at googletest-download/googletest-prefix/tmp/googletest-gitclone.cmake:40 (message):
Failed to checkout tag: 'master'
Possible fixes
The two quick solutions:
-
reference the local copy of googletest sources available from the GROMACS repo, which should be available to the job in /builds/gromacs/gromacs
instead of using-DDOWNLOAD_GOOGLETEST=ON
in regular CI (!2211 (merged)) -
update the behavior of -DDOWNLOAD_GOOGLETEST=ON
to correctly use the googletest repository and/or pin to a specific googletest release (!2204 (merged))
For a long-term solution, we can review the googletest project docs for best practices on new projects so that we can appropriately suggest and test a primary use case that we can advocate for users.