Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
hyp committed Aug 2, 2024
2 parents da2e4f8 + 61ad739 commit b0c3d70
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 7 deletions.
40 changes: 33 additions & 7 deletions .github/workflows/swift-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1675,8 +1675,8 @@ jobs:
- uses: actions/checkout@v4
if: matrix.os == 'Android'
with:
repository: apple/swift-corelibs-foundation
ref: a515f3e15c81d029411c540df7edf52d427ff2cb
repository: hyp/swift-corelibs-foundation
ref: 6bf677693eb23030eb3646c9b121c665f40aa8b0
path: ${{ github.workspace }}/SourceCache/swift-corelibs-foundation
show-progress: false
- uses: actions/checkout@v4
Expand Down Expand Up @@ -2749,10 +2749,6 @@ jobs:
with:
name: devtools-amd64
path: ${{ github.workspace }}/BuildRoot/Library
- uses: actions/download-artifact@v4
with:
name: Windows-sdk-amd64
path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform
- name: Download SDK
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -2801,6 +2797,36 @@ jobs:
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationEssentials.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationInternationalization.lib ${env:SDKROOT}/usr/lib/swift/windows/${{ matrix.cpu }}/
# Download host SDK on top of the target SDK, so that the runtime DLLs are the host ones.
- uses: actions/download-artifact@v4
with:
name: Windows-sdk-amd64
path: ${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/Windows.platform

- name: Move host libs to the host architecture directory
if: matrix.arch == 'arm64'
run: |
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/BlocksRuntime.lib ${env:SDKROOT}/usr/lib/swift/windows/x86_64/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/dispatch.lib ${env:SDKROOT}/usr/lib/swift/windows/x86_64/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/swiftDispatch.lib ${env:SDKROOT}/usr/lib/swift/windows/x86_64/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/Foundation.lib ${env:SDKROOT}/usr/lib/swift/windows/x86_64/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationXML.lib ${env:SDKROOT}/usr/lib/swift/windows/x86_64/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationNetworking.lib ${env:SDKROOT}/usr/lib/swift/windows/x86_64/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/_FoundationICU.lib ${env:SDKROOT}/usr/lib/swift/windows/x86_64/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationEssentials.lib ${env:SDKROOT}/usr/lib/swift/windows/x86_64/
Move-Item ${env:SDKROOT}/usr/lib/swift/windows/FoundationInternationalization.lib ${env:SDKROOT}/usr/lib/swift/windows/x86_64/
- name: Move host runtime DLLs to the runtime binary directory.
run: |
Remove-Item -Path ${env:SDKROOT}/usr/lib/swift/dispatch -Recurse -Force
Remove-Item -Path ${env:SDKROOT}/usr/lib/swift/os -Recurse -Force
Remove-Item -Path ${env:SDKROOT}/usr/lib/swift/Block -Recurse -Force
Remove-Item -Path ${env:SDKROOT}/usr/lib/swift/_foundation_unicode -Recurse -Force
Remove-Item -Path ${env:SDKROOT}/usr/lib/swift/_FoundationCShims -Recurse -Force
$RTLPath = cygpath -w "${{ github.workspace }}/BinaryCache/Developer/SDKs/Windows.sdk/usr/bin"
mkdir $RTLPath
Get-ChildItem -Path ${env:SDKROOT}/usr/bin -Filter "*.dll" | Move-Item -Destination $RTLPath
- name: Checkout apple/swift
uses: actions/checkout@v4
Expand Down Expand Up @@ -3116,7 +3142,7 @@ jobs:
- uses: actions/checkout@v4
with:
repository: apple/swift-installer-scripts
ref: e1adc0d5dde137fa5941316e89a3ed139a273dde
ref: 633843b00fc8024dd86674fe43373ae4fd0f2229
path: ${{ github.workspace }}/SourceCache/swift-installer-scripts
show-progress: false

Expand Down
13 changes: 13 additions & 0 deletions docs/WindowsQuickStart.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,19 @@ that support testing are built:
S:\SourceCache\swift\utils\build.cmd -DebugInfo -SkipPackaging -Test '*'
```

### Speeding up the build with sccache

The `-EnableCaching` flag can be used to speed up the build. The
requirement is that `sccache` is installed and available on the shell
path. Sccache is available from
[here](https://github.com/mozilla/sccache/releases). Note that it will
help speed up the build of the C/C++ code but not the Swift code as
`sccache` doesn't currently support Swift.

```
S:\SourceCache\swift\utils\build.cmd -EnableCaching
```

## Using the Toolchain

### Environment Setup
Expand Down

0 comments on commit b0c3d70

Please sign in to comment.