Error in external dependency(transitive deps) in bazel

74 Views Asked by At

Hi I am facing issue in external dependencies in my go project. com_github_aws_aws_sdk_go_v2_service_ecr is a transitive dependency coming from com_github_vmware_tanzu_carvel_imgpkg , error

ERROR: /private/var/tmp/_bazel_sheikhmo/0fb37abe9194d5da9d184e2b037f99e0/external/com_github_aws_aws_sdk_go_v2_service_ecrpublic/internal/endpoints/BUILD.bazel:3:11: GoCompilePkg external/com_github_aws_aws_sdk_go_v2_service_ecrpublic/internal/endpoints/endpoints.a failed: (Exit 1): sandbox-exec failed: error executing command 
.....
external/com_github_aws_aws_sdk_go_v2_service_ecr/internal/endpoints/endpoints.go:58:13: cannot use endpoints.Endpoint{…} (value of type "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2".Endpoint) as map["github.com/aws/aws-sdk-go-v2/internal/endpoints/v2".DefaultKey]"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2".Endpoint value in struct literal

I have faced issue in external dependencies in the past, I lowered or used higher the version of of dependency so that I can avoid the transitive deps but this time I am not able to. I tried different versions for the deps but none of them is working.

What is the usual approach when a transitive dep throws compilation error, as in this case?

direct dep github.com/vmware-tanzu/carvel-imgpkg/pkg/imgpkg/registry brings, github.com/aws/aws-sdk-go-v2/service/ecrpublic

> go mod why github.com/aws/aws-sdk-go-v2/service/ecrpublic
# github.com/aws/aws-sdk-go-v2/service/ecrpublic
gitlab.eng.vmware.com/tcx/tcx/cmd/tcxctl/cmd/common
github.com/vmware-tanzu/carvel-imgpkg/pkg/imgpkg/registry
github.com/awslabs/amazon-ecr-credential-helper/ecr-login
github.com/awslabs/amazon-ecr-credential-helper/ecr-login/api
github.com/aws/aws-sdk-go-v2/service/ecrpublic
>
0

There are 0 best solutions below