Skip to content

Commit 5ae5d96

Browse files
committed
build: disable tracing support for gRPC
The goal is to be able to reenable full dead code elimination that is prevented by non-constant calls to reflect.MethodByName(). There are many other culprits for this: ``` 08:04 ❱ go build -o /dev/null -tags release,grpcnotrace -ldflags=-dumpdep . |& go run github.com/aarzilli/whydeadcode@latest github.com/go-playground/validator/v10.tryCallValidateFn reachable from: github.com/go-playground/validator/v10.isValidateFn github.com/go-playground/validator/v10.isValidateFn·f github.com/go-playground/validator/v10.map.init.11 github.com/go-playground/validator/v10.bakedInValidators github.com/go-playground/validator/v10.New akvorado/common/helpers.init.1 akvorado/common/helpers..inittask go:main.inittasks _ github.com/expr-lang/expr/builtin.get reachable from: github.com/expr-lang/expr/builtin.get·f github.com/expr-lang/expr/builtin..stmp_53 github.com/expr-lang/expr/builtin..stmp_0 github.com/expr-lang/expr/builtin.init github.com/expr-lang/expr/builtin..inittask go:main.inittasks _ github.com/expr-lang/expr/checker/nature.Nature.All reachable from: type:github.com/expr-lang/expr/checker/nature.Nature type:func() github.com/expr-lang/expr/checker/nature.Nature type:github.com/expr-lang/expr/ast.Node type:github.com/expr-lang/expr/vm.Program type:*github.com/expr-lang/expr/vm.Program type:akvorado/outlet/core.ExporterClassifierRule type:[]akvorado/outlet/core.ExporterClassifierRule type:akvorado/outlet/core.Configuration type:akvorado/cmd.OutletConfiguration type:[]akvorado/cmd.OutletConfiguration type:akvorado/cmd.OrchestratorConfiguration type:*akvorado/cmd.OrchestratorConfiguration internal/abi..dict.TypeFor[akvorado/cmd.OrchestratorConfiguration] reflect..dict.TypeFor[akvorado/cmd.OrchestratorConfiguration] akvorado/cmd.init.6.orchestratorClickHouseMigrationHook.func2 akvorado/cmd.init.6.orchestratorClickHouseMigrationHook.func2·f akvorado/cmd.init.6 akvorado/cmd..inittask go:main.inittasks _ text/template.(*state).evalField reachable from: text/template.(*state).evalFieldChain text/template.(*state).evalCommand text/template.(*state).evalPipeline text/template.(*state).walk text/template.(*Template).execute akvorado/console/authentication.(*Component).UserAuthentication.func1 akvorado/console/authentication.(*Component).UserAuthentication type:*akvorado/console/authentication.Component akvorado/cmd.consoleStart akvorado/cmd.init.func3 akvorado/cmd.init.func3·f akvorado/cmd..stmp_2 akvorado/cmd.init akvorado/cmd..inittask go:main.inittasks _ gorm.io/gorm/schema.ParseWithSpecialTableName reachable from: gorm.io/gorm.(*DB).assignInterfacesToValue gorm.io/gorm.(*DB).FirstOrInit type:*gorm.io/gorm.DB type:akvorado/console/database.Component akvorado/cmd.consoleStart akvorado/cmd.init.func3 akvorado/cmd.init.func3·f akvorado/cmd..stmp_2 akvorado/cmd.init akvorado/cmd..inittask go:main.inittasks _ gorm.io/gorm/schema.ParseWithSpecialTableName reachable from: gorm.io/gorm.(*DB).assignInterfacesToValue gorm.io/gorm.(*DB).FirstOrInit type:*gorm.io/gorm.DB type:akvorado/console/database.Component type:*akvorado/console/database.Component akvorado/cmd.consoleStart akvorado/cmd.init.func3 akvorado/cmd.init.func3·f akvorado/cmd..stmp_2 akvorado/cmd.init akvorado/cmd..inittask go:main.inittasks _ github.com/expr-lang/expr/vm/runtime.FetchMethod reachable from: github.com/expr-lang/expr/vm.(*VM).Run github.com/expr-lang/expr/vm.Run akvorado/outlet/core.(*ExporterClassifierRule).exec akvorado/outlet/core.(*Component).classifyExporter akvorado/outlet/core.(*worker).enrichFlow akvorado/outlet/core.(*worker).processIncomingFlow.func1 akvorado/outlet/core.(*worker).processIncomingFlow akvorado/outlet/core.(*worker).processIncomingFlow-fm akvorado/outlet/core.(*Component).newWorker akvorado/outlet/core.(*Component).newWorker-fm akvorado/outlet/core.(*Component).Start type:*akvorado/outlet/core.Component akvorado/cmd.outletStart akvorado/cmd.init.func7 akvorado/cmd.init.func7·f akvorado/cmd..stmp_6 akvorado/cmd.init akvorado/cmd..inittask go:main.inittasks _ ``` For gorm, we have go-gorm/gorm#7643. We could replace text/template by something else as our usage is quite light. For validator, it may be addressable upstream by disallowing calls to configurable validator function through a tag. For expr, it looks more complex. Then, regression should be detected by CI.
1 parent c4d3c59 commit 5ae5d96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ all: fmt lint all-indep ; $(info $(M) building executable…) @ ## Build program
6464
$(if $(filter arm64,$(TARGETARCH)),GOARM64=$(if $(findstring .,$(TARGETVARIANT)),$(TARGETVARIANT),$(TARGETVARIANT:%=%.0)),\
6565
$(if $(filter arm,$(TARGETARCH)),GOARM=$(TARGETVARIANT:v%=%)))) \
6666
$(GO) build \
67-
-tags release \
67+
-tags release,grpcnotrace \
6868
-ldflags '-X $(MODULE)/common/helpers.AkvoradoVersion=$(VERSION)' \
6969
$(BUILD_ARGS) \
7070
-o bin/$(basename $(MODULE)) .

0 commit comments

Comments
 (0)