mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-08 04:22:20 +08:00
Go: fix ragflow-cli building (#16721)
This commit is contained in:
11
build.sh
11
build.sh
@@ -301,21 +301,22 @@ build_go() {
|
||||
local strip_flags=()
|
||||
[ -n "$STRIP_SYMBOLS" ] && strip_flags=(-ldflags="-s -w")
|
||||
|
||||
echo "Building RAGFlow binary: $RAGFLOW_SERVER_BINARY, and $RAGFLOW_CLI_BINARY"
|
||||
echo "Building RAGFlow binary: $RAGFLOW_CLI_BINARY and $RAGFLOW_SERVER_BINARY"
|
||||
GOPROXY=${GOPROXY:-https://goproxy.cn,https://proxy.golang.org,direct}
|
||||
go build "${strip_flags[@]}" -o "$RAGFLOW_CLI_BINARY" cmd/ragflow-cli.go
|
||||
|
||||
GOPROXY=${GOPROXY:-https://goproxy.cn,https://proxy.golang.org,direct} CGO_ENABLED=1 \
|
||||
CGO_CFLAGS="$CGO_CFLAGS" CGO_LDFLAGS="$CGO_LDFLAGS" \
|
||||
go build "${strip_flags[@]}" -o "$RAGFLOW_SERVER_BINARY" cmd/ragflow_server.go
|
||||
GOPROXY=${GOPROXY:-https://goproxy.cn,https://proxy.golang.org,direct} CGO_ENABLED=1 \
|
||||
CGO_CFLAGS="$CGO_CFLAGS" CGO_LDFLAGS="$CGO_LDFLAGS" \
|
||||
go build "${strip_flags[@]}" -o "$RAGFLOW_CLI_BINARY" cmd/ragflow-cli.go
|
||||
|
||||
|
||||
if [ ! -f "$RAGFLOW_SERVER_BINARY" ]; then
|
||||
echo -e "${RED}Error: Failed to build RAGFlow main binary${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}✓ Go ragflow_server built successfully: $RAGFLOW_SERVER_BINARY${NC}"
|
||||
echo -e "${GREEN}✓ Go ragflow-cli built successfully: $RAGFLOW_CLI_BINARY${NC}"
|
||||
echo -e "${GREEN}✓ Go ragflow_server built successfully: $RAGFLOW_SERVER_BINARY${NC}"
|
||||
}
|
||||
|
||||
# Configure CGO flags for native libraries (office_oxide, pdfium, pdf_oxide).
|
||||
|
||||
Reference in New Issue
Block a user