Skip to content

Commit 04dda41

Browse files
authored
Add Experimental Differentiation build (#998)
1 parent d672759 commit 04dda41

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/swift-toolchain.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2704,6 +2704,69 @@ jobs:
27042704
run: |
27052705
cmake --build ${{ github.workspace }}/BinaryCache/ExperimentalObservation --target install
27062706
2707+
- name: Configure Experimental Differentiation
2708+
if: matrix.os != 'Android' || inputs.build_android
2709+
run: |
2710+
$CLANG = cygpath -m "${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/clang.exe"
2711+
$CLANGXX = cygpath -m "${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/clang++.exe"
2712+
$CLANG_CL = cygpath -m "${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/clang-cl.exe"
2713+
$SWIFTC = cygpath -m "${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/${{ inputs.swift_version }}+Asserts/usr/bin/swiftc.exe"
2714+
$SwiftFlags = "${{ matrix.swiftflags }}"
2715+
2716+
if ("${{ matrix.os }}" -eq "Android") {
2717+
# Used by matrix definitions.
2718+
$NDKPATH = cygpath -m ${{ steps.setup-ndk.outputs.ndk-path }}
2719+
}
2720+
2721+
if ("${{ matrix.os }}" -eq "Windows") {
2722+
$WINDOWS_VFS_OVERLAY = cygpath -m "${{ github.workspace }}/BinaryCache/swift/stdlib/windows-vfs-overlay.yaml"
2723+
$SwiftResourceDir = cygpath -m "${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk/usr/lib/swift"
2724+
$SwiftFlags += " -vfsoverlay ${WINDOWS_VFS_OVERLAY}"
2725+
$SwiftFlags += " -strict-implicit-module-context"
2726+
$SwiftFlags += " -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules"
2727+
$SwiftFlags += " -resource-dir $SwiftResourceDir"
2728+
$SwiftFlags += " -L $SwiftResourceDir/windows"
2729+
} elseif ("${{ matrix.os }}" -eq "Android") {
2730+
$SwiftResourceDir = cygpath -m "${{ github.workspace }}/BinaryCache/Library/Developer/Platforms/Android.platform/Developer/SDKs/Android.sdk/usr/lib/swift"
2731+
$SwiftFlags += " -sdk $NDKPATH/toolchains/llvm/prebuilt/windows-x86_64/sysroot"
2732+
$SwiftFlags += " -resource-dir $SwiftResourceDir"
2733+
$SwiftFlags += " -L $SwiftResourceDir/android"
2734+
}
2735+
2736+
cmake -B ${{ github.workspace }}/BinaryCache/ExperimentalDifferentiation `
2737+
-D CMAKE_BUILD_TYPE=Release `
2738+
-D CMAKE_C_COMPILER=${{ matrix.gnu-cc }} `
2739+
-D CMAKE_C_COMPILER_LAUNCHER=sccache `
2740+
-D CMAKE_C_COMPILER_TARGET=${{ matrix.triple }} `
2741+
-D CMAKE_C_FLAGS="${{ matrix.gnu-cflags }}" `
2742+
-D CMAKE_CXX_COMPILER=${{ matrix.gnu-cxx }} `
2743+
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
2744+
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
2745+
-D CMAKE_CXX_FLAGS="${{ matrix.gnu-cxxflags }}" `
2746+
-D CMAKE_Swift_COMPILER=${SWIFTC} `
2747+
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} `
2748+
-D CMAKE_Swift_FLAGS="${SwiftFlags}" `
2749+
-D CMAKE_Swift_COMPILER_WORKS=YES `
2750+
-D CMAKE_Swift_COMPILER_USE_OLD_DRIVER=YES `
2751+
-D BUILD_SHARED_LIBS=NO `
2752+
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/SDKs/${{ matrix.os }}Experimental.sdk/usr `
2753+
-D CMAKE_FIND_PACKAGE_PREFER_CONFIG=YES `
2754+
-D CMAKE_STATIC_LIBRARY_PREFIX_Swift="lib" `
2755+
${{ matrix.gnu-linker_flags }} `
2756+
${{ matrix.extra_flags }} `
2757+
-G Ninja `
2758+
-S ${{ github.workspace }}/SourceCache/swift/Runtimes/Supplemental/Differentiation `
2759+
-D SwiftCore_DIR=${{ github.workspace }}/BinaryCache/ExperimentalRuntime/cmake/SwiftCore `
2760+
-D SwiftOverlay_DIR=${{ github.workspace }}/BinaryCache/ExperimentalOverlay/cmake/SwiftOverlay
2761+
- name: Build Experimental Differentiation
2762+
if: matrix.os != 'Android' || inputs.build_android
2763+
run: |
2764+
cmake --build ${{ github.workspace }}/BinaryCache/ExperimentalDifferentiation
2765+
- name: Install Experimental Differentiation
2766+
if: matrix.os != 'Android' || inputs.build_android
2767+
run: |
2768+
cmake --build ${{ github.workspace }}/BinaryCache/ExperimentalDifferentiation --target install
2769+
27072770
- name: Configure Experimental Dispatch
27082771
if: matrix.os != 'Android' || inputs.build_android
27092772
run: |

0 commit comments

Comments
 (0)