Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ jobs:
COMMIT=${GITHUB_SHA::8}
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")

# sqlite-vec's cgo bindings #include "sqlite3.h". The manylinux
# image has no SQLite headers, and AlmaLinux 8's sqlite-devel
# (3.26) is old enough that sqlite-vec would silently compile out
# its vtab_in support. Use the header of the exact amalgamation
# bundled and statically linked by mattn/go-sqlite3.
go mod download github.com/mattn/go-sqlite3
mkdir -p .sqlite-include
cp "$(go list -m -f '{{.Dir}}' github.com/mattn/go-sqlite3)/sqlite3-binding.h" .sqlite-include/sqlite3.h
export CGO_CFLAGS="-I${PWD}/.sqlite-include"

mkdir -p dist
LDFLAGS="-s -w -X main.version=v${VERSION} -X main.commit=${COMMIT} -X main.buildDate=${BUILD_DATE}"
go build -tags fts5 -buildvcs=false -ldflags="$LDFLAGS" -trimpath \
Expand Down
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download

# sqlite-vec's cgo bindings (pulled in via go.kenn.io/kit/vector/sqlitevec)
# #include "sqlite3.h", which this image does not ship. Compile them against
# the header of the exact SQLite amalgamation that mattn/go-sqlite3 bundles
# and statically links, so header and linked library always match.
RUN mkdir -p /sqlite-include \
&& cp "$(go list -m -f '{{.Dir}}' github.com/mattn/go-sqlite3)/sqlite3-binding.h" /sqlite-include/sqlite3.h
ENV CGO_CFLAGS="-I/sqlite-include"

COPY . ./
COPY --from=frontend-build /src/frontend/dist ./internal/web/dist

Expand Down