From 66a6b5b9a280ffdbb702224ac3039885d34f2fcd Mon Sep 17 00:00:00 2001 From: Ole-Morten Duesund Date: Sun, 31 Aug 2025 20:09:50 +0200 Subject: [PATCH] fix: Enable CGO for SQLite3 database support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Set CGO_ENABLED=1 in Makefile for all build targets - Set CGO_ENABLED=1 in Debian build script - Resolves "go-sqlite3 requires cgo to work" runtime error - Ensures proper SQLite3 database functionality 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- Makefile | 6 +++--- scripts/build-deb.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 1543a96..01228f0 100644 --- a/Makefile +++ b/Makefile @@ -9,19 +9,19 @@ LDFLAGS=-w -s -X main.version=$(VERSION) build: @echo "Building skyview..." @mkdir -p $(BUILD_DIR) - go build -ldflags="$(LDFLAGS)" -o $(BUILD_DIR)/skyview ./cmd/skyview + CGO_ENABLED=1 go build -ldflags="$(LDFLAGS)" -o $(BUILD_DIR)/skyview ./cmd/skyview # Build beast-dump utility binary build-beast-dump: @echo "Building beast-dump..." @mkdir -p $(BUILD_DIR) - go build -ldflags="$(LDFLAGS)" -o $(BUILD_DIR)/beast-dump ./cmd/beast-dump + CGO_ENABLED=1 go build -ldflags="$(LDFLAGS)" -o $(BUILD_DIR)/beast-dump ./cmd/beast-dump # Build skyview-data database management binary build-skyview-data: @echo "Building skyview-data..." @mkdir -p $(BUILD_DIR) - go build -ldflags="$(LDFLAGS)" -o $(BUILD_DIR)/skyview-data ./cmd/skyview-data + CGO_ENABLED=1 go build -ldflags="$(LDFLAGS)" -o $(BUILD_DIR)/skyview-data ./cmd/skyview-data # Build all binaries build-all: build build-beast-dump build-skyview-data diff --git a/scripts/build-deb.sh b/scripts/build-deb.sh index 6704674..a9482be 100755 --- a/scripts/build-deb.sh +++ b/scripts/build-deb.sh @@ -36,7 +36,7 @@ cd "$PROJECT_DIR" # Build the applications echo_info "Building SkyView applications..." -export CGO_ENABLED=0 +export CGO_ENABLED=1 export GOOS=linux export GOARCH=amd64