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

make otel-from-tree results in ambiguous import errors #30330

Closed
alanwest opened this issue Jan 8, 2024 · 1 comment · Fixed by #30333
Closed

make otel-from-tree results in ambiguous import errors #30330

alanwest opened this issue Jan 8, 2024 · 1 comment · Fixed by #30333
Assignees
Labels
bug Something isn't working

Comments

@alanwest
Copy link
Member

alanwest commented Jan 8, 2024

Component(s)

No response

What happened?

Running the following:

mkdir collector
cd collector
git clone git@github.com:open-telemetry/opentelemetry-collector.git
git clone git@github.com:open-telemetry/opentelemetry-collector-contrib.git
cd opentelemetry-collector-contrib
make otel-from-tree
make install-tools
make

Results in lots of ambiguous import errors:

connector/countconnector/internal/metadata/generated_status.go:6:2: ambiguous import: found package go.opentelemetry.io/collector/component in multiple modules:
	go.opentelemetry.io/collector v0.91.0 (/Users/awest/github/collector/opentelemetry-collector/component)
	go.opentelemetry.io/collector/component v0.91.0 (/Users/awest/go/1.21.5/pkg/mod/go.opentelemetry.io/collector/component@v0.91.0)
internal/coreinternal/traceutil/traceutil.go:9:2: ambiguous import: found package go.opentelemetry.io/collector/pdata/pcommon in multiple modules:
	go.opentelemetry.io/collector v0.91.0 (/Users/awest/github/collector/opentelemetry-collector/pdata/pcommon)
	go.opentelemetry.io/collector/pdata v1.0.0 (/Users/awest/go/1.21.5/pkg/mod/go.opentelemetry.io/collector/pdata@v1.0.0/pcommon)
internal/coreinternal/traceutil/traceutil.go:10:2: ambiguous import: found package go.opentelemetry.io/collector/pdata/ptrace in multiple modules:
	go.opentelemetry.io/collector v0.91.0 (/Users/awest/github/collector/opentelemetry-collector/pdata/ptrace)
	go.opentelemetry.io/collector/pdata v1.0.0 (/Users/awest/go/1.21.5/pkg/mod/go.opentelemetry.io/collector/pdata@v1.0.0/ptrace)
internal/filter/filterconfig/config.go:11:2: ambiguous import: found package go.opentelemetry.io/collector/pdata/plog in multiple modules:
	go.opentelemetry.io/collector v0.91.0 (/Users/awest/github/collector/opentelemetry-collector/pdata/plog)
	go.opentelemetry.io/collector/pdata v1.0.0 (/Users/awest/go/1.21.5/pkg/mod/go.opentelemetry.io/collector/pdata@v1.0.0/plog)
...

Collector version

v0.91.0

Environment information

No response

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

@alanwest alanwest added bug Something isn't working needs triage New item requiring triage labels Jan 8, 2024
@crobert-1
Copy link
Member

I was able to reproduce and I've filed #30333 to fix this.

@crobert-1 crobert-1 self-assigned this Jan 8, 2024
@crobert-1 crobert-1 removed the needs triage New item requiring triage label Jan 8, 2024
dmitryax pushed a commit that referenced this issue Jan 10, 2024
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
From testing I found out that golang's `replace` directive didn't work
properly when using an absolute path with the `../` included. Using a
relative path or an absolute path (without `../` in the middle) resolves
the issue. The simple and most clear solution is to use a true absolute
path, so I've used `dirname` with the repo's root dir to determine the
parent dir.

**Link to tracking Issue:** <Issue number if applicable>
Fixes #30330

**Testing:** <Describe what testing was performed and which tests were
added.>
Commands in bug description are all working.
cparkins pushed a commit to AmadeusITGroup/opentelemetry-collector-contrib that referenced this issue Jan 10, 2024
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
From testing I found out that golang's `replace` directive didn't work
properly when using an absolute path with the `../` included. Using a
relative path or an absolute path (without `../` in the middle) resolves
the issue. The simple and most clear solution is to use a true absolute
path, so I've used `dirname` with the repo's root dir to determine the
parent dir.

**Link to tracking Issue:** <Issue number if applicable>
Fixes open-telemetry#30330

**Testing:** <Describe what testing was performed and which tests were
added.>
Commands in bug description are all working.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants