Skip to content

🦾 Adopt swift-subprocess #128

@goergisn

Description

@goergisn

Background

Currently, our Shell module uses Foundation's Process API to execute command line commands. The Swift team has released swift-subprocess, a new cross-platform package for spawning processes with a more modern, Swift-native API.

Benefits of swift-subprocess

  • Async/await native - Built for Swift concurrency from the ground up
  • More Swifty API - Cleaner syntax compared to the imperative Process API
  • Cross-platform - Designed to work across macOS, Linux, and Windows (Right now we use Process essentially only to execute xcodebuild commands which are only available on macOS)
  • Maintained by Swift team - Part of the official swiftlang organization

Current blockers

  1. Requires Swift 6.1 - The package uses swift-tools-version: 6.1, while we currently target Swift 5.9
  2. Uses experimental features - Relies on StrictConcurrency, NonescapableTypes, LifetimeDependence, and Span
  3. iOS not supported - Platform requirement is set to .iOS("99.0") (effectively disabled), though this doesn't affect us since Shell only runs on macOS

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIndicates new feature requests

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions