You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I reviewed the Discussions, and have a new bug or useful enhancement to share.
Expected Behavior
When I build the package from the source tarball uploaded to PyPI, I expect PACKAGE_VERSION in ggml-version.cmake file set to the same version as extracted from git when building directly from the git repo.
This is probably because while the published tarball includes .git, the checkout done by actions/checkout in the publish workflow doesn't fetch full depth of the git repo, so the checkout turns out shallow.
This is what is seen during the build:
python3.12-llama-cpp-python> CMake Warning at vendor/llama.cpp/ggml/CMakeLists.txt:298 (message):
python3.12-llama-cpp-python> GGML build version fixed at 1 likely due to a shallow clone.
I think this can be fixed by setting fetch-depth to 0 for the publish workflow. Of course, this may be not very optimal because then the resulting tarball will have to include complete git repo. (The difference in my local tests is around 100Mb.)
Perhaps an alternative fix is to calculate the version during the sdist build, then storing it inside the tarball as a file; finally, read the version from this file during the build, if it's present.
The text was updated successfully, but these errors were encountered:
This will enable llama-cpp-python to generate the file during sdist
build and include it into the final tarball. The file then will be
picked up by the package build to include the correct version, even
without full git checkout included.
Related: abetlen/llama-cpp-python#1979
Signed-off-by: Ihar Hrachyshka <[email protected]>
booxter
added a commit
to booxter/llama-cpp-python
that referenced
this issue
Mar 22, 2025
With that, builds using tarball will still have the correct cmake
package version for ggml.
This assumes the file is read by llama.cpp build system, see:
ggml-org/llama.cpp#12509Fixesabetlen#1979
Signed-off-by: Ihar Hrachyshka <[email protected]>
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Expected Behavior
When I build the package from the source tarball uploaded to PyPI, I expect
PACKAGE_VERSION
inggml-version.cmake
file set to the same version as extracted fromgit
when building directly from the git repo.Current Behavior
This is probably because while the published tarball includes
.git
, the checkout done byactions/checkout
in the publish workflow doesn't fetch full depth of the git repo, so the checkout turns out shallow.This is what is seen during the build:
I think this can be fixed by setting
fetch-depth
to0
for the publish workflow. Of course, this may be not very optimal because then the resulting tarball will have to include complete git repo. (The difference in my local tests is around 100Mb.)Perhaps an alternative fix is to calculate the version during the sdist build, then storing it inside the tarball as a file; finally, read the version from this file during the build, if it's present.
The text was updated successfully, but these errors were encountered: