Skip to content

Conversation

@IgorMuzyka
Copy link

Added package Trait ContemporaryMacOS which acts as marker for propagating @available(macOS 15, *) allowing to evade bumping package version to macOS 15 and instead supplying this Trait when depending on Subprocess package and hiding things which cascade the Atomic & AsyncSequence<Result, Failure> requirement for macOS 15.

@iCharlesHu let me know what you think about this.

…agating `@available(macOS 15, *)` allowing to evade bumping package version to macOS 15 and instead supplying this Trait when depending on Subprocess package and hiding things which cascade the `Atomic` & `AsyncSequence<Result, Failure>` requirement for macOS 15
@IgorMuzyka IgorMuzyka requested a review from iCharlesHu as a code owner April 18, 2025 20:04
@IgorMuzyka
Copy link
Author

The bug in question.

Now if i specify package like this:
.package(url: "https://github.com/IgorMuzyka/Subprocess", branch: "charles/mutex-availability", traits: ["SubprocessFoundation", "ContemporaryMacOS"]),

while having my package platforms be .macOS(.v15) it builds without errors.

@IgorMuzyka
Copy link
Author

IgorMuzyka commented Apr 18, 2025

Essentially when you add this trait it just enables the following in places which cascade from those 2cases/3places i pointed out in the issue/pull-request in swiftlang repo:

#if ContemporaryMacOS
@available(macOS 15, *)
#endif

PS: this solution was done under the influence of one liter of 🍺.

@iCharlesHu iCharlesHu force-pushed the charles/mutex-availability branch from 8768b3d to e30b5c2 Compare April 22, 2025 01:00
@iCharlesHu
Copy link
Owner

Thanks for the PR! Unfortunately I don't think this approach will work because when ContemporaryMacOS and SubprocessSpan are both on you essentially get conflicting availabilities like

@available(macOS 15.0, *)
@available(macOS 14.0, *)
struct Execution { ... }

I updated swiftlang/swift-subprocess#16 it should now work correctly on ancient macOSs now.

@IgorMuzyka
Copy link
Author

My problem wasn't ancient macOS though, i have a package stating macOS(.v15) and it depends on Subprocess which states macOS(.v13).
And it was giving me this error about availability regardless that i clearly target higher.

Will check later if your changes also fix this for me.

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.

2 participants