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

go.opentelemetry.io/otel no longuer compiles in 16.2 but compiles in 15.2 #248

Open
izissise opened this issue Mar 12, 2024 · 4 comments
Open

Comments

@izissise
Copy link
Contributor

izissise commented Mar 12, 2024

After upgrading go-rules to 1.16.2, I get the following error:

Error building target ///go.opentelemetry.io_otel//propagation:propagation: exit status 1
pkg/linux_arm64/go.opentelemetry.io/otel/propagation/trace_context.go, line 23, column 2: could not import go.opentelemetry.io/otel/trace (open : no such file or directory)

In 1.15.2 it works,
go.opentelemetry.io_otel/propagation/BUILD.plz diff:

<     deps = [
<         "///go.opentelemetry.io_otel_trace//:trace",
<         "//baggage",
<     ],
---
>     deps = ["//baggage"],
@izissise
Copy link
Contributor Author

I failed to see which commit between 1.15.2 and 1.16.2 changes this behavior, it must be related to please_go. Any clue?

@izissise
Copy link
Contributor Author

@peterebden Any clues?

@VJftw
Copy link
Contributor

VJftw commented Nov 11, 2024

I just ran into this, looks like there's a circular dependency between the go.opentelemetry.io/otel and go.opentelemetry.io/otel/trace modules. I've resolved by using a go_mod_download to break it up:

go_mod_download(
    name = "go.opentelemetry.io_otel_download",
    module = "go.opentelemetry.io/otel",
    version = "v1.29.0",
)

go_module(
    name = "go.opentelemetry.io_otel_codes",
    download = ":go.opentelemetry.io_otel_download",
    install = [
        "codes",
        "attribute",
    ],
    module = "go.opentelemetry.io/otel",
)

go_module(
    name = "go.opentelemetry.io_otel",
    download = ":go.opentelemetry.io_otel_download",
    install = [
        ".",
        "baggage",
        "internal/...",
        "semconv/...",
        "propagation",
    ],
    module = "go.opentelemetry.io/otel",
    deps = [
        ":github.com_go-logr_logr",
        ":github.com_go-logr_stdr",
        ":go.opentelemetry.io_otel_metric",
        ":go.opentelemetry.io_otel_trace",
        "//third_party/go:go.opentelemetry.io_otel_codes",
    ],
)

go_module(
    name = "go.opentelemetry.io_otel_trace",
    install = [
        ".",
        "embedded",
    ],
    module = "go.opentelemetry.io/otel/trace",
    version = "v1.29.0",
    deps = [
        "//third_party/go:go.opentelemetry.io_otel_codes",
    ],
)

go_module(
    name = "go.opentelemetry.io_otel_metric",
    install = [
        ".",
        "embedded",
        "noop",
    ],
    module = "go.opentelemetry.io/otel/metric",
    version = "v1.29.0",
    deps = [
        "//third_party/go:go.opentelemetry.io_otel_codes",
    ],
)

go_module(
    name = "github.com_felixge_httpsnoop",
    module = "github.com/felixge/httpsnoop",
    version = "v1.0.4",
)

go_module(
    name = "github.com_go-logr_logr",
    install = [
        ".",
        "funcr",
    ],
    module = "github.com/go-logr/logr",
    version = "v1.4.2",
)

go_module(
    name = "github.com_go-logr_stdr",
    module = "github.com/go-logr/stdr",
    version = "v1.2.2",
    deps = [":github.com_go-logr_logr"],
)

go_module(
    name = "go.opentelemetry.io_contrib_instrumentation_net_http_otelhttp",
    install = [
        ".",
        "internal/...",
    ],
    module = "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp",
    version = "v0.54.0",
    deps = [
        ":github.com_felixge_httpsnoop",
        ":go.opentelemetry.io_otel",
    ],
)

@izissise
Copy link
Contributor Author

Wow nice thanks!

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

No branches or pull requests

2 participants