kedacore / keda

KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes
https://keda.sh
Apache License 2.0
8.38k stars 1.06k forks source link

Fail to build in dev container #5477

Closed junekhan closed 7 months ago

junekhan commented 8 months ago

Report

I tried building the project in dev container as instructed in BUILD.md. As I ran the command make build, the build terminated due to some undefined reference errors.

Expected Behavior

Seeing a successful build

Actual Behavior

Receiving errors

root@dd666a615af0:/workspaces/keda# make build
test -s /workspaces/keda/bin/controller-gen || GOBIN=/workspaces/keda/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen
test -s /workspaces/keda/bin/mockgen || GOBIN=/workspaces/keda/bin go install github.com/golang/mock/mockgen
PATH="/workspaces/keda/bin:/vscode/vscode-server/bin/linux-arm64/8b3775030ed1a69b13e4f4c628c612102e30a681/bin/remote-cli:/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" protoc -I vendor --proto_path=hack LiiklusService.proto --go_out=pkg/scalers/liiklus --go-grpc_out=pkg/scalers/liiklus
PATH="/workspaces/keda/bin:/vscode/vscode-server/bin/linux-arm64/8b3775030ed1a69b13e4f4c628c612102e30a681/bin/remote-cli:/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" protoc -I vendor --proto_path=pkg/scalers/externalscaler externalscaler.proto --go_out=pkg/scalers/externalscaler --go-grpc_out=pkg/scalers/externalscaler
PATH="/workspaces/keda/bin:/vscode/vscode-server/bin/linux-arm64/8b3775030ed1a69b13e4f4c628c612102e30a681/bin/remote-cli:/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" protoc -I vendor --proto_path=pkg/metricsservice/api metrics.proto --go_out=pkg/metricsservice/api --go-grpc_out=pkg/metricsservice/api
/workspaces/keda/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
go fmt ./...
go vet ./...
# github.com/DataDog/datadog-api-client-go/api/v1/datadog
vendor/github.com/DataDog/datadog-api-client-go/api/v1/datadog/client.go:100:11: undefined: TagsApiService
vendor/github.com/DataDog/datadog-api-client-go/api/v1/datadog/model_formula_and_function_metric_query_definition.go:17:13: undefined: FormulaAndFunctionMetricDataSource
vendor/github.com/DataDog/datadog-api-client-go/api/v1/datadog/model_event_timeline_widget_definition.go:27:7: undefined: EventTimelineWidgetDefinitionType
vendor/github.com/DataDog/datadog-api-client-go/api/v1/datadog/model_free_text_widget_definition.go:23:7: undefined: FreeTextWidgetDefinitionType
vendor/github.com/DataDog/datadog-api-client-go/api/v1/datadog/model_table_widget_definition.go:29:7: undefined: TableWidgetDefinitionType
vendor/github.com/DataDog/datadog-api-client-go/api/v1/datadog/model_widget_request_style.go:14:12: undefined: WidgetLineType
vendor/github.com/DataDog/datadog-api-client-go/api/v1/datadog/model_widget_definition.go:39:34: undefined: TreeMapWidgetDefinition
vendor/github.com/DataDog/datadog-api-client-go/api/v1/datadog/model_funnel_query.go:19:10: undefined: FunnelStep
vendor/github.com/DataDog/datadog-api-client-go/api/v1/datadog/model_logs_list_request.go:30:7: undefined: LogsListRequestTime
vendor/github.com/DataDog/datadog-api-client-go/api/v1/datadog/model_logs_exclusion.go:15:10: undefined: LogsExclusionFilter
vendor/github.com/DataDog/datadog-api-client-go/api/v1/datadog/model_logs_exclusion.go:15:10: too many errors

Steps to Reproduce the Problem

  1. git clone git@github.com:kedacore/keda.git
    cd keda
    code .
  2. run CTRL+SHIFT+P -> Remote-Containers: Reopen in container
  3. use the integrated terminal to run: make build

Logs from KEDA operator

example

KEDA Version

2.13.0

Kubernetes Version

None

Platform

None

Scaler Details

No response

Anything else?

No response

JorTurFer commented 8 months ago

Hello, I can't reproduce the issue :/ Could you try executing the commands ?

go mod tidy
go mod vendor
make build
junekhan commented 8 months ago

Hello, I can't reproduce the issue :/ Could you try executing the commands ?

go mod tidy
go mod vendor
make build

@JorTurFer Hey buddy, now it works. Thank you! Then, these commands seem indispensable to building the project. Do you mind me making a fix to this?

JorTurFer commented 8 months ago

In theory, you shouldn't need them during the initial building because as we using vendor folder, all the deps should already be there. Did you have the repo already cloned for any reason and you pull any change or you faced with this error during the initial setup? @zroubalik , should we include both commands as part of make build directly?

junekhan commented 8 months ago

I forked KEDA two days ago as a very fresh start and did exactly what's informed in the build guide. I can't recall anything I did wrong or suspicious.

zroubalik commented 7 months ago

In theory, you shouldn't need them during the initial building because as we using vendor folder, all the deps should already be there. Did you have the repo already cloned for any reason and you pull any change or you faced with this error during the initial setup? @zroubalik , should we include both commands as part of make build directly?

yes!