[PR #3766] [CLOSED] introduce build.go for controlling distribution builds #11272

Closed
opened 2026-04-12 23:26:17 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/3766
Author: @bmizerany
Created: 4/19/2024
Status: Closed

Base: mainHead: build_dist


📝 Commits (1)

  • 7893ccb introduce build.go for controlling distribution builds

📊 Changes

11 files changed (+381 additions, -343 deletions)

View changed files

📝 .github/workflows/test.yaml (+10 -7)
📝 README.md (+29 -46)
build.go (+199 -0)
📝 docs/development.md (+14 -22)
📝 llm/generate/gen_darwin.sh (+4 -4)
📝 llm/generate/gen_linux.sh (+3 -3)
📝 llm/generate/gen_windows.ps1 (+120 -252)
llm/generate/generate_darwin.go (+0 -3)
llm/generate/generate_linux.go (+0 -3)
llm/generate/generate_windows.go (+0 -3)
📝 main.go (+2 -0)

📄 Description

This commit aims to provide the Ollama maintainers with maximum control of the distribution build process by creating a cross-platform shim.

Currently, we have no flexibility, or control of the process (pre and post) or even the quality of the build.

By introducing a shim, and propagating it out to Homebrew, et al., we can soon after ensure that the build process is consistent, and reliable.

This also happens to remove the requirement for go generate and the build tag hacks, but it does still support go generate in the flow, at least until we can remove it after the major distribution use the new build process.

About the script

Beyond giving the Ollama maintainers drastically more control over the build process, the script also provides a few other benefits:

  • It is cross-platform, and can be run on any platform that supports Go (a hard requirement for building Ollama anyway).

  • It can can check for correct versions of cmake, and other dependencies before starting the build process, and provide helpful error messages to the user if they are not met.

  • It can be used to build the distribution for any platform, architecture, or build type (debug, release, etc.) with a single command. Currently, it is two commands.

  • It can skip parts of the build process if they are already done, such as build the C dependencies. Of course there is a -f flag to force rebuild.

  • So much more!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/3766 **Author:** [@bmizerany](https://github.com/bmizerany) **Created:** 4/19/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `build_dist` --- ### 📝 Commits (1) - [`7893ccb`](https://github.com/ollama/ollama/commit/7893ccb68c089fc2855bd626ad82a1925f71023c) introduce build.go for controlling distribution builds ### 📊 Changes **11 files changed** (+381 additions, -343 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test.yaml` (+10 -7) 📝 `README.md` (+29 -46) ➕ `build.go` (+199 -0) 📝 `docs/development.md` (+14 -22) 📝 `llm/generate/gen_darwin.sh` (+4 -4) 📝 `llm/generate/gen_linux.sh` (+3 -3) 📝 `llm/generate/gen_windows.ps1` (+120 -252) ➖ `llm/generate/generate_darwin.go` (+0 -3) ➖ `llm/generate/generate_linux.go` (+0 -3) ➖ `llm/generate/generate_windows.go` (+0 -3) 📝 `main.go` (+2 -0) </details> ### 📄 Description This commit aims to provide the Ollama maintainers with maximum control of the distribution build process by creating a cross-platform shim. Currently, we have no flexibility, or control of the process (pre and post) or even the quality of the build. By introducing a shim, and propagating it out to Homebrew, et al., we can soon after ensure that the build process is consistent, and reliable. This also happens to remove the requirement for `go generate` and the build tag hacks, but it does still support `go generate` in the flow, at least until we can remove it after the major distribution use the new build process. About the script Beyond giving the Ollama maintainers drastically more control over the build process, the script also provides a few other benefits: - It is cross-platform, and can be run on any platform that supports Go (a hard requirement for building Ollama anyway). - It can can check for correct versions of cmake, and other dependencies before starting the build process, and provide helpful error messages to the user if they are not met. - It can be used to build the distribution for any platform, architecture, or build type (debug, release, etc.) with a single command. Currently, it is two commands. - It can skip parts of the build process if they are already done, such as build the C dependencies. Of course there is a -f flag to force rebuild. - So much more! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-12 23:26:17 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#11272