Skip to content

Commit 697edfe

Browse files
danbevggerganov
authored andcommitted
ggml : remove dirty flag from version string (ggml/1391)
This commit removes the "-dirty" suffix from the GGML version string. The motivation for this change is to ensure that the version string works with different ways of checking out ggml and using it in projects. By removing the dirty flag from the version string, we avoid potential artifacts like shared libraries getting a -dirty suffix in their names. Instead, if the project is built from a dirty git state, the dirty flag will be appended to the commit hash in the GGML_BUILD_COMMIT variable. This will enable users to still identify that the build was made from from a modified/dirty state even though the version might match a "real" version. For example, the commit can be produces as follows: ```c++ printf("commit: %s\n", ggml_commit()); ``` Which would print the following for a dirty build: ```console commit: 781baf2a-dirty ``` Refs: ggml-org/ggml#1363 (comment)
1 parent dbb852b commit 697edfe

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ggml/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,17 @@ if(GIT_EXE)
2525
)
2626
endif()
2727

28-
# Build the version string with optional dirty flag
2928
set(GGML_VERSION "${GGML_VERSION_BASE}")
30-
if(GGML_GIT_DIRTY AND NOT GGML_GIT_DIRTY EQUAL 0)
31-
set(GGML_VERSION "${GGML_VERSION}-dirty")
32-
endif()
3329

3430
if(NOT GGML_BUILD_COMMIT)
3531
set(GGML_BUILD_COMMIT "unknown")
3632
endif()
3733

34+
# Build the commit string with optional dirty flag
35+
if(DEFINED GGML_GIT_DIRTY AND GGML_GIT_DIRTY EQUAL 1)
36+
set(GGML_BUILD_COMMIT "${GGML_BUILD_COMMIT}-dirty")
37+
endif()
38+
3839
include(CheckIncludeFileCXX)
3940

4041
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

0 commit comments

Comments
 (0)