mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-01 08:25:00 +00:00
simplify golang deps
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
8d0419d3d1
commit
b77507ab67
2 changed files with 17 additions and 9 deletions
18
Makefile
18
Makefile
|
@ -337,8 +337,14 @@ clean-tests:
|
|||
clean-dc: clean
|
||||
cp -r /build/backend-assets /workspace/backend-assets
|
||||
|
||||
## Install Go tools
|
||||
install-go-tools:
|
||||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@1958fcbe2ca8bd93af633f11e97d44e567e945af
|
||||
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2
|
||||
go install github.com/GeertJohan/go.rice/rice@latest
|
||||
|
||||
## Build:
|
||||
build: prepare backend-assets grpcs ## Build the project
|
||||
build: prepare backend-assets grpcs install-go-tools ## Build the project
|
||||
$(info ${GREEN}I local-ai build info:${RESET})
|
||||
$(info ${GREEN}I BUILD_TYPE: ${YELLOW}$(BUILD_TYPE)${RESET})
|
||||
$(info ${GREEN}I GO_TAGS: ${YELLOW}$(GO_TAGS)${RESET})
|
||||
|
@ -422,10 +428,12 @@ prepare-test: grpcs
|
|||
cp tests/models_fixtures/* test-models
|
||||
|
||||
## Build test binary
|
||||
test-binary: prepare-test
|
||||
test-binary: prepare-test install-go-tools
|
||||
export GO_TAGS="tts debug"
|
||||
CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GOCMD) test -c -o test-binary ./...
|
||||
rice append --exec test-binary
|
||||
mkdir -p $(TEST_DIR)
|
||||
CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GOCMD) test -c -o $(TEST_DIR)/test-binary ./...
|
||||
rice append --exec $(TEST_DIR)/test-binary
|
||||
cp $(TEST_DIR)/test-binary ./test-binary
|
||||
|
||||
## Test targets
|
||||
test: prepare test-models/testmodel.ggml test-binary
|
||||
|
@ -504,7 +512,7 @@ protogen: protogen-go protogen-python
|
|||
protogen-clean: protogen-go-clean protogen-python-clean
|
||||
|
||||
.PHONY: protogen-go
|
||||
protogen-go:
|
||||
protogen-go: install-go-tools
|
||||
mkdir -p pkg/grpc/proto
|
||||
protoc --experimental_allow_proto3_optional -Ibackend/ --go_out=pkg/grpc/proto/ --go_opt=paths=source_relative --go-grpc_out=pkg/grpc/proto/ --go-grpc_opt=paths=source_relative \
|
||||
backend/backend.proto
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue