Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

language/go: set go_test attribute for handling conflicting package heights #629

Open
jmhodges opened this issue Aug 27, 2019 · 2 comments
Labels

Comments

@jmhodges
Copy link
Contributor

What version of gazelle are you using?

Current HEAD (1dff296)

What version of rules_go are you using?

0.19.3

What version of Bazel are you using?

0.28.1-homebrew

Does this issue reproduce with the latest releases of all the above?

yes

What operating system and processor architecture are you using?

macOS 10.14.6

What did you do?

Add

go_repository(
    name = "com_github_aws_aws_sdk_go",
    importpath = "github.com/aws/aws-sdk-go",
    sum = "h1:UYWPGrBMlrW5VCYeWMbog1T/kqZzkvvheUDQaaUAhqI=",
    version = "v1.23.9",
)

and then run bazel build @com_github_aws_aws_sdk_go//...

What did you expect to see?

A happily built target

What did you see instead?

(Click for the full error.)

/private/var/tmp/_bazel_jeffhodges/15689f02a249bfc2939281a01a900f0c/sandbox/darwin-sandbox/1642/execroot/founding/external/com_github_aws_aws_sdk_go/aws/endpoints/example_test.go:7:2: internal compiler error: conflicting package heights 11 and 12 for path "github.com/aws/aws-sdk-go/aws/endpoints"
The full error:

ERROR: /private/var/tmp/_bazel_jeffhodges/15689f02a249bfc2939281a01a900f0c/external/com_github_aws_aws_sdk_go/aws/endpoints/BUILD.bazel:18:1: GoCompilePkg external/com_github_aws_aws_sdk_go/aws/endpoints/darwin_amd64_stripped/go_default_test%/github.com/aws/aws-sdk-go/aws/endpoints_test.a failed (Exit 1) sandbox-exec failed: error executing command
(cd /private/var/tmp/_bazel_jeffhodges/15689f02a249bfc2939281a01a900f0c/sandbox/darwin-sandbox/1642/execroot/founding &&
exec env -
APPLE_SDK_PLATFORM=MacOSX
APPLE_SDK_VERSION_OVERRIDE=10.14
CGO_ENABLED=1
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
GOARCH=amd64
GOOS=darwin
GOROOT=external/go_sdk
GOROOT_FINAL=GOROOT
PATH=external/local_config_cc:/bin:/usr/bin
SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
TMPDIR=/var/folders/vg/32jn4gdd1x3f_r9dwcryw4y00000gn/T/
XCODE_VERSION_OVERRIDE=10.3.0.10G8
/usr/bin/sandbox-exec -f /private/var/tmp/_bazel_jeffhodges/15689f02a249bfc2939281a01a900f0c/sandbox/darwin-sandbox/1642/sandbox.sb /var/tmp/_bazel_jeffhodges/install/f19da38f6b6a740b8f96452dacea1a19/_embedded_binaries/process-wrapper '--timeout=0' '--kill_delay=15' bazel-out/host/bin/external/go_sdk/builder compilepkg -sdk external/go_sdk -installsuffix darwin_amd64 -src external/com_github_aws_aws_sdk_go/aws/endpoints/decode.go -src external/com_github_aws_aws_sdk_go/aws/endpoints/defaults.go -src external/com_github_aws_aws_sdk_go/aws/endpoints/dep_service_ids.go -src external/com_github_aws_aws_sdk_go/aws/endpoints/doc.go -src external/com_github_aws_aws_sdk_go/aws/endpoints/endpoints.go -src external/com_github_aws_aws_sdk_go/aws/endpoints/v3model.go -src external/com_github_aws_aws_sdk_go/aws/endpoints/decode_test.go -src external/com_github_aws_aws_sdk_go/aws/endpoints/endpoints_test.go -src external/com_github_aws_aws_sdk_go/aws/endpoints/example_test.go -src external/com_github_aws_aws_sdk_go/aws/endpoints/v3model_test.go -arc 'github.com/aws/aws-sdk-go/aws=github.com/aws/aws-sdk-go/aws=bazel-out/darwin-fastbuild/bin/external/com_github_aws_aws_sdk_go/aws/darwin_amd64_stripped/go_default_library%/github.com/aws/aws-sdk-go/aws.a=bazel-out/darwin-fastbuild/bin/external/com_github_aws_aws_sdk_go/aws/darwin_amd64_stripped/go_default_library%/github.com/aws/aws-sdk-go/aws.x' -arc 'github.com/aws/aws-sdk-go/aws/session=github.com/aws/aws-sdk-go/aws/session=bazel-out/darwin-fastbuild/bin/external/com_github_aws_aws_sdk_go/aws/session/darwin_amd64_stripped/go_default_library%/github.com/aws/aws-sdk-go/aws/session.a=bazel-out/darwin-fastbuild/bin/external/com_github_aws_aws_sdk_go/aws/session/darwin_amd64_stripped/go_default_library%/github.com/aws/aws-sdk-go/aws/session.x' -arc 'github.com/aws/aws-sdk-go/service/s3=github.com/aws/aws-sdk-go/service/s3=bazel-out/darwin-fastbuild/bin/external/com_github_aws_aws_sdk_go/service/s3/darwin_amd64_stripped/go_default_library%/github.com/aws/aws-sdk-go/service/s3.a=bazel-out/darwin-fastbuild/bin/external/com_github_aws_aws_sdk_go/service/s3/darwin_amd64_stripped/go_default_library%/github.com/aws/aws-sdk-go/service/s3.x' -arc 'github.com/aws/aws-sdk-go/service/sqs=github.com/aws/aws-sdk-go/service/sqs=bazel-out/darwin-fastbuild/bin/external/com_github_aws_aws_sdk_go/service/sqs/darwin_amd64_stripped/go_default_library%/github.com/aws/aws-sdk-go/service/sqs.a=bazel-out/darwin-fastbuild/bin/external/com_github_aws_aws_sdk_go/service/sqs/darwin_amd64_stripped/go_default_library%/github.com/aws/aws-sdk-go/service/sqs.x' -arc 'github.com/aws/aws-sdk-go/aws/awserr=github.com/aws/aws-sdk-go/aws/awserr=bazel-out/darwin-fastbuild/bin/external/com_github_aws_aws_sdk_go/aws/awserr/darwin_amd64_stripped/go_default_library%/github.com/aws/aws-sdk-go/aws/awserr.a=bazel-out/darwin-fastbuild/bin/external/com_github_aws_aws_sdk_go/aws/awserr/darwin_amd64_stripped/go_default_library%/github.com/aws/aws-sdk-go/aws/awserr.x' -arc 'github.com/aws/aws-sdk-go/aws/endpoints=github.com/aws/aws-sdk-go/aws/endpoints=bazel-out/darwin-fastbuild/bin/external/com_github_aws_aws_sdk_go/aws/endpoints/darwin_amd64_stripped/go_default_test%/github.com/aws/aws-sdk-go/aws/endpoints.a=bazel-out/darwin-fastbuild/bin/external/com_github_aws_aws_sdk_go/aws/endpoints/darwin_amd64_stripped/go_default_test%/github.com/aws/aws-sdk-go/aws/endpoints.x' -importpath github.com/aws/aws-sdk-go/aws/endpoints -p github.com/aws/aws-sdk-go/aws/endpoints_test -package_list bazel-out/host/bin/external/go_sdk/packages.txt -o bazel-out/darwin-fastbuild/bin/external/com_github_aws_aws_sdk_go/aws/endpoints/darwin_amd64_stripped/go_default_test%/github.com/aws/aws-sdk-go/aws/endpoints_test.a -nogo bazel-out/host/bin/darwin_amd64_stripped/founding_nogo -x bazel-out/darwin-fastbuild/bin/external/com_github_aws_aws_sdk_go/aws/endpoints/darwin_amd64_stripped/go_default_test%/github.com/aws/aws-sdk-go/aws/endpoints_test.x -testfilter only -gcflags '' -asmflags '')
compilepkg: error running subcommand: exit status 2
/private/var/tmp/_bazel_jeffhodges/15689f02a249bfc2939281a01a900f0c/sandbox/darwin-sandbox/1642/execroot/founding/external/com_github_aws_aws_sdk_go/aws/endpoints/example_test.go:7:2: internal compiler error: conflicting package heights 11 and 12 for path "github.com/aws/aws-sdk-go/aws/endpoints"

@jmhodges
Copy link
Contributor Author

I was able to get there with a build_directives = ["gazelle:exclude aws/endpoints/example_test.go"], but I wonder if it's possible for this test file to still work.

@jayconrod
Copy link
Contributor

I'm fairly sure the root cause of this is bazel-contrib/rules_go#1877. Until that issue is fixed, this test probably can't be built with Bazel. It would require recompiling all or most targets the test depends on. I think we could do that with an aspect, but it's expensive, so we might require an explicit attribute to be set.

Gazelle could (theoretically) detect this condition and set the attribute. I'll leave this issue open to track that functionality.

@jayconrod jayconrod added the bug label Sep 9, 2019
@jayconrod jayconrod changed the title building aws sdk fails language/go: set go_test attribute for handling conflicting package heights Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants