From 993f4b5a06b5984d3d81e5910403cf15293f25b1 Mon Sep 17 00:00:00 2001 From: Jay Petacat Date: Fri, 1 Jan 2021 18:40:46 -0500 Subject: [PATCH] ci: fix `git describe` git describe is used for version string creation, but it had to be reverted in commit 69da6ba because it was broken in CI builds. Azure Pipelines and Drone perform shallow clones by default. This change reconfigures them to fetch history and tags. It adds tens of seconds, which is negligible compared to overall build and test time. Related: #6466, #6509, #7601 --- ci/azure/linux_script | 2 ++ ci/azure/macos_script | 2 ++ ci/azure/windows_msvc_script.bat | 2 ++ ci/drone/linux_script | 2 ++ ci/srht/freebsd_script | 2 ++ 5 files changed, 10 insertions(+) diff --git a/ci/azure/linux_script b/ci/azure/linux_script index bf338ce22f7129f17c7df45c52194fff617e8c70..251c3bfaf1542c7744d6b4aabeb4e34317989973 100755 --- a/ci/azure/linux_script +++ b/ci/azure/linux_script @@ -49,6 +49,8 @@ PATH=$PWD/$WASMTIME:$PATH # Make the `zig version` number consistent. # This will affect the cmake command below. git config core.abbrev 9 +git fetch --unshallow || true +git fetch --tags export CC=gcc-7 export CXX=g++-7 diff --git a/ci/azure/macos_script b/ci/azure/macos_script index cb14b7f1196fb96c511f9a407fe8ff3604d77a63..b83f9c940b71689a42318cb8bcb4883aa2d81689 100755 --- a/ci/azure/macos_script +++ b/ci/azure/macos_script @@ -28,6 +28,8 @@ cd $ZIGDIR # Make the `zig version` number consistent. # This will affect the cmake command below. git config core.abbrev 9 +git fetch --unshallow || true +git fetch --tags mkdir build cd build diff --git a/ci/azure/windows_msvc_script.bat b/ci/azure/windows_msvc_script.bat index efc68e5d2d8210bc8a4793ba6098701b4057d1b9..cd5e3d5bca39150da6724c1be8850628e723f2eb 100644 --- a/ci/azure/windows_msvc_script.bat +++ b/ci/azure/windows_msvc_script.bat @@ -18,6 +18,8 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliar REM Make the `zig version` number consistent. REM This will affect the cmake command below. git.exe config core.abbrev 9 +git.exe fetch --unshallow +git.exe fetch --tags mkdir %ZIGBUILDDIR% cd %ZIGBUILDDIR% diff --git a/ci/drone/linux_script b/ci/drone/linux_script index fdc1704fb7e38a328796499603f3bb248d1f3738..422949e607528ebccb29e7b69be9449b1d82a9cb 100755 --- a/ci/drone/linux_script +++ b/ci/drone/linux_script @@ -14,6 +14,8 @@ pip3 install s3cmd # Make the `zig version` number consistent. # This will affect the cmake command below. git config core.abbrev 9 +git fetch --unshallow || true +git fetch --tags mkdir build cd build diff --git a/ci/srht/freebsd_script b/ci/srht/freebsd_script index 02849da8de63fc4ab678f2e2ed6da7ac73b54d7b..337d715b7c3828b2f90ba196dbb4ce21a9fa0d0e 100755 --- a/ci/srht/freebsd_script +++ b/ci/srht/freebsd_script @@ -20,6 +20,8 @@ cd $ZIGDIR # Make the `zig version` number consistent. # This will affect the cmake command below. git config core.abbrev 9 +git fetch --unshallow || true +git fetch --tags # SourceHut reports that it is a terminal that supports escape codes, but it # is a filthy liar. Here we tell Zig to not try to send any terminal escape -- 2.54.0