Skip to content

Commit

Permalink
ci: fix git describe
Browse files Browse the repository at this point in the history
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: ziglang#6466, ziglang#6509, ziglang#7601
  • Loading branch information
jayschwa authored and aarvay committed Jan 4, 2021
1 parent 9c56daf commit 6f0cc6a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ci/azure/linux_script
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions ci/azure/macos_script
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions ci/azure/windows_msvc_script.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand Down
2 changes: 2 additions & 0 deletions ci/drone/linux_script
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions ci/srht/freebsd_script
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f0cc6a

Please sign in to comment.