Skip to content

Support projects using vendoring #195

@txabman42

Description

@txabman42

Coming from #120 (comment)

Right now, it fails instrumenting an app with vendoring (go mod vendor), for example, https://github.com/VictoriaMetrics/VictoriaMetrics. otel go build -a ./app/vmctl will fail with:

Error logs
...
go: inconsistent vendoring in /Users/xabier/Documents/github/VictoriaMetrics:
        github.com/open-telemetry/opentelemetry-go-compile-instrumentation/pkg/instrumentation/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        github.com/open-telemetry/opentelemetry-go-compile-instrumentation/pkg/instrumentation/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        github.com/open-telemetry/opentelemetry-go-compile-instrumentation/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        github.com/open-telemetry/opentelemetry-go-compile-instrumentation/pkg/instrumentation/grpc: is replaced in go.mod, but not marked as replaced in vendor/modules.txt
        github.com/open-telemetry/opentelemetry-go-compile-instrumentation/pkg/instrumentation/nethttp: is replaced in go.mod, but not marked as replaced in vendor/modules.txt
        github.com/open-telemetry/opentelemetry-go-compile-instrumentation/pkg: is replaced in go.mod, but not marked as replaced in vendor/modules.txt

        To ignore the vendor directory, use -mod=readonly or -mod=mod.
        To sync the vendor directory, run:
                go mod vendor
Error:
[0] failed to run command "go" with args: [build -work -toolexec=/Users/xabier/Documents/github/VictoriaMetrics/../opentelemetry-go-compile-instrumentation/otel toolexec -a -a ./app/vmctl]: exit status 
...

Same error could be replicated by generating the vendor folder in /demo/basic

The go.mod is being modified resulting in an incompatibility between the vendor.txt and the go.mod.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions