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

bug(cgo): go_binary and returns DefaultInfo without executable #3713

Open
tyler-french opened this issue Sep 26, 2023 · 0 comments
Open

bug(cgo): go_binary and returns DefaultInfo without executable #3713

tyler-french opened this issue Sep 26, 2023 · 0 comments

Comments

@tyler-french
Copy link
Contributor

What version of rules_go are you using?

HEAD

What version of gazelle are you using?

0.33.0

What version of Bazel are you using?

6.3.2

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

Yes

What operating system and processor architecture are you using?

Linux AMD64

Any other potentially useful information about your toolchain?

This issue was introduced in #3627

What did you do?

bazel build   //src/.../internal/cgoclient:cgoclient
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
# gazelle:ignore *_test.go

go_library(
    name = "go_default_library",
    srcs = [
        "adaptor.c",
        "adaptor.h",
        "client.go",
        "defs.h",
        "download_blob.go",
        "get_blob_metadata.go",
        "new_client.go",
        "tb_client.h",
        "upload_blob.go",
    ],
    cgo = True,
    ...
)

go_binary(
    name = "cgoclient",
    out = "client",
    embed = [":go_default_library"],
    gc_linkopts = ["-buildmode=c-shared"],
    linkmode = "c-shared",
    visibility = ["//visibility:public"],
)

What did you expect to see?

A successful build

What did you see instead?

Got error:

ERROR: /home/user/.cache/bazel/_bazel_tfrench/b97476d719d716accead0f2d5b93104f/external/org_uber_go_yarpc/encoding/thrift/thriftrw-plugin-yarpc/BUILD.bazel:23:10: in go_binary rule @org_uber_go_yarpc//encoding/thrift/thriftrw-plugin-yarpc:thriftrw-plugin-yarpc: 
/home/user/.cache/bazel/_bazel_tfrench/b97476d719d716accead0f2d5b93104f/external/io_bazel_rules_go/go/private/rules/binary.bzl:154:37: The rule 'go_binary' is executable. It needs to create an executable File and pass it as the 'executable' parameter to the DefaultInfo it returns.
ERROR:

But only after #3627

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant