open-telemetry / opentelemetry-swift

OpenTelemetry API for Swift
https://opentelemetry.io/docs/instrumentation/swift/
Apache License 2.0
207 stars 124 forks source link

Explicit `static` library types causes duplication of library code #548

Open ganeshnj opened 2 months ago

ganeshnj commented 2 months ago

All libraries shipped in the repo currently explicitly defaults to static linking which means every target that depends on them will have the library included. This can lead to duplicate libraries. For example

app
|
package b
|       |
|       OpenTelemetryApi
|
package a
|
OpenTelemetryApi

A customer can workaround this by simplifying the dependency graph such as

app
|
package b
|
package a
|
OpenTelemetryApi

but this only works if the customer has control over every package in the dependency graph.

I know SPM had issues with linking in the past but I believe they are fixed now and we should not explicitly define how libraries should be linked in the target but let SPM handle it.

n-ravichandran commented 3 weeks ago

running into the same issue. is there any update on this?