Skip to content

fix: add missing await#1432

Closed
Brett-Best wants to merge 1 commit into
swiftlang:mainfrom
Brett-Best:fix/compilation
Closed

fix: add missing await#1432
Brett-Best wants to merge 1 commit into
swiftlang:mainfrom
Brett-Best:fix/compilation

Conversation

@Brett-Best

@Brett-Best Brett-Best commented May 27, 2026

Copy link
Copy Markdown

Fixes:

SwiftCompile normal arm64 /Users/brettbest/Developer/swift-build/Sources/SWBUtil/PbxCp.swift (in target 'SWBUtil' from project 'SwiftBuild')
    cd /Users/brettbest/Developer/swift-build/.swiftpm/xcode
    

/Users/brettbest/Developer/swift-build/Sources/SWBUtil/PbxCp.swift:571:19: error: expression is 'async' but is not marked with 'await'
        options = try CopyOptions.parse(argv)
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                      await 
/Users/brettbest/Developer/swift-build/Sources/SWBUtil/PbxCp.swift:571:23: note: call is 'async'
        options = try CopyOptions.parse(argv)

I believe this was caused by apple/swift-argument-parser@d6f4e7a and the dependency constraint for it is from: "1.0.3" meaning 1.8.0 satisfies this - hence it breaking.

If a lower version is checked out now a warning of: No 'async' operations occur within 'await' expression is generated.

I thought the below might work:

        #if canImport(ArgumentParser, _version: 1.8.0)
        options = try await CopyOptions.parse(argv)
        #else
        options = try CopyOptions.parse(argv)
        #endif

But I get: https://docs.swift.org/compiler/documentation/diagnostics/module-version-missing/

I thought I saw SwiftPM would set this but perhaps that hasn't shipped yet or I imagined it :D

Copilot AI review requested due to automatic review settings May 27, 2026 01:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates pbxcp to await asynchronous option parsing.

Changes:

  • Switch CopyOptions.parse(argv) call to try await CopyOptions.parse(argv) inside pbxcp.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Brett-Best

Copy link
Copy Markdown
Author

Closing in favour of #1428 which I missed when looking through the list before making this 🥲

@Brett-Best Brett-Best closed this May 27, 2026
@Brett-Best
Brett-Best deleted the fix/compilation branch May 27, 2026 02:58
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