apple / apple/swift-nio-ssh

Fix import guards in NIOSSHServer and audit sendability

Open
#208 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
515
Forks
85
PR merge metrics
No merged PRs in 30d

Description

The `NIOSSHServer` example guards all of its code with `#if canImport(Foundation.Process)` to avoid build failures on platforms without `Process`.

However, Swift doesn't have submodules like this, Objective-C does. As Foundation transitions to Swift this check now always fails, even if Process is available. The result of this is that example code doesn't compile with newer Swift versions. Removing the can-imports results in a handful of Sendability warnings.

Contributor guide

Open the contributing guide

Research direction

Start with the NIOSSHServer example and locate the code guarded by #if canImport(Foundation.Process). Build the example with a newer Swift version after removing the guards, then audit the reported Sendability warnings; done means the example compiles without those import-guard failures or unresolved warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.