Skip to content

Commit 822a7bc

Browse files
committed
refactor(launcher): remove the Go launcher
The Electron launcher replaces the Go/Fyne launcher, so remove its code and everything only it needed: the cmd/launcher package and its tests, the AppImage packaging in contrib/appimage, the macOS signing script and entitlements in contrib/macos, the Makefile targets and variables that built it, and its .gitignore entry. Drop the Fyne dependency and the modules only it pulled in from go.mod and go.sum. Other packages the launcher imported (pkg/httpclient, pkg/signals) have other users and stay. Assisted-by: Claude Code:claude-sonnet-5-5
1 parent a2a7821 commit 822a7bc

27 files changed

Lines changed: 7 additions & 4329 deletions

‎.agents/ci-caching.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ The volume is real: 13 gallery-only PRs merged that week with 10 open at once, a
164164

165165
Version-pin bumps dominate PR volume: 48 `update/*` PRs in the week to 2026-07-30, from 16 pins, each a two-line diff. Most edit nothing but one `backend/*/<name>/Makefile`.
166166

167-
Neither of those two workflows can observe such a change. `make build` is `go build ./cmd/local-ai`, GoReleaser builds the same plus `./cmd/launcher`, and the core image's final stage ships only `entrypoint.sh`, `healthcheck.sh` and that binary. The per-backend trees are copied into the builder but nothing in them reaches the output.
167+
Neither of those two workflows can observe such a change. `make build` is `go build ./cmd/local-ai`, GoReleaser builds the same, and the core image's final stage ships only `entrypoint.sh`, `healthcheck.sh` and that binary. The per-backend trees are copied into the builder but nothing in them reaches the output.
168168

169169
What still triggers a full run, because none of it lives under those prefixes:
170170

‎.gitignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ go-bert
2525
# LocalAI build binary
2626
LocalAI
2727
/local-ai
28-
/local-ai-launcher
2928
# Root-level build artifacts when running `go build ./...` against
3029
# Go backend packages whose main lives under backend/go/.
3130
/cloud-proxy

‎.golangci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ linters:
109109
- path: ^pkg/model/
110110
text: 'os\.(Getenv|LookupEnv|Environ)'
111111
linters: [forbidigo]
112-
# Top-level main binaries (local-ai, launcher) are entry points.
112+
# Top-level main binaries are entry points.
113113
- path: ^cmd/
114114
text: 'os\.(Getenv|LookupEnv|Environ)'
115115
linters: [forbidigo]

‎Makefile‎

Lines changed: 2 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ GOCMD=go
77
GOTEST=$(GOCMD) test
88
GOVET=$(GOCMD) vet
99
BINARY_NAME=local-ai
10-
LAUNCHER_BINARY_NAME=local-ai-launcher
1110

1211
UBUNTU_VERSION?=2404
1312
UBUNTU_CODENAME?=noble
@@ -46,11 +45,6 @@ TEST_FLAKES?=5
4645
RANDOM := $(shell bash -c 'echo $$RANDOM')
4746

4847
VERSION?=$(shell git describe --always --tags || echo "dev" )
49-
# fyne package only accepts numeric x[.y[.z]] app versions, so reduce git
50-
# describe output (v4.9.0, v4.9.0-14-gabc1234, or a bare sha on untagged
51-
# checkouts) to its numeric core; anything non-numeric falls back to 0.0.0.
52-
# Without this the packaged launcher reports itself as version 0.0.0 (#11673).
53-
LAUNCHER_APP_VERSION?=$(shell v=$$(echo "$(VERSION)" | sed -E 's/^v//; s/[+-].*$$//'); echo "$$v" | grep -qE '^[0-9]+(\.[0-9]+){0,2}$$' && echo "$$v" || echo "0.0.0")
5448
# go tool nm ./local-ai | grep Commit
5549
LD_FLAGS?=-s -w
5650
override LD_FLAGS += -X "github.com/mudler/LocalAI/internal.Version=$(VERSION)"
@@ -205,16 +199,6 @@ build: protogen-go generate install-go-tools core/http/react-ui/dist ## Build th
205199
rm -rf $(BINARY_NAME) || true
206200
CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o $(BINARY_NAME) ./cmd/local-ai
207201

