apple / swift-openapi-generator

Generate Swift client and server code from an OpenAPI document.
https://swiftpackageindex.com/apple/swift-openapi-generator/documentation
Apache License 2.0
1.23k stars 89 forks source link

Make ExistentialAny feature enablement unconditional #119

Closed czechboy0 closed 6 months ago

czechboy0 commented 10 months ago

Enable the ExistentialAny feature on all the repos.

The work was already done in PRs like #99, however we found that on Swift 5.8 toolchains there's an issue where the enable flag seems to propagate to dependees, so we will first disable the enforcement, until we require 5.9: #75.

czechboy0 commented 10 months ago

The scope of this work is to add the requirement to Package.swift on all the 4 repos: runtime, generator, urlsession transport and ahc transport.

czechboy0 commented 10 months ago

More details on the issue: https://github.com/apple/swift-openapi-runtime/pull/26

And in https://github.com/apple/swift-openapi-runtime/pull/25#issuecomment-1635958854

czechboy0 commented 10 months ago

We only disabled it on 5.8, but kept it enabled on 5.9.

So this issue tracks removing the conditional logic once we require 5.9, and have it enabled unconditionally.

simonjbeaumont commented 10 months ago

Do we feel this issue has any residual value since we have CI for >= 5.9 which tests that we are using existential any in the whole codebase.

The only place we're not currently testing would be if we had code in an #if swift(<5.9) or similar, which we don't have.

Given we have #75, at some point we won't be using 5.8 at all, so I think this issue can probably be closed

czechboy0 commented 10 months ago

Let me rename it, I meant to have it track the cleanup of the conditional logic, and block it on 5.9 adoption. We have a few more tasks like this, blocked on 5.9 adoption.

simonjbeaumont commented 10 months ago

OK, I thought that's what you wanted this issue to be for. I just thought we could just roll this into a task when we make 5.9 the minimum version.

czechboy0 commented 10 months ago

Sure, we can change the process, just previously, e.g. in https://github.com/apple/swift-openapi-generator/issues/40, we left each issue separate, and linked them by mentioning + state/blocked. But I'm open to other ideas.

MahdiBM commented 10 months ago

however we found that on Swift 5.8 toolchains there's an issue where the enable flag seems to propagate to dependencies

For me personally, this doesn't cause any problems as long as the code itself is existential-any-compatible, which it is, but i'm curious to know what is the issue if it's filed anywhere 🤔

czechboy0 commented 10 months ago

however we found that on Swift 5.8 toolchains there's an issue where the enable flag seems to propagate to dependencies

For me personally, this doesn't cause any problems as long as the code itself is existential-any-compatible, which it is, but i'm curious to know what is the issue if it's filed anywhere 🤔

Well, it seems to have been fixed in 5.9 between 04-26 and 04-27, unfortunately it still seems to cause issues in 5.8, which is why we only enable it on 5.9.

czechboy0 commented 6 months ago

Landed in main, will be released in 1.0.0-alpha.1.