Skip to content

Conversation

@weissi
Copy link
Contributor

@weissi weissi commented Jul 19, 2023

AsyncProcess is an early stage module that aims to make Foundation.Process feel Swift Concurrency native.

@weissi weissi requested a review from MaxDesiatov as a code owner July 19, 2023 14:23
Copy link
Contributor

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

This is great, thank you so much!

@MaxDesiatov MaxDesiatov merged commit 6d07049 into swiftlang:main Jul 19, 2023
@MaxDesiatov MaxDesiatov deleted the jw-async-process branch July 19, 2023 14:53
euanh added a commit to euanh/swift-sdk-generator that referenced this pull request Nov 28, 2024
…TargetSwift

copyTargetSwiftFromDocker() already copies all the same files as copyTargetSwift,
and puts them in the destination directory.   Calling copyTargetSwift() at the
end just results in several pointless rsync calls which syncing directories to
themselves.

Stopping in copyTargetSwift() shows that the source and destination arguments
point to the same place:

    Process 77272 stopped
    * thread swiftlang#2, queue = 'com.apple.root.default-qos.cooperative', stop reason = breakpoint 1.1
        frame #0: ... at SwiftSDKGenerator+Copy.swift:105:8
       102      }
       103    }
       104
    -> 105    func copyTargetSwift(from distributionPath: FilePath, sdkDirPath: FilePath) async throws {
       106      logGenerationStep("Copying Swift core libraries for the target triple into Swift SDK bundle...")
       107
       108      for (pathWithinPackage, pathWithinSwiftSDK) in [
    Target 0: (swift-sdk-generator) stopped.
    (lldb) print distributionPath.string
    (String) ".../ubuntu-jammy.sdk/usr"
    (lldb) print sdkDirPath.string
    (String) ".../ubuntu-jammy.sdk"

The first rsync command line is then:

    rsync -a .../ubuntu-jammy.sdk/usr/lib/swift .../ubuntu-jammy.sdk/usr/lib

Removing the call to copyTargetSwift() does not save much time because rsync
does not do much work, however disentangling the Ubuntu-based SDK build from
the container-based build makes it easier to refactor both of them independently.

Diffing SDKs built before and after this change shows them to be identical.
The EndToEndTests (which currently can't be run by CI) continue to pass locally.
euanh added a commit that referenced this pull request Nov 28, 2024
…TargetSwift (#160)

copyTargetSwiftFromDocker() already copies all the same files as copyTargetSwift,
and puts them in the destination directory.   Calling copyTargetSwift() at the
end just results in several pointless rsync calls which sync the directories to
themselves.

Stopping in copyTargetSwift() shows that the source and destination arguments
point to the same place:

    Process 77272 stopped
    * thread #2, queue = 'com.apple.root.default-qos.cooperative', stop reason = breakpoint 1.1
        frame #0: ... at SwiftSDKGenerator+Copy.swift:105:8
       102      }
       103    }
       104
    -> 105    func copyTargetSwift(from distributionPath: FilePath, sdkDirPath: FilePath) async throws {
       106      logGenerationStep("Copying Swift core libraries for the target triple into Swift SDK bundle...")
       107
       108      for (pathWithinPackage, pathWithinSwiftSDK) in [
    Target 0: (swift-sdk-generator) stopped.
    (lldb) print distributionPath.string
    (String) ".../ubuntu-jammy.sdk/usr"
    (lldb) print sdkDirPath.string
    (String) ".../ubuntu-jammy.sdk"

The first rsync command line is then:

    rsync -a .../ubuntu-jammy.sdk/usr/lib/swift .../ubuntu-jammy.sdk/usr/lib

Removing the call to copyTargetSwift() does not save much time because rsync
does not do much work, however disentangling the Ubuntu-based SDK build from
the container-based build makes it easier to refactor both of them independently.

Diffing SDKs built before and after this change shows them to be identical.
The EndToEndTests (which currently can't be run by CI) continue to pass locally.
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