208-
build-launcher: ## Build the launcher application
209-
$(info ${GREEN}I local-ai launcher build info:${RESET})
210-
$(info ${GREEN}I BUILD_TYPE: ${YELLOW}$(BUILD_TYPE)${RESET})
211-
$(info ${GREEN}I GO_TAGS: ${YELLOW}$(GO_TAGS)${RESET})
212-
$(info ${GREEN}I LD_FLAGS: ${YELLOW}$(LD_FLAGS)${RESET})
213-
rm -rf $(LAUNCHER_BINARY_NAME) || true
214-
CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o $(LAUNCHER_BINARY_NAME) ./cmd/launcher
215-
216-
build-all: build build-launcher ## Build both server and launcher
217-
218202
build-dev: ## Run LocalAI in dev mode with live reload
219203
@command -v air >/dev/null 2>&1 || go install github.com/air-verse/air@latest
220204
air -c .air.toml
@@ -328,11 +312,10 @@ test-coverage-check: test-coverage
328312
##
329313
## LINT_EXCLUDE_DIRS_RE matches directories whose Go packages can't typecheck
330314
## without C/C++ headers we don't install in the lint runner (cgo wrappers
331-
## around llama.cpp, piper/spdlog, silero-vad/onnxruntime, and Fyne/OpenGL for
332-
## the launcher). Their compile-time correctness is enforced by their own
315+
## around llama.cpp, piper/spdlog, silero-vad/onnxruntime). Their compile-time correctness is enforced by their own
333316
## build pipelines. Keep this as a deny list — `go list ./...` discovers
334317
## everything else automatically, so new packages are scanned by default.
335-
LINT_EXCLUDE_DIRS_RE=/(backend/go/(piper|silero-vad|llm)|cmd/launcher)(/|$$)
318+
LINT_EXCLUDE_DIRS_RE=/(backend/go/(piper|silero-vad|llm))(/|$$)
336319

337320
## Set LINT_NEW_FROM to a git ref to override .golangci.yml's
338321
## new-from-merge-base (origin/master). Useful from a fork clone where
@@ -1912,51 +1895,3 @@ site: docs/static/gallery.html
19121895
.PHONY: site-serve
19131896
site-serve: site
19141897
cd website/public && python3 -m http.server 8000
1915-
1916-
########################################################
1917-
## Platform-specific builds
1918-
########################################################
1919-
1920-
## fyne cross-platform build
1921-
# Build LocalAI.app from the launcher via fyne (metadata read from cmd/launcher/FyneApp.toml).
1922-
# Signing happens via contrib/macos/sign-and-notarize.sh, which is a no-op when the signing
1923-
# secrets are unset, so unsigned local/fork builds keep working.
1924-
build-launcher-darwin:
1925-
rm -rf dist/LocalAI.app cmd/launcher/LocalAI.app
1926-
mkdir -p dist
1927-
cd cmd/launcher && go run fyne.io/tools/cmd/fyne@latest package -os darwin -icon ../../core/http/static/logo.png --executable $(LAUNCHER_BINARY_NAME) --app-version $(LAUNCHER_APP_VERSION)
1928-
mv cmd/launcher/LocalAI.app dist/LocalAI.app
1929-
bash contrib/macos/sign-and-notarize.sh sign dist/LocalAI.app
1930-
1931-
# Notarize + staple the .app itself, then wrap it into a drag-to-Applications
1932-
# DMG via hdiutil and sign the DMG. The app is stapled BEFORE packaging so the
1933-
# bundle carries its own ticket and verifies offline (a dmg-only staple leaves
1934-
# the app relying on an online Gatekeeper check, which fails offline / once the
1935-
# app is copied out of the dmg). No-op without notary secrets.
1936-
dmg-launcher-darwin: build-launcher-darwin
1937-
bash contrib/macos/sign-and-notarize.sh notarize-app dist/LocalAI.app
1938-
rm -rf dist/dmg dist/LocalAI.dmg
1939-
mkdir -p dist/dmg
1940-
cp -R dist/LocalAI.app dist/dmg/LocalAI.app
1941-
ln -s /Applications dist/dmg/Applications
1942-
hdiutil create -volname "LocalAI" -srcfolder dist/dmg -ov -format UDZO dist/LocalAI.dmg
1943-
bash contrib/macos/sign-and-notarize.sh sign dist/LocalAI.dmg
1944-
1945-
# Submit the DMG to Apple notarization and staple the ticket (no-op without notary secrets).
1946-
notarize-launcher-darwin: dmg-launcher-darwin
1947-
bash contrib/macos/sign-and-notarize.sh notarize dist/LocalAI.dmg
1948-
1949-
# Single entrypoint for CI: build -> sign app -> notarize+staple app -> dmg -> sign dmg -> notarize+staple dmg.
1950-
release-launcher-darwin: notarize-launcher-darwin
1951-
@echo "dist/LocalAI.dmg is ready"
1952-
1953-
build-launcher-linux:
1954-
cd cmd/launcher && go run fyne.io/tools/cmd/fyne@latest package -os linux -icon ../../core/http/static/logo.png --executable $(LAUNCHER_BINARY_NAME)-linux --app-version $(LAUNCHER_APP_VERSION) && mv LocalAI.tar.xz ../../$(LAUNCHER_BINARY_NAME)-linux.tar.xz
1955-
1956-
# Thin native launcher only; retains the first-run LocalAI runtime downloader.
1957-
.PHONY: build-launcher-appimage test-launcher-appimage
1958-
build-launcher-appimage:
1959-
APPIMAGE_ARCH=$(or $(APPIMAGE_ARCH),amd64) bash contrib/appimage/build.sh
1960-
1961-
test-launcher-appimage:
1962-
python3 -m unittest discover -s contrib/appimage -p 'test_*.py' -v

‎cmd/launcher/FyneApp.toml‎

Lines changed: 0 additions & 8 deletions
This file was deleted.

‎cmd/launcher/icon.go‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)