Skip to content

darwin builds fail on newer version of Go with duplicate symbol dlopen #40008

Closed
@braydonk

Description

@braydonk

Component(s)

No response

What happened?

Description

GOOS=darwin builds of the collector on a sufficiently new version of Go will fail with link: duplicated definition of symbol dlopen.

This is a result of golang/go#73617. This was fixed in purego v0.8.3.

gopsutil has patched to but not released: shirou/gopsutil#1852

Steps to Reproduce

Using go1.24.3:

braydonk@bk:~/Git/opentelemetry-collector-contrib$ GOWORK=off GOOS=darwin make otelcontribcol
./internal/buildscripts/ocb-add-replaces.sh otelcontribcol
Wrote replace statements to cmd/otelcontribcol/builder-config-replaced.yaml
/usr/local/google/home/braydonk/Git/opentelemetry-collector-contrib/.tools/builder --skip-compilation --config cmd/otelcontribcol/builder-config-replaced.yaml
2025-05-12T18:52:59.482Z        INFO    internal/command.go:99  OpenTelemetry Collector Builder {"version": "v0.125.1-0.20250509190408-4ca0f1829e0a"}
2025-05-12T18:52:59.482Z        INFO    internal/command.go:104 Using config file       {"path": "cmd/otelcontribcol/builder-config-replaced.yaml"}
2025-05-12T18:52:59.488Z        INFO    builder/config.go:160   Using go        {"go-executable": "/usr/local/google/home/braydonk/sdk/go1.24.3/bin/go"}
2025-05-12T18:52:59.517Z        INFO    builder/main.go:99      Sources created {"path": "./cmd/otelcontribcol"}
2025-05-12T18:53:00.553Z        INFO    builder/main.go:201     Getting go modules
2025-05-12T18:53:00.913Z        INFO    builder/main.go:106     Generating source codes only, the distribution will not be compiled.
cd ./cmd/otelcontribcol && GO111MODULE=on CGO_ENABLED=0 go build -trimpath -o ../../bin/otelcontribcol_darwin_amd64 \
        -tags "" .
# github.com/open-telemetry/opentelemetry-collector-contrib/cmd/otelcontribcol
link: duplicated definition of symbol dlopen, from github.com/ebitengine/purego and github.com/ebitengine/purego
make: *** [Makefile:415: otelcontribcol] Error 1

Expected Result

build success :)

Actual Result

build fail :(

Collector version

HEAD

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

Log output

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions