When building with cmake, the build will fail if you are inside a git repo but have not fetched tags.
Sometimes cloning a 'large' repo results in TLS errors, probably due to firewall/man-in-the-middle certs (like zscaler), etc... An easy workaround is to do a shallow clone with --depth 1 followed by a fetch with --unshallow. Doing this can result in no git tags being fetched, even after 'unshallowing'. This causes the cmake build to report a failure.
jared@ubuntu:~/gravity/build$ cat /home/jared/gravity/build/gravity_external-prefix/src/gravity_external-stamp/gravity_external-build-err.log
fatal: No names found, cannot describe anything. <----- highlighted for emphasis by the author
make[5]: *** [api/cpp/libgravity.so] Error 128
make[5]: *** Deleting file 'api/cpp/libgravity.so'
make[4]: *** [api/cpp/CMakeFiles/gravity.dir/all] Error 2
make[3]: *** [all] Error 2
The error message is actually the output of running git describe --tags when none are present, which I imagine the build does at some point to populate version.txt
Steps to reproduce:
git clone git@github.com:aphysci/gravity.git --depth 1
cd gravity
git fetch --unshallow
- ... build with cmake ...
The build will fail at the end.
You can easily fix this by fetching tags, or perhaps a fetch --all.
Mostly leaving this here as documentation. Pretty obscure case but the shallow clone to bypass tls errors comes up relatively often.
When building with cmake, the build will fail if you are inside a git repo but have not fetched tags.
Sometimes cloning a 'large' repo results in TLS errors, probably due to firewall/man-in-the-middle certs (like zscaler), etc... An easy workaround is to do a shallow clone with --depth 1 followed by a fetch with --unshallow. Doing this can result in no git tags being fetched, even after 'unshallowing'. This causes the cmake build to report a failure.
The error message is actually the output of running
git describe --tagswhen none are present, which I imagine the build does at some point to populate version.txtSteps to reproduce:
git clone git@github.com:aphysci/gravity.git --depth 1cd gravitygit fetch --unshallowThe build will fail at the end.
You can easily fix this by fetching tags, or perhaps a fetch --all.
Mostly leaving this here as documentation. Pretty obscure case but the shallow clone to bypass tls errors comes up relatively often.