diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e9e20262e3805fe5143d12157a979ea960ecfd0..b5f9c023778e037e00615d53fff3c703c928c0b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,7 @@ if("${ZIG_VERSION}" STREQUAL "") find_program(GIT_EXE NAMES git NAMES_PER_DIR) if(GIT_EXE) execute_process( - COMMAND ${GIT_EXE} -C ${CMAKE_SOURCE_DIR} describe --match *.*.* --tags + COMMAND ${GIT_EXE} -C ${CMAKE_SOURCE_DIR} describe --match *.*.* --tags --abbrev=9 RESULT_VARIABLE EXIT_STATUS OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE diff --git a/build.zig b/build.zig index 19721764f3a8fa77ecd7840ad8d757451ce78a2f..11b3006039b748f3a304e3869bcc87abdfcecb89 100644 --- a/build.zig +++ b/build.zig @@ -263,7 +263,14 @@ pub fn build(b: *std.Build) !void { var code: u8 = undefined; const git_describe_untrimmed = b.runAllowFail(&[_][]const u8{ - "git", "-C", b.build_root.path orelse ".", "describe", "--match", "*.*.*", "--tags", + "git", + "-C", + b.build_root.path orelse ".", + "describe", + "--match", + "*.*.*", + "--tags", + "--abbrev=9", }, &code, .Ignore) catch { break :v version_string; }; diff --git a/ci/aarch64-linux-debug.sh b/ci/aarch64-linux-debug.sh index dd258e0881e3164748882710202dd6535bd545e3..3ffe2c11018f4cc1d5da4efd895364b0b1cfaefb 100644 --- a/ci/aarch64-linux-debug.sh +++ b/ci/aarch64-linux-debug.sh @@ -16,7 +16,6 @@ export PATH="$HOME/deps/wasmtime-v2.0.2-$ARCH-linux:$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 diff --git a/ci/aarch64-linux-release.sh b/ci/aarch64-linux-release.sh index 25118bce82b9f6b8ffd4687c95b357727b752c19..9b118b6ba915d7a79b2c72d7e86366bc03475c4b 100644 --- a/ci/aarch64-linux-release.sh +++ b/ci/aarch64-linux-release.sh @@ -16,7 +16,6 @@ export PATH="$HOME/deps/wasmtime-v2.0.2-$ARCH-linux:$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 diff --git a/ci/aarch64-macos-debug.sh b/ci/aarch64-macos-debug.sh index adf988edc4dbd583411777d9b5c8f455a3b390ca..33712cefdf273ddad9d7e6f4f445c5372b914c05 100755 --- a/ci/aarch64-macos-debug.sh +++ b/ci/aarch64-macos-debug.sh @@ -17,7 +17,6 @@ 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 diff --git a/ci/aarch64-macos-release.sh b/ci/aarch64-macos-release.sh index 22dae5b4a22f9fc102f6769781d9bfe3c8ef705d..b3b82180e53f9d1898b2bb66d6fcccf743903c93 100755 --- a/ci/aarch64-macos-release.sh +++ b/ci/aarch64-macos-release.sh @@ -17,7 +17,6 @@ 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 diff --git a/ci/aarch64-windows.ps1 b/ci/aarch64-windows.ps1 index 0a2164671390b4b0814a28ff80f071d0be00f8cc..c0d97c98f98d62e0d4f11d8bdb22fa569cd3dcc5 100644 --- a/ci/aarch64-windows.ps1 +++ b/ci/aarch64-windows.ps1 @@ -24,7 +24,6 @@ function CheckLastExitCode { # Make the `zig version` number consistent. # This will affect the `zig build` command below which uses `git describe`. -git config core.abbrev 9 git fetch --tags if ((git rev-parse --is-shallow-repository) -eq "true") { diff --git a/ci/x86_64-linux-debug.sh b/ci/x86_64-linux-debug.sh index 6f3ebf642d782d7fe4f0cbf72ae2b02d7a639527..da0b3f8b0640977eda71857ef0ef6dced96ed52c 100755 --- a/ci/x86_64-linux-debug.sh +++ b/ci/x86_64-linux-debug.sh @@ -16,7 +16,6 @@ export PATH="$HOME/deps/wasmtime-v2.0.2-$ARCH-linux:$HOME/deps/qemu-linux-x86_64 # 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 diff --git a/ci/x86_64-linux-release.sh b/ci/x86_64-linux-release.sh index 22222c774044de428c9d98bea084914d7dd191ff..7317026beadc4ec32bea40168e74da5888d9bd4a 100755 --- a/ci/x86_64-linux-release.sh +++ b/ci/x86_64-linux-release.sh @@ -16,7 +16,6 @@ export PATH="$HOME/deps/wasmtime-v2.0.2-$ARCH-linux:$HOME/deps/qemu-linux-x86_64 # 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 diff --git a/ci/x86_64-macos-release.sh b/ci/x86_64-macos-release.sh index c773cab34866a91ad479b8f06c5bd4f049a06a17..3db3f9677363481210d5ba56d3b8efb496c24ec1 100755 --- a/ci/x86_64-macos-release.sh +++ b/ci/x86_64-macos-release.sh @@ -22,7 +22,6 @@ 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 diff --git a/ci/x86_64-windows-debug.ps1 b/ci/x86_64-windows-debug.ps1 index dec3a4be22391f72a9a225d0b1c6d2d8d113c707..c1ae92494e9868813dff21760188d1fcb8569756 100644 --- a/ci/x86_64-windows-debug.ps1 +++ b/ci/x86_64-windows-debug.ps1 @@ -23,7 +23,6 @@ function CheckLastExitCode { # Make the `zig version` number consistent. # This will affect the `zig build` command below which uses `git describe`. -git config core.abbrev 9 git fetch --tags if ((git rev-parse --is-shallow-repository) -eq "true") { diff --git a/ci/x86_64-windows-release.ps1 b/ci/x86_64-windows-release.ps1 index c306756bd22ffe9cf4a3c2b0e3a128bd2ec3f226..988402606b5c869b9b6e94336566039770d78d00 100644 --- a/ci/x86_64-windows-release.ps1 +++ b/ci/x86_64-windows-release.ps1 @@ -23,7 +23,6 @@ function CheckLastExitCode { # Make the `zig version` number consistent. # This will affect the `zig build` command below which uses `git describe`. -git config core.abbrev 9 git fetch --tags if ((git rev-parse --is-shallow-repository) -eq "true") {