semver: add proper semantic versioning and ABI check workflow for libllama

- Add LLAMA_VERSION_MAJOR/MINOR variables to CMakeLists.txt (both default 0)
  replacing the hard-coded 0.0.{build_number} scheme
- Use GenerateExportHeader in src/CMakeLists.txt to generate llama_export.h
  and replace the manual LLAMA_API visibility macro dance in include/llama.h
- Set SOVERSION to LLAMA_VERSION_MAJOR so the .so symlink tracks the major
  ABI version (libllama.so.0 -> libllama.so.0.MINOR.PATCH)
- Install the generated llama_export.h alongside llama.h as a public header
- Add scripts/libllama.abi: committed baseline of exported llama_* symbols
  (233 symbols extracted from the current build)
- Add .github/workflows/libllama-abi-check.yml: CI workflow that builds
  libllama, extracts symbols with nm, and compares against the baseline to
  determine whether a MAJOR (symbols removed) or MINOR (symbols added)
  version bump is required

Agent-Logs-Url: https://github.com/ggml-org/llama.cpp/sessions/e9059c50-ffff-4233-a16d-13a7214f7b98

Co-authored-by: ggerganov <1991296+ggerganov@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-15 11:44:00 +00:00
committed by GitHub
parent 8dc530b86d
commit 3f3d62ffec
5 changed files with 358 additions and 19 deletions

View File

@@ -12,19 +12,7 @@
#include <stdio.h>
#include <stdbool.h>
#ifdef LLAMA_SHARED
# if defined(_WIN32) && !defined(__MINGW32__)
# ifdef LLAMA_BUILD
# define LLAMA_API __declspec(dllexport)
# else
# define LLAMA_API __declspec(dllimport)
# endif
# else
# define LLAMA_API __attribute__ ((visibility ("default")))
# endif
#else
# define LLAMA_API
#endif
#include "llama_export.h"
#ifdef __GNUC__
# define DEPRECATED(func, hint) func __attribute__((deprecated(hint)))