Skip to content

Commit ee36f4a

Browse files
authored
Update swift-corelibs.yml
Fix the build rules for the corelibs, build nearly a complete SDK. This is sufficient for getting test coverage for XCTest for the time being. This change requires swiftlang/swift-corelibs-xctest#332 to be merged for the tests to pass. dispatch_overcommit has long been flakey on the CI environments but does not flake on real hardware. The Foundation invalidBundlePath test is known to be currently broken after the last merge for Foundation.
1 parent 0c6035d commit ee36f4a

File tree

1 file changed

+116
-5
lines changed

1 file changed

+116
-5
lines changed

.github/workflows/swift-corelibs.yml

Lines changed: 116 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,23 @@ on:
1616
required: true
1717
default: 'refs/heads/main'
1818

19+
curl_revision:
20+
description: 'curl revision to build'
21+
required: true
22+
default: 'refs/tags/curl-7_77_0'
23+
libxml2_revision:
24+
description: 'libxml2 revision to build'
25+
required: true
26+
default: 'refs/tags/v2.9.12'
27+
llvm_revision:
28+
description: 'llvm revision to use'
29+
required: true
30+
default: 'refs/heads/main'
31+
zlib_revision:
32+
description: 'zlib revision to build'
33+
required: true
34+
default: 'refs/heads/master'
35+
1936
jobs:
2037
windows:
2138
runs-on: windows-latest
@@ -32,6 +49,30 @@ jobs:
3249
tag: ${{ matrix.tag }}
3350
branch: ${{ matrix.branch }}
3451

52+
- uses: actions/checkout@v2
53+
with:
54+
repository: curl/curl
55+
ref: ${{ github.event.inputs.curl_revision }}
56+
path: ${{ github.workspace }}/curl
57+
58+
- uses: actions/checkout@v2
59+
with:
60+
repository: gnome/libxml2
61+
ref: ${{ github.event.inputs.libxml2_revison }}
62+
path: ${{ github.workspace }}/libxml2
63+
64+
- uses: actions/checkout@v2
65+
with:
66+
repository: madler/zlib
67+
ref: ${{ github.event.inputs.zlib_revision }}
68+
path: ${{ github.workspace }}/zlib
69+
70+
- uses: actions/checkout@v2
71+
with:
72+
repository: llvm/llvm-project
73+
ref: ${{ github.event.inputs.llvm_revision }}
74+
path: llvm-project
75+
3576
- uses: actions/checkout@v2
3677
with:
3778
repository: apple/swift-corelibs-libdispatch
@@ -52,21 +93,91 @@ jobs:
5293

5394
- uses: seanmiddleditch/gha-setup-vsdevenv@master
5495

96+
# Remove the dispatch module definition as we will be building dispatch
97+
- name: dispatch removal
98+
run: |
99+
del %SDKROOT%\usr\include\dispatch\module.modulemap
100+
shell: cmd
101+
102+
# TODO(#378) homogenise the build trees
103+
# TODO(#379) build the stdlib
104+
55105
- name: build libdispatch
56106
run: |
57107
$SDK_ROOT = cygpath -m $env:SDKROOT
58-
cmake -B libdispatch -D CMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER=clang-cl -D CMAKE_CXX_COMPILER=clang-cl -D CMAKE_MT=mt -D CMAKE_Swift_FLAGS="-sdk $SDK_ROOT" -G Ninja -S ${{ github.workspace }}/swift-corelibs-libdispatch
108+
cmake -B libdispatch -D CMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER=clang-cl -D CMAKE_CXX_COMPILER=clang-cl -D CMAKE_MT=mt -D CMAKE_Swift_FLAGS="-sdk $SDK_ROOT" -G Ninja -S ${{ github.workspace }}/swift-corelibs-libdispatch -D BUILD_TESTING=NO -D ENABLE_SWIFT=YES
59109
cmake --build libdispatch --config Release
60110
61-
# TODO(compnerd) build and wire up dependencise (ICU, ZLIB, CURL, LIBXML2)
111+
# TODO(#380) build ICU
112+
- name: setup ICU
113+
run: |
114+
curl.exe -sOL "https://github.com/unicode-org/icu/releases/download/release-67-1/icu4c-67_1-Win64-MSVC2017.zip"
115+
md ${{ github.workspace }}\Library
116+
unzip.exe -o icu4c-67_1-Win64-MSVC2017.zip -d ${{ github.workspace }}\Library\icu-67.1
117+
shell: cmd
118+
119+
- name: build libxml2
120+
run: |
121+
cmake -B xml2 -D BUILD_SHARED_LIBS=NO -D CMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER=cl -D CMAKE_C_FLAGS="/GS- /Oy /Gw /Gy" -D CMAKE_MT=mt -D LIBXML2_WITH_ICONV=NO -D LIBXML2_WITH_ICU=NO -D LIBXML2_WITH_LZMA=NO -D LIBXML2_WITH_PYTHON=NO -D LIBXML2_WITH_TESTS=NO -D LIBXML2_WITH_THREADS=YES -D LIBXML2_WITH_ZLIB=NO -G Ninja -S ${{ github.workspace }}/libxml2 -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/Library/libxml2-2.9.12/usr
122+
cmake --build xml2 --config Release
123+
cmake --build xml2 --config Release --target install
124+
125+
- name: build zlib
126+
run: |
127+
cmake -B libz -D BUILD_SHARED_LIBS=NO -D CMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER=cl -D CMAKE_C_FLAGS="/GS- /Oy /Gw /Gy" -D CMAKE_MT=mt -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/Library/zlib-1.2.11/usr -D SKIP_INSTALL_FILES=YES -G Ninja -S ${{ github.workspace }}/zlib
128+
cmake --build libz --config Release
129+
cmake --build libz --config Release --target install
130+
131+
- name: build curl
132+
run: |
133+
cmake -B libcurl -D BUILD_SHARED_LIBS=NO -D BUILD_TESTING=NO -D CMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER=cl -D CMAKE_C_FLAGS="/GS- /Oy /Gw /Gy" -D CMAKE_MT=mt -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/Library/curl-7.77.0/usr -D BUILD_CURL_EXE=NO -D CMAKE_USE_OPENSSL=NO -D CURL_CA_PATH=none -D CMAKE_USE_SCHANNEL=YES -D CMAKE_USE_LIBSSH2=NO -D HAVE_POLL_FINE=NO -D CURL_DISABLE_LDAP=YES -D CURL_DISABLE_LDAPS=YES -D CURL_DISABLE_TELNET=YES -D CURL_DISABLE_DICT=YES -D CURL_DISABLE_FILE=YES -D CURL_DISABLE_TFTP=YES -D CURL_DISABLE_RTSP=YES -D CURL_DISABLE_PROXY=YES -D CURL_DISABLE_POP3=YES -D CURL_DISABLE_IMAP=YES -D CURL_DISABLE_SMTP=YES -D CURL_DISABLE_GOPHER=YES -D CURL_ZLIB=YES -D ENABLE_UNIX_SOCKETS=NO -D ENABLE_THREADED_RESOLVER=NO -D ZLIB_ROOT=${{ github.workspace }}/Library/zlib-1.2.11/usr -D ZLIB_LIBRARY=${{ github.workspace }}/Library/zlib-1.2.11/usr/lib/zlibstatic.lib -G Ninja -S ${{ github.workspace }}/curl
134+
cmake --build libcurl --config Release
135+
cmake --build libcurl --config Release --target install
136+
62137
- name: build Foundation
63138
run: |
64139
$SDK_ROOT = cygpath -m $env:SDKROOT
65-
cmake -B foundation -D CMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER=clang-cl -D CMAKE_CXX_COMPILER=clang-cl -D CMAKE_MT=mt -D CMAKE_Swift_FLAGS="-sdk $SDK_ROOT" -G Ninja -S ${{ github.workspace }}/swift-corelibs-foundation -D dispatch_DIR=${{ github.workspace }}/libdispatch/lib/cmake/modules
140+
cmake -B foundation -D CMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER=clang-cl -D CMAKE_MT=mt -D CMAKE_Swift_FLAGS="-sdk $SDK_ROOT" -G Ninja -S ${{ github.workspace }}/swift-corelibs-foundation -D dispatch_DIR=${{ github.workspace }}/libdispatch/cmake/modules -D ENABLE_TESTING=NO -D ICU_ROOT=${{ github.workspace }}/Library/icu-67.1 -D ICU_UC_LIBRARY=${{ github.workspace }}/Libary/icu-67.1/usr/lib64/icuuc67.lib -D ICU_I18N_LIBRARY=${{ github.workspace }}/Library/icu-67.1/usr/lib64/icuin67.lib -D LIBXML2_LIBRARY=${{ github.workspace }}/Library/libxml2-2.9.12/usr/lib/libxml2s.lib -D LIBXML2_INCLUDE_DIR=${{ github.workspace }}/Library/libxml2-2.9.12/usr/include/libxml2 -D LIBXML2_DEFINITIONS="/DLIBXML_STATIC" -D CURL_DIR=${{ github.workspace }}\Library\curl-7.77.0\usr\lib\cmake\CURL -D ZLIB_LIBRARY=${{ github.workspace }}\Library\zlib-1.2.11\usr\lib\zlibstatic.lib -D ZLIB_INCLUDE_DIR=${{ github.workspace }}\Library\zlib-1.2.11\usr\include
66141
cmake --build foundation --config Release
67142
68-
- name: build xctest
143+
- name: build XCTest
69144
run: |
70145
$SDK_ROOT = cygpath -m $env:SDKROOT
71-
cmake -B foundation -D CMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER=clang-cl -D CMAKE_CXX_COMPILER=clang-cl -D CMAKE_MT=mt -D CMAKE_Swift_FLAGS="-sdk $SDK_ROOT" -G Ninja -S ${{ github.workspace }}/swift-corelibs-xctest -D Foundation_DIR=${{ github.workspace }}/foundation/lib/cmake/modules -D dispatch_DIR=${{ github.workspace }}/dispatch/lib/cmake/modules
146+
cmake -B xctest -D CMAKE_BUILD_TYPE=Release -D CMAKE_Swift_FLAGS="-sdk $SDK_ROOT" -G Ninja -S ${{ github.workspace }}/swift-corelibs-xctest -D Foundation_DIR=${{ github.workspace }}/foundation/cmake/modules -D dispatch_DIR=${{ github.workspace }}/libdispatch/cmake/modules -D ENABLE_TESTING=NO
147+
cmake --build xctest --config Release
148+
149+
- name: configure runner
150+
run: |
151+
echo "${{ github.workspace }}\Library\icu-67.1\usr\bin;$env:Path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
152+
echo "${{ github.workspace }}\libdispatch;${{ github.workspace }}\foundation\Foundation;${{ github.workspace }}\xctest;$env:Path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
153+
echo "CTEST_OUTPUT_ON_FAILURE=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
154+
shell: pwsh
155+
156+
- name: Test libdispatch
157+
run: |
158+
$SDK_ROOT = cygpath -m $env:SDKROOT
159+
cmake -B libdispatch -D CMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER=clang-cl -D CMAKE_CXX_COMPILER=clang-cl -D CMAKE_MT=mt -D CMAKE_Swift_FLAGS="-sdk $SDK_ROOT" -G Ninja -S ${{ github.workspace }}/swift-corelibs-libdispatch -D BUILD_TESTING=YES -D ENABLE_SWIFT=YES
160+
cmake --build libdispatch --config Release
161+
cmake --build libdispatch --config Release --target ExperimentalTest
162+
continue-on-error: true
163+
164+
- name: configure runner
165+
run: |
166+
echo "CTEST_PARALLEL_LEVEL=4" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
167+
shell: pwsh
168+
169+
- name: Test Foundation
170+
run: |
171+
$SDK_ROOT = cygpath -m $env:SDKROOT
172+
cmake -B foundation -D CMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER=clang-cl -D CMAKE_MT=mt -D CMAKE_Swift_FLAGS="-sdk $SDK_ROOT" -G Ninja -S ${{ github.workspace }}/swift-corelibs-foundation -D dispatch_DIR=${{ github.workspace }}/libdispatch/cmake/modules -D XCTest_DIR=${{ github.workspace }}/xctest/cmake/modules -D ENABLE_TESTING=YES -D ICU_ROOT=${{ github.workspace }}/Library/icu-67.1 -D ICU_UC_LIBRARY=${{ github.workspace }}/Libary/icu-67.1/usr/lib64/icuuc67.lib -D ICU_I18N_LIBRARY=${{ github.workspace }}/Library/icu-67.1/usr/lib64/icuin67.lib -D LIBXML2_LIBRARY=${{ github.workspace }}/Library/libxml2-2.9.12/usr/lib/libxml2s.lib -D LIBXML2_INCLUDE_DIR=${{ github.workspace }}/Library/libxml2-2.9.12/usr/include/libxml2 -D LIBXML2_DEFINITIONS="/DLIBXML_STATIC" -D CURL_DIR=${{ github.workspace }}\Library\curl-7.77.0\usr\lib\cmake\CURL -D ZLIB_LIBRARY=${{ github.workspace }}\Library\zlib-1.2.11\usr\lib\zlibstatic.lib -D ZLIB_INCLUDE_DIR=${{ github.workspace }}\Library\zlib-1.2.11\usr\include
72173
cmake --build foundation --config Release
174+
cmake --build foundation --config Release --target test
175+
continue-on-error: true
176+
177+
- name: Test XCTest
178+
run: |
179+
$SDK_ROOT = cygpath -m $env:SDKROOT
180+
cmake -B xctest -D CMAKE_BUILD_TYPE=Release -D CMAKE_Swift_FLAGS="-sdk $SDK_ROOT" -G Ninja -S ${{ github.workspace }}/swift-corelibs-xctest -D Foundation_DIR=${{ github.workspace }}/foundation/cmake/modules -D dispatch_DIR=${{ github.workspace }}/libdispatch/cmake/modules -D LLVM_MAIN_SRC_DIR=${{ github.workspace }}/llvm-project/llvm -D ENABLE_TESTING=YES -D XCTEST_PATH_TO_LIBDISPATCH_BUILD=${{ github.workspace }}\libdispatch -D XCTEST_PATH_TO_LIBDISPATCH_SOURCE=${{ github.workspace }}\swift-corelibs-libdispatch -D XCTEST_PATH_TO_FOUNDATION_BUILD=${{ github.workspace }}\foundation
181+
cmake --build xctest --config Release
182+
cmake --build xctest --config Release --target check-xctest
183+
continue-on-error: true

0 commit comments

Comments
 (0)