Skip to content

Commit e9caa8c

Browse files
committed
fix: enable CGO for SQLite support in desktop builds
- Change CGO_ENABLED=0 to CGO_ENABLED=1 in package-macos.sh - Change CGO_ENABLED=0 to CGO_ENABLED=1 in package-linux.sh - Remove network-debugger.exe from repository - Add network-debugger* patterns to .gitignore Fixes: "go-sqlite3 requires cgo to work" error in desktop app
1 parent de1602c commit e9caa8c

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
./network-debugger
21
/tmp/
32
/build/
43
/web/downloads/
@@ -45,6 +44,11 @@ coverage*.out
4544
*.pprof
4645
*.prof
4746

47+
# Built binaries (avoid committing by accident)
48+
/network-debugger
49+
/network-debugger.exe
50+
/network-debugger-*
51+
4852
# ===============
4953
# Flutter / Dart (frontend)
5054
# ===============

network-debugger.exe

-26.5 MB
Binary file not shown.

scripts/package-linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ mkdir -p "$DIST_DIR"
3232
echo -e "\n${YELLOW}Step 2/6: Building Go server binary...${NC}"
3333
cd "$(dirname "$0")/.."
3434
echo " Building for Linux $ARCH..."
35-
CGO_ENABLED=0 GOOS=linux GOARCH="$ARCH" \
35+
CGO_ENABLED=1 GOOS=linux GOARCH="$ARCH" \
3636
go build -ldflags="-s -w" -o "$DIST_DIR/server_linux_$ARCH" \
3737
./cmd/network-debugger
3838

scripts/package-macos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ mkdir -p "$DIST_DIR"
3434
echo -e "\n${YELLOW}Step 2/5: Building Go server binary...${NC}"
3535
cd "$(dirname "$0")/.."
3636
echo " Building for macOS $(uname -m)..."
37-
CGO_ENABLED=0 GOOS=darwin GOARCH=$(uname -m | sed 's/x86_64/amd64/;s/arm64/arm64/') \
37+
CGO_ENABLED=1 GOOS=darwin GOARCH=$(uname -m | sed 's/x86_64/amd64/;s/arm64/arm64/') \
3838
go build -ldflags="-s -w" -o "$DIST_DIR/server_darwin_$(uname -m | sed 's/x86_64/amd64/')" \
3939
./cmd/network-debugger
4040

0 commit comments

Comments
 (0)