[GH-ISSUE #7385] v0.3.13: fatal: not a git repository (or any of the parent directories): .git #51204

Closed
opened 2026-04-28 18:54:53 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @vt-alt on GitHub (Oct 27, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7385

Originally assigned to: @dhiltgen on GitHub.

What is the issue?

Commit f9584deba5 tries to clean up submodule even with OLLAMA_SKIP_PATCHING=1, breaking builds w/o the full git tree setup (for example when we build a package for a downstream distribution such as ALT as in my case).

Maybe in that case you can do (cd ${LLAMACPP_DIR}/ && git checkout -f) similar to what was before? Or maybe some other git-less method?

ps. For a context, currently, I setup a 'fake' git repo when building ollama (excerpt from RPM spec):

tar xf %SOURCE1 -C llm
tar xf %SOURCE2 -C llm/llama.cpp/ggml/src
cd llm/llama.cpp
git init -q
git config user.name "$USER"
git config user.email "$USER"
git add -Af .
git commit -q -m "$PWD"
git tag "%version-%release"

So git checkout would work for me but git submodule update will not. Also, we do reproducible builds in network-less build nodes so updating from remote is not available by design.

OS

Linux

GPU

Other

CPU

Intel, AMD, aarch64

Ollama version

v0.3.13

Originally created by @vt-alt on GitHub (Oct 27, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7385 Originally assigned to: @dhiltgen on GitHub. ### What is the issue? Commit f9584deba5d7faa1ff547fca5ea4e19818394de8 tries to clean up submodule even with `OLLAMA_SKIP_PATCHING=1`, breaking builds w/o the full git tree setup (for example when we build a package for a downstream distribution such as ALT as in my case). Maybe in that case you can do `(cd ${LLAMACPP_DIR}/ && git checkout -f)` similar to what was before? Or maybe some other git-less method? ps. For a context, currently, I setup a 'fake' git repo when building ollama (excerpt from RPM spec): ``` tar xf %SOURCE1 -C llm tar xf %SOURCE2 -C llm/llama.cpp/ggml/src cd llm/llama.cpp git init -q git config user.name "$USER" git config user.email "$USER" git add -Af . git commit -q -m "$PWD" git tag "%version-%release" ``` So `git checkout` would work for me but `git submodule update` will not. Also, we do reproducible builds in network-less build nodes so updating from remote is not available by design. ### OS Linux ### GPU Other ### CPU Intel, AMD, aarch64 ### Ollama version v0.3.13
GiteaMirror added the buildbug labels 2026-04-28 18:54:53 -05:00
Author
Owner

@dhiltgen commented on GitHub (Oct 28, 2024):

We'll be removing the submodule soon with #7157 which will make the build process much cleaner.

<!-- gh-comment-id:2441938720 --> @dhiltgen commented on GitHub (Oct 28, 2024): We'll be removing the submodule soon with #7157 which will make the build process much cleaner.
Author
Owner

@dhiltgen commented on GitHub (Nov 4, 2024):

We've merged the PR that removes the submodule, so this should be resolved now. If you still have any problems with building on main now, let us know and I'll reopen.

<!-- gh-comment-id:2455361081 --> @dhiltgen commented on GitHub (Nov 4, 2024): We've merged the PR that removes the submodule, so this should be resolved now. If you still have any problems with building on main now, let us know and I'll reopen.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#51204