Skip to content

Conversation

@ypopovych
Copy link
Contributor

Updated project to support all of the deployment targets supported by Xcode 16.

Had to move example to own swift package, because it can't be built for old targets.

Resolves #23

@naftaly
Copy link
Contributor

naftaly commented Oct 23, 2025

You should be able to use @available and #available instead of moving things to another package.

For the methods that use concurrency things that ar not available yet.

@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)

And the tests:

if #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
    // code...
}

@ypopovych
Copy link
Contributor Author

@naftaly updated. Example is also protected by available checks

.macOS(.v10_13),
.iOS(.v12),
.tvOS(.v12),
.watchOS(.v4),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.watchOS(.v4),
.watchOS(.v6),

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked Xcode 16 support and it supports watchOS 4+. And seems as everything builds fine for watchOS 4. Do we want to support 6+ only?

Copy link
Contributor

@naftaly naftaly Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's just what was in the proposal we all agreed upon. I think we should stick to the proposal unless there's a reason to diverge.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simply checked what Xcode really supports. And seems as if we don't have any dependencies on watchOS 6. I can change to 6 if needed


let tracer = OpenTelemetry.instance.tracerProvider.get(instrumentationName: "ConcurrencyContext", instrumentationVersion: "semver:0.1.0")

@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should you move this function into #available?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an extension. It can be only on the top level in the file, so I had to move it outside and add @available to it

@naftaly
Copy link
Contributor

naftaly commented Oct 23, 2025

This looks great, thanks @ypopovych .

Do you think the added public is still needed where you added it?
It's worth checking to make sure this doesn't break anything in the opentelemetry-swift repo since it depends on this,

@ypopovych
Copy link
Contributor Author

TaskLocalContextManager is public. I think both of them should be public. I will test the main repo

@ypopovych
Copy link
Contributor Author

Tested in the opentelemetry-swift and some example app for watchOS 4 - works fine in iOS 12 and watchOS 4, main repo also builds fine (but needs Xcode 16.3+, grpc bumped swift version to 6.1).

Copy link
Member

@ArielDemarco ArielDemarco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ypopovych ! Thanks for the PR! I've been testing it out and everything seems to be working just fine.
Would you be able to update the .podspec files as well? That way, we stay consistent in the platforms and versions we support across the different package managers

@ypopovych
Copy link
Contributor Author

Would you be able to update the .podspec files as well?

Done. Also added macOS deployment target to them, it was missing

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

Successfully merging this pull request may close these issues.

Adjust platform deployment targets to match Xcode 16 (happy to help 🙌)

3 participants