windows.yml 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816
  1. # Copyright (C) Viktor Szakats
  2. #
  3. # SPDX-License-Identifier: curl
  4. name: Windows
  5. 'on':
  6. push:
  7. branches:
  8. - master
  9. - '*/ci'
  10. paths-ignore:
  11. - '**/*.md'
  12. - '.circleci/**'
  13. - 'appveyor.*'
  14. - 'packages/**'
  15. - 'plan9/**'
  16. - 'projects/**'
  17. - 'winbuild/**'
  18. pull_request:
  19. branches:
  20. - master
  21. paths-ignore:
  22. - '**/*.md'
  23. - '.circleci/**'
  24. - 'appveyor.*'
  25. - 'packages/**'
  26. - 'plan9/**'
  27. - 'projects/**'
  28. - 'winbuild/**'
  29. concurrency:
  30. group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
  31. cancel-in-progress: true
  32. permissions: {}
  33. jobs:
  34. cygwin:
  35. name: "cygwin, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.platform }} ${{ matrix.name }}"
  36. runs-on: windows-latest
  37. timeout-minutes: 45
  38. defaults:
  39. run:
  40. shell: C:\cygwin\bin\bash.exe '{0}'
  41. env:
  42. SHELLOPTS: 'igncr'
  43. strategy:
  44. matrix:
  45. include:
  46. - { build: 'automake', platform: 'x86_64', tflags: 'skiprun', config: '', name: 'openssl R' }
  47. - { build: 'cmake' , platform: 'x86_64', tflags: '' , config: '-DENABLE_DEBUG=ON -DCURL_USE_OPENSSL=ON -DENABLE_THREADED_RESOLVER=OFF', name: 'openssl' }
  48. fail-fast: false
  49. steps:
  50. - run: git config --global core.autocrlf input
  51. shell: pwsh
  52. - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4
  53. - uses: cygwin/cygwin-install-action@006ad0b0946ca6d0a3ea2d4437677fa767392401 # v4
  54. with:
  55. platform: ${{ matrix.platform }}
  56. site: https://mirrors.kernel.org/sourceware/cygwin/
  57. # https://cygwin.com/cgi-bin2/package-grep.cgi
  58. packages: >-
  59. autoconf libtool gcc-core gcc-g++ binutils
  60. ${{ matrix.build }} make ninja
  61. openssh
  62. libssl-devel
  63. libssh2-devel
  64. libpsl-devel
  65. zlib-devel
  66. libbrotli-devel
  67. libnghttp2-devel
  68. - name: 'autotools autoreconf'
  69. if: ${{ matrix.build == 'automake' }}
  70. timeout-minutes: 2
  71. run: autoreconf -fi
  72. - name: 'autotools configure'
  73. if: ${{ matrix.build == 'automake' }}
  74. timeout-minutes: 5
  75. run: |
  76. PATH="/usr/bin:$(cygpath "${SYSTEMROOT}")/System32"
  77. mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
  78. --prefix="${HOME}"/install \
  79. --with-openssl \
  80. --with-libssh2 \
  81. --disable-dependency-tracking \
  82. ${{ matrix.config }}
  83. - name: 'autotools configure log'
  84. if: ${{ matrix.build == 'automake' && !cancelled() }}
  85. run: cat bld/config.log 2>/dev/null || true
  86. - name: 'curl_config.h'
  87. if: ${{ matrix.build == 'automake' }}
  88. run: cat bld/lib/curl_config.h | grep -F '#define' | sort || true
  89. - name: 'curl_config.h (full)'
  90. if: ${{ matrix.build == 'automake' }}
  91. run: cat bld/lib/curl_config.h || true
  92. - name: 'autotools build'
  93. if: ${{ matrix.build == 'automake' }}
  94. timeout-minutes: 10
  95. run: make -C bld -j5 V=1 install
  96. - name: 'curl version'
  97. if: ${{ matrix.build == 'automake' }}
  98. timeout-minutes: 1
  99. run: |
  100. find . -name '*.exe' -o -name '*.dll'
  101. bld/src/curl.exe --disable --version
  102. - name: 'autotools build tests'
  103. if: ${{ matrix.build == 'automake' && matrix.tflags != 'skipall' }}
  104. timeout-minutes: 15
  105. run: make -C bld -j5 V=1 -C tests
  106. - name: 'autotools run tests'
  107. if: ${{ matrix.build == 'automake' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
  108. timeout-minutes: 15
  109. run: |
  110. export TFLAGS='-j20 ${{ matrix.tflags }} ~615'
  111. if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
  112. TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
  113. fi
  114. make -C bld -j5 V=1 test-ci
  115. - name: 'cmake configure'
  116. if: ${{ matrix.build == 'cmake' }}
  117. timeout-minutes: 5
  118. run: |
  119. PATH="/usr/bin:$(cygpath "${SYSTEMROOT}")/System32"
  120. cmake -B bld -G Ninja ${options} \
  121. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
  122. -DCURL_WERROR=ON \
  123. -DCURL_BROTLI=ON \
  124. ${{ matrix.config }}
  125. - name: 'cmake configure log'
  126. if: ${{ matrix.build == 'cmake' && !cancelled() }}
  127. run: cat bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
  128. - name: 'curl_config.h'
  129. if: ${{ matrix.build == 'cmake' }}
  130. run: cat bld/lib/curl_config.h | grep -F '#define' | sort || true
  131. - name: 'curl_config.h (full)'
  132. if: ${{ matrix.build == 'cmake' }}
  133. run: cat bld/lib/curl_config.h || true
  134. - name: 'cmake build'
  135. if: ${{ matrix.build == 'cmake' }}
  136. timeout-minutes: 10
  137. run: cmake --build bld --config '${{ matrix.type }}' --parallel 5
  138. - name: 'curl version'
  139. if: ${{ matrix.build == 'cmake' }}
  140. timeout-minutes: 1
  141. run: |
  142. find . -name '*.exe' -o -name '*.dll'
  143. PATH="$PWD/bld/lib:$PATH"
  144. bld/src/curl.exe --disable --version
  145. - name: 'cmake build tests'
  146. if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skipall' }}
  147. timeout-minutes: 15
  148. run: cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target testdeps
  149. - name: 'cmake run tests'
  150. if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
  151. timeout-minutes: 15
  152. run: |
  153. export TFLAGS='-j8 ${{ matrix.tflags }} ~615'
  154. if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
  155. TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
  156. fi
  157. PATH="$PWD/bld/lib:$PATH"
  158. cmake --build bld --config '${{ matrix.type }}' --target test-ci
  159. - name: 'cmake build examples'
  160. if: ${{ matrix.build == 'cmake' }}
  161. timeout-minutes: 5
  162. run: cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target curl-examples
  163. msys2: # both msys and mingw-w64
  164. name: "${{ matrix.sys == 'msys' && 'msys2' || 'mingw' }}, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.env }} ${{ matrix.name }} ${{ matrix.test }}"
  165. runs-on: windows-latest
  166. timeout-minutes: 30
  167. defaults:
  168. run:
  169. shell: msys2 {0}
  170. strategy:
  171. matrix:
  172. include:
  173. - { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: '!19 !1233', config: '--enable-debug --disable-threaded-resolver --disable-proxy', name: '!proxy' }
  174. - { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: 'skiprun' , config: '--enable-debug --disable-threaded-resolver', name: 'default' }
  175. - { build: 'cmake' , sys: 'msys' , env: 'x86_64' , tflags: '!19 !504 !704 !705 !1233', config: '-DENABLE_DEBUG=ON -DENABLE_THREADED_RESOLVER=OFF', name: 'default' }
  176. - { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: '!19 !504 !704 !705 !1233', config: '', name: 'default R' }
  177. - { build: 'autotools', sys: 'mingw64', env: 'x86_64' , tflags: 'skiprun' , config: '--enable-debug --disable-threaded-resolver --disable-curldebug --enable-static=no --without-zlib', name: 'default' }
  178. - { build: 'autotools', sys: 'mingw64', env: 'x86_64' , tflags: '~472 ~1299 ~1613' , config: '--enable-debug --enable-windows-unicode --enable-ares', name: 'c-ares U' }
  179. # FIXME: WebSockets test results ignored due to frequent failures on native Windows:
  180. - { build: 'cmake' , sys: 'mingw64', env: 'x86_64' , tflags: '~2301 ~2302' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DENABLE_ARES=ON', type: 'Debug', name: 'schannel c-ares U' }
  181. - { build: 'cmake' , sys: 'ucrt64' , env: 'ucrt-x86_64' , tflags: 'skiprun' , config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DENABLE_CURLDEBUG=ON', type: 'Release', name: 'schannel R TrackMemory' }
  182. - { build: 'cmake' , sys: 'clang64', env: 'clang-x86_64', tflags: 'skiprun' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_OPENSSL=ON -DENABLE_UNICODE=OFF', type: 'Release', name: 'openssl' }
  183. - { build: 'cmake' , sys: 'mingw64', env: 'x86_64' , tflags: 'skiprun' , config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON', type: 'Release', test: 'uwp', name: 'schannel R' }
  184. - { build: 'cmake' , sys: 'mingw32', env: 'i686' , tflags: 'skiprun' , config: '-DENABLE_DEBUG=OFF -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON', type: 'Release', name: 'schannel R' }
  185. fail-fast: false
  186. steps:
  187. - run: git config --global core.autocrlf input
  188. shell: pwsh
  189. - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4
  190. - uses: msys2/setup-msys2@ddf331adaebd714795f1042345e6ca57bd66cea8 # v2
  191. if: ${{ matrix.sys == 'msys' }}
  192. with:
  193. msystem: ${{ matrix.sys }}
  194. # https://packages.msys2.org/search
  195. install: >-
  196. gcc
  197. ${{ matrix.build }} ${{ matrix.build == 'autotools' && 'make' || 'ninja' }}
  198. openssh
  199. openssl-devel
  200. zlib-devel
  201. brotli-devel
  202. libnghttp2-devel
  203. libpsl-devel
  204. libssh2-devel
  205. - uses: msys2/setup-msys2@ddf331adaebd714795f1042345e6ca57bd66cea8 # v2
  206. if: ${{ matrix.sys != 'msys' }}
  207. with:
  208. msystem: ${{ matrix.sys }}
  209. install: >-
  210. mingw-w64-${{ matrix.env }}-cc
  211. mingw-w64-${{ matrix.env }}-${{ matrix.build }} ${{ matrix.build == 'autotools' && 'make' || '' }}
  212. openssh
  213. mingw-w64-${{ matrix.env }}-openssl
  214. mingw-w64-${{ matrix.env }}-libssh2
  215. mingw-w64-${{ matrix.env }}-libpsl
  216. mingw-w64-${{ matrix.env }}-c-ares
  217. - name: 'autotools autoreconf'
  218. if: ${{ matrix.build == 'autotools' }}
  219. timeout-minutes: 2
  220. run: autoreconf -fi
  221. - name: 'autotools configure'
  222. if: ${{ matrix.build == 'autotools' }}
  223. timeout-minutes: 5
  224. run: |
  225. mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
  226. --prefix="${HOME}"/install \
  227. --with-openssl \
  228. --with-libssh2 \
  229. --disable-dependency-tracking \
  230. ${{ matrix.config }}
  231. - name: 'autotools configure log'
  232. if: ${{ matrix.build == 'autotools' && !cancelled() }}
  233. run: cat bld/config.log 2>/dev/null || true
  234. - name: 'curl_config.h'
  235. if: ${{ matrix.build == 'autotools' }}
  236. run: cat bld/lib/curl_config.h | grep -F '#define' | sort || true
  237. - name: 'curl_config.h (full)'
  238. if: ${{ matrix.build == 'autotools' }}
  239. run: cat bld/lib/curl_config.h || true
  240. - name: 'autotools build'
  241. if: ${{ matrix.build == 'autotools' }}
  242. timeout-minutes: 10
  243. run: make -C bld -j5 V=1 install
  244. - name: 'curl version'
  245. if: ${{ matrix.build == 'autotools' }}
  246. timeout-minutes: 1
  247. run: |
  248. find . -name '*.exe' -o -name '*.dll'
  249. bld/src/curl.exe --disable --version
  250. - name: 'autotools build tests'
  251. if: ${{ matrix.build == 'autotools' && matrix.tflags != 'skipall' }}
  252. timeout-minutes: 10
  253. run: make -C bld -j5 V=1 -C tests
  254. - name: 'install test tools'
  255. if: ${{ matrix.build == 'autotools' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
  256. timeout-minutes: 5
  257. run: |
  258. /c/ProgramData/chocolatey/choco.exe install --yes --no-progress --limit-output --timeout 180 --force stunnel || true
  259. curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 https://live.sysinternals.com/handle64.exe --output /bin/handle64.exe
  260. - name: 'autotools run tests'
  261. if: ${{ matrix.build == 'autotools' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
  262. timeout-minutes: 10
  263. run: |
  264. export TFLAGS='-j8 ${{ matrix.tflags }} ~SCP'
  265. if [ '${{ matrix.sys }}' != 'msys' ]; then
  266. TFLAGS+=' ~2301 ~2302' # WebSockets'
  267. TFLAGS+=' ~612 ~613 ~616 ~618' # SFTP
  268. else
  269. TFLAGS+=' ~SFTP'
  270. fi
  271. if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
  272. TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
  273. fi
  274. PATH="$PATH:/c/Program Files (x86)/stunnel/bin"
  275. make -C bld -j5 V=1 test-ci
  276. - name: 'autotools build examples'
  277. if: ${{ matrix.build == 'autotools' && (matrix.tflags == 'skipall' || matrix.tflags == 'skiprun') }}
  278. timeout-minutes: 5
  279. run: make -C bld -j5 V=1 examples
  280. - name: 'cmake configure'
  281. if: ${{ matrix.build == 'cmake' }}
  282. timeout-minutes: 5
  283. run: |
  284. if [[ '${{ matrix.env }}' = 'clang'* ]]; then
  285. options='-DCMAKE_C_COMPILER=clang'
  286. else
  287. options='-DCMAKE_C_COMPILER=gcc'
  288. fi
  289. if [ '${{ matrix.test }}' = 'uwp' ]; then
  290. options+=' -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0'
  291. pacman --noconfirm --ask 20 --noprogressbar --sync --needed 'mingw-w64-${{ matrix.env }}-winstorecompat-git'
  292. specs="$(realpath gcc-specs-uwp)"
  293. gcc -dumpspecs | sed -e 's/-lmingwex/-lwindowsapp -lmingwex -lwindowsapp -lwindowsappcompat/' -e 's/-lmsvcrt/-lmsvcr120_app/' > "${specs}"
  294. cflags="-specs=$(cygpath -w "${specs}") -DWINSTORECOMPAT -DWINAPI_FAMILY=WINAPI_FAMILY_APP"
  295. # CMake (as of v3.26.4) gets confused and applies the MSVC rc.exe command-line
  296. # template to windres. Reset it to the windres template manually:
  297. rcopts='<CMAKE_RC_COMPILER> -O coff <DEFINES> <INCLUDES> <FLAGS> <SOURCE> <OBJECT>'
  298. else
  299. rcopts=''
  300. fi
  301. [ '${{ matrix.type }}' = 'Debug' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG='
  302. [ '${{ matrix.type }}' = 'Release' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE='
  303. cmake -B bld -G Ninja ${options} \
  304. "-DCMAKE_C_FLAGS=${cflags}" \
  305. "-DCMAKE_RC_COMPILE_OBJECT=${rcopts}" \
  306. '-DCMAKE_BUILD_TYPE=${{ matrix.type }}' \
  307. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
  308. -DCURL_WERROR=ON \
  309. -DCURL_BROTLI=ON \
  310. ${{ matrix.config }}
  311. - name: 'cmake configure log'
  312. if: ${{ matrix.build == 'cmake' && !cancelled() }}
  313. run: cat bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
  314. - name: 'curl_config.h'
  315. if: ${{ matrix.build == 'cmake' }}
  316. run: cat bld/lib/curl_config.h | grep -F '#define' | sort || true
  317. - name: 'curl_config.h (full)'
  318. if: ${{ matrix.build == 'cmake' }}
  319. run: cat bld/lib/curl_config.h || true
  320. - name: 'cmake build'
  321. if: ${{ matrix.build == 'cmake' }}
  322. timeout-minutes: 10
  323. run: cmake --build bld --config '${{ matrix.type }}' --parallel 5
  324. - name: 'curl version'
  325. if: ${{ matrix.build == 'cmake' }}
  326. timeout-minutes: 1
  327. run: |
  328. find . -name '*.exe' -o -name '*.dll'
  329. if [ '${{ matrix.test }}' != 'uwp' ]; then # UWP missing 'msvcr120_app.dll', fails with exit code 0xc0000135
  330. PATH="$PWD/bld/lib:$PATH"
  331. bld/src/curl.exe --disable --version
  332. fi
  333. - name: 'cmake build tests'
  334. if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skipall' }}
  335. timeout-minutes: 10
  336. run: cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target testdeps
  337. - name: 'install test tools'
  338. if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
  339. timeout-minutes: 5
  340. run: |
  341. /c/ProgramData/chocolatey/choco.exe install --yes --no-progress --limit-output --timeout 180 --force stunnel || true
  342. curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 https://live.sysinternals.com/handle64.exe --output /bin/handle64.exe
  343. - name: 'cmake run tests'
  344. if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
  345. timeout-minutes: 10
  346. run: |
  347. export TFLAGS='-j8 ${{ matrix.tflags }} ~SCP'
  348. if [ '${{ matrix.sys }}' != 'msys' ]; then
  349. TFLAGS+=' ~WebSockets'
  350. TFLAGS+=' ~612 ~613 ~616 ~618' # SFTP
  351. else
  352. TFLAGS+=' ~SFTP'
  353. fi
  354. if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
  355. TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
  356. fi
  357. PATH="$PWD/bld/lib:$PATH:/c/Program Files (x86)/stunnel/bin"
  358. cmake --build bld --config '${{ matrix.type }}' --target test-ci
  359. - name: 'cmake build examples'
  360. if: ${{ matrix.build == 'cmake' }}
  361. timeout-minutes: 5
  362. run: cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target curl-examples
  363. old-mingw-w64:
  364. name: 'old-mingw, CM ${{ matrix.env }} ${{ matrix.name }}'
  365. runs-on: windows-latest
  366. timeout-minutes: 30
  367. defaults:
  368. run:
  369. shell: C:\msys64\usr\bin\bash.exe {0}
  370. strategy:
  371. matrix:
  372. include:
  373. - name: 'schannel'
  374. env: '9.5.0-x86_64'
  375. dir: 'mingw64'
  376. url: 'https://github.com/brechtsanders/winlibs_mingw/releases/download/9.5.0-10.0.0-msvcrt-r1/winlibs-x86_64-posix-seh-gcc-9.5.0-mingw-w64msvcrt-10.0.0-r1.7z'
  377. config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=OFF'
  378. type: 'Release'
  379. tflags: '~2301 ~2302 ~3027'
  380. - name: 'schannel U'
  381. env: '7.3.0-x86_64'
  382. dir: 'mingw64'
  383. url: 'https://downloads.sourceforge.net/mingw-w64/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/7.3.0/threads-win32/seh/x86_64-7.3.0-release-win32-seh-rt_v5-rev0.7z'
  384. config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON'
  385. type: 'Release'
  386. tflags: '~2301 ~2302 ~3027 ~3023 ~3024 ~1451'
  387. - name: 'schannel !unity'
  388. env: '6.4.0-i686'
  389. dir: 'mingw32'
  390. url: 'https://downloads.sourceforge.net/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/6.4.0/threads-win32/dwarf/i686-6.4.0-release-win32-dwarf-rt_v5-rev0.7z'
  391. config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=OFF -DCMAKE_UNITY_BUILD=OFF'
  392. type: 'Debug'
  393. tflags: 'skiprun'
  394. fail-fast: false
  395. steps:
  396. - name: 'cache compiler (gcc ${{ matrix.env }})'
  397. uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
  398. id: cache-compiler
  399. with:
  400. path: ~\my-cache
  401. key: ${{ runner.os }}-mingw-w64-${{ matrix.env }}
  402. - name: 'install compiler (gcc ${{ matrix.env }})'
  403. if: ${{ steps.cache-compiler.outputs.cache-hit != 'true' }}
  404. timeout-minutes: 5
  405. run: |
  406. cd "${USERPROFILE}" || exit 1
  407. mkdir my-cache
  408. cd my-cache || exit 1
  409. curl --fail --silent --show-error --retry 3 --retry-connrefused --output pack.bin --location --proto-redir =https '${{ matrix.url }}'
  410. pwd
  411. 7z x -y pack.bin >/dev/null
  412. rm -r -f pack.bin
  413. ls -l
  414. - run: git config --global core.autocrlf input
  415. - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4
  416. - name: 'cmake configure'
  417. timeout-minutes: 5
  418. run: |
  419. PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH"
  420. [ '${{ matrix.type }}' = 'Debug' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG='
  421. [ '${{ matrix.type }}' = 'Release' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE='
  422. cmake -B bld -G 'MSYS Makefiles' ${options} \
  423. -DCMAKE_C_COMPILER=gcc \
  424. '-DCMAKE_BUILD_TYPE=${{ matrix.type }}' \
  425. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
  426. -DCURL_WERROR=ON \
  427. -DCURL_USE_LIBPSL=OFF \
  428. ${{ matrix.config }}
  429. - name: 'cmake configure log'
  430. if: ${{ !cancelled() }}
  431. run: cat bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
  432. - name: 'curl_config.h'
  433. run: cat bld/lib/curl_config.h | grep -F '#define' | sort || true
  434. - name: 'curl_config.h (full)'
  435. run: cat bld/lib/curl_config.h || true
  436. - name: 'cmake build'
  437. timeout-minutes: 5
  438. run: |
  439. PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH"
  440. cmake --build bld --config '${{ matrix.type }}' --parallel 5
  441. - name: 'curl version'
  442. timeout-minutes: 1
  443. run: |
  444. PATH=/usr/bin find . -name '*.exe' -o -name '*.dll'
  445. PATH="$PWD/bld/lib:$PATH"
  446. bld/src/curl.exe --disable --version
  447. - name: 'cmake build tests'
  448. if: ${{ matrix.tflags != 'skipall' }}
  449. timeout-minutes: 10
  450. run: |
  451. PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH"
  452. cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target testdeps
  453. - name: 'install test tools'
  454. if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
  455. timeout-minutes: 5
  456. run: |
  457. /c/ProgramData/chocolatey/choco.exe install --yes --no-progress --limit-output --timeout 180 --force stunnel || true
  458. curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 https://live.sysinternals.com/handle64.exe --output /bin/handle64.exe
  459. python3 -m pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary impacket
  460. - name: 'cmake run tests'
  461. if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
  462. timeout-minutes: 10
  463. run: |
  464. PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH"
  465. export TFLAGS='-j4 ~WebSockets ${{ matrix.tflags }}'
  466. if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
  467. TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
  468. fi
  469. PATH="$PWD/bld/lib:$PATH:/c/Program Files (x86)/stunnel/bin"
  470. cmake --build bld --config '${{ matrix.type }}' --target test-ci
  471. - name: 'cmake build examples'
  472. timeout-minutes: 5
  473. run: |
  474. PATH="$(cygpath "${USERPROFILE}")/my-cache/${{ matrix.dir }}/bin:/c/msys64/usr/bin:$PATH"
  475. cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target curl-examples
  476. linux-cross-mingw-w64:
  477. name: "linux-mingw, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }}"
  478. runs-on: ubuntu-latest
  479. timeout-minutes: 15
  480. strategy:
  481. fail-fast: false
  482. matrix:
  483. build: [autotools, cmake]
  484. compiler: [gcc]
  485. env:
  486. TRIPLET: 'x86_64-w64-mingw32'
  487. steps:
  488. - name: 'install packages'
  489. run: sudo apt-get --quiet 2 --option Dpkg::Use-Pty=0 install mingw-w64 ${{ matrix.build == 'cmake' && 'ninja-build' || '' }}
  490. - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4
  491. - name: 'autotools autoreconf'
  492. if: ${{ matrix.build == 'autotools' }}
  493. run: autoreconf -fi
  494. - name: 'autotools configure'
  495. if: ${{ matrix.build == 'autotools' }}
  496. run: |
  497. mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
  498. --host=${TRIPLET} \
  499. --with-schannel --with-winidn \
  500. --without-libpsl \
  501. --disable-dependency-tracking
  502. - name: 'autotools configure log'
  503. if: ${{ matrix.build == 'autotools' && !cancelled() }}
  504. run: cat bld/config.log 2>/dev/null || true
  505. - name: 'autotools build'
  506. if: ${{ matrix.build == 'autotools' }}
  507. run: make -C bld -j5
  508. - name: 'autotools build examples'
  509. if: ${{ matrix.build == 'autotools' }}
  510. run: make -C bld -j5 examples
  511. - name: 'cmake configure'
  512. if: ${{ matrix.build == 'cmake' }}
  513. run: |
  514. cmake -B bld -G Ninja \
  515. -DCMAKE_SYSTEM_NAME=Windows \
  516. -DCMAKE_C_COMPILER_TARGET=${TRIPLET} \
  517. -DCMAKE_C_COMPILER=${TRIPLET}-gcc \
  518. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
  519. -DCURL_WERROR=ON \
  520. -DCURL_USE_SCHANNEL=ON -DUSE_WIN32_IDN=ON \
  521. -DCURL_USE_LIBPSL=OFF
  522. - name: 'cmake configure log'
  523. if: ${{ matrix.build == 'cmake' && !cancelled() }}
  524. run: cat bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
  525. - name: 'cmake build'
  526. if: ${{ matrix.build == 'cmake' }}
  527. run: cmake --build bld --parallel 5
  528. - name: 'cmake build tests'
  529. if: ${{ matrix.build == 'cmake' }}
  530. run: cmake --build bld --parallel 5 --target testdeps
  531. - name: 'cmake build examples'
  532. if: ${{ matrix.build == 'cmake' }}
  533. run: cmake --build bld --parallel 5 --target curl-examples
  534. msvc:
  535. name: 'msvc, CM ${{ matrix.arch }}-${{ matrix.plat }} ${{ matrix.name }}'
  536. runs-on: windows-latest
  537. timeout-minutes: 55
  538. defaults:
  539. run:
  540. shell: bash
  541. env:
  542. VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
  543. VCPKG_DISABLE_METRICS: '1'
  544. strategy:
  545. matrix:
  546. include:
  547. - name: 'schannel MultiSSL U'
  548. install: 'brotli zlib zstd libpsl nghttp2 libssh2[core,zlib] pkgconf gsasl openssl mbedtls shiftmedia-libgnutls'
  549. arch: 'x64'
  550. plat: 'windows'
  551. type: 'Debug'
  552. tflags: '~1516 ~2301 ~2302 ~2303 ~2307'
  553. config: >-
  554. -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=ON
  555. -DCURL_USE_SCHANNEL=ON -DCURL_USE_OPENSSL=ON -DCURL_USE_MBEDTLS=ON -DCURL_USE_GNUTLS=ON -DCURL_DEFAULT_SSL_BACKEND=schannel
  556. -DCURL_USE_GSASL=ON -DUSE_WIN32_IDN=ON -DENABLE_UNICODE=ON
  557. - name: 'openssl'
  558. install: 'brotli zlib zstd libpsl nghttp2 nghttp3 openssl libssh2 pkgconf gsasl c-ares libuv'
  559. arch: 'x64'
  560. plat: 'windows'
  561. type: 'Debug'
  562. tflags: '~1516 ~2301 ~2302 ~2303 ~2307'
  563. config: >-
  564. -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=ON
  565. -DCURL_USE_SCHANNEL=OFF -DCURL_USE_OPENSSL=ON -DUSE_OPENSSL_QUIC=ON
  566. -DCURL_USE_GSASL=ON -DENABLE_ARES=ON -DCURL_USE_LIBUV=ON
  567. - name: 'openssl'
  568. install: 'brotli zlib zstd nghttp2 nghttp3 openssl libssh2'
  569. arch: 'x64'
  570. plat: 'uwp'
  571. type: 'Debug'
  572. tflags: 'skiprun'
  573. config: >-
  574. -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=ON
  575. -DCURL_USE_SCHANNEL=OFF -DCURL_USE_OPENSSL=ON -DUSE_OPENSSL_QUIC=ON
  576. -DCURL_USE_LIBPSL=OFF
  577. - name: 'libressl'
  578. install: 'brotli zlib zstd libpsl nghttp2 libressl libssh2[core,zlib]'
  579. arch: 'x64'
  580. plat: 'windows'
  581. type: 'Debug'
  582. tflags: '~1516 ~2301 ~2302 ~2303 ~2307'
  583. config: >-
  584. -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=ON
  585. -DCURL_USE_SCHANNEL=OFF -DCURL_USE_OPENSSL=ON
  586. -DCURL_CA_SEARCH_SAFE=ON
  587. - name: 'boringssl-ECH'
  588. install: 'brotli zlib zstd libpsl nghttp2 boringssl libssh2[core,zlib]'
  589. arch: 'x64'
  590. plat: 'windows'
  591. type: 'Debug'
  592. tflags: '~1516 ~2301 ~2302 ~2303 ~2307'
  593. config: >-
  594. -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=ON
  595. -DCURL_USE_SCHANNEL=OFF -DCURL_USE_OPENSSL=ON
  596. -DUSE_HTTPSRR=ON -DUSE_ECH=ON
  597. - name: 'wolfssl'
  598. install: 'brotli zlib zstd libpsl nghttp2 wolfssl libssh2 pkgconf gsasl ngtcp2[wolfssl] nghttp3'
  599. arch: 'x64'
  600. plat: 'windows'
  601. type: 'Debug'
  602. tflags: '~1516'
  603. config: >-
  604. -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=ON
  605. -DCURL_USE_SCHANNEL=OFF -DCURL_USE_WOLFSSL=ON -DUSE_NGTCP2=ON
  606. -DCURL_USE_GSASL=ON
  607. - name: 'gnutls'
  608. install: 'brotli zlib zstd libpsl nghttp2 shiftmedia-libgnutls libssh pkgconf gsasl ngtcp2[gnutls] nghttp3'
  609. arch: 'x64'
  610. plat: 'windows'
  611. type: 'Debug'
  612. tflags: '~1516'
  613. # WARNING: libssh uses hard-coded world-writable paths (/etc/..., ~/.ssh/) to
  614. # read its configuration from, making it vulnerable to attacks on
  615. # Windows. Do not use this component till there is a fix for these.
  616. # https://github.com/curl/curl-for-win/blob/3951808deb04df9489ee17430f236ed54436f81a/libssh.sh#L6-L8
  617. config: >-
  618. -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON
  619. -DCURL_USE_SCHANNEL=OFF -DCURL_USE_GNUTLS=ON -DUSE_NGTCP2=ON
  620. -DCURL_USE_GSASL=ON
  621. - name: 'msh3'
  622. install: 'brotli zlib zstd libpsl nghttp2 msh3 libssh2 pkgconf gsasl'
  623. arch: 'x64'
  624. plat: 'windows'
  625. type: 'Debug'
  626. tflags: 'skipall'
  627. config: >-
  628. -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=ON
  629. -DCURL_USE_SCHANNEL=OFF -DUSE_MSH3=ON
  630. -DCURL_USE_GSASL=ON
  631. fail-fast: false
  632. steps:
  633. - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4
  634. - name: 'vcpkg cache setup'
  635. uses: actions/github-script@v7
  636. with:
  637. script: |
  638. core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
  639. core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
  640. - name: 'vcpkg versions'
  641. timeout-minutes: 1
  642. run: |
  643. git -C "$VCPKG_INSTALLATION_ROOT" show --no-patch --format='%H %ai'
  644. vcpkg version
  645. - name: 'vcpkg build'
  646. timeout-minutes: 35
  647. run: |
  648. # Temporary workaround pending: https://github.com/microsoft/vcpkg-tool/pull/1501
  649. export SystemDrive="$SYSTEMDRIVE"
  650. export SystemRoot="$SYSTEMROOT"
  651. export windir="$WINDIR"
  652. vcpkg x-set-installed ${{ matrix.install }} '--triplet=${{ matrix.arch }}-${{ matrix.plat }}'
  653. - name: 'cmake configure'
  654. timeout-minutes: 5
  655. run: |
  656. if [[ '${{ matrix.install }}' = *'libressl'* ]]; then
  657. # without this, CMake gets confused by the non-vcpkg OpenSSL
  658. # installed on the runner and fails when linking.
  659. options+=" -DOPENSSL_ROOT_DIR=$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.arch }}-${{ matrix.plat }}"
  660. fi
  661. cmake -B bld ${options} \
  662. "-DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \
  663. "-DVCPKG_INSTALLED_DIR=$VCPKG_INSTALLATION_ROOT/installed" \
  664. '-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-${{ matrix.plat }}' \
  665. -DCMAKE_VS_GLOBALS=TrackFileAccess=false \
  666. '-DCMAKE_BUILD_TYPE=${{ matrix.type }}' \
  667. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
  668. -DCURL_WERROR=ON \
  669. -DBUILD_SHARED_LIBS=OFF \
  670. -DENABLE_DEBUG=ON \
  671. -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \
  672. -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE= \
  673. ${{ matrix.config }}
  674. - name: 'cmake configure log'
  675. if: ${{ !cancelled() }}
  676. run: cat bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
  677. - name: 'curl_config.h'
  678. run: cat bld/lib/curl_config.h | grep -F '#define' | sort || true
  679. - name: 'curl_config.h (full)'
  680. run: cat bld/lib/curl_config.h || true
  681. - name: 'cmake build'
  682. timeout-minutes: 5
  683. run: cmake --build bld --config '${{ matrix.type }}' --parallel 5
  684. - name: 'curl version'
  685. timeout-minutes: 1
  686. run: |
  687. find . -name '*.exe' -o -name '*.dll'
  688. if [ '${{ matrix.plat }}' != 'uwp' ]; then
  689. PATH="$PWD/bld/lib:$PATH"
  690. bld/src/curl.exe --disable --version
  691. fi
  692. - name: 'cmake build tests'
  693. if: ${{ matrix.tflags != 'skipall' }}
  694. timeout-minutes: 10
  695. run: cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target testdeps
  696. - name: 'install test tools'
  697. if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
  698. timeout-minutes: 5
  699. run: |
  700. # GnuTLS is not fully functional on Windows, so skip the tests
  701. # https://github.com/ShiftMediaProject/gnutls/issues/23
  702. if [[ '${{ matrix.name }}' != *'gnutls'* ]]; then
  703. /c/ProgramData/chocolatey/choco.exe install --yes --no-progress --limit-output --timeout 180 --force stunnel openssh || true
  704. fi
  705. curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 https://live.sysinternals.com/handle64.exe --output /bin/handle64.exe
  706. python3 -m pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary impacket
  707. - name: 'cmake run tests'
  708. if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
  709. timeout-minutes: 10
  710. run: |
  711. export TFLAGS='-j8 ~WebSockets ~SCP ~612 ${{ matrix.tflags }}'
  712. if [[ '${{ matrix.install }}' = *'libssh2[core,zlib]'* ]]; then
  713. TFLAGS+=' ~SFTP'
  714. elif [[ '${{ matrix.install }}' = *'libssh '* ]]; then
  715. TFLAGS+=' ~614' # 'SFTP pre-quote chmod' SFTP, pre-quote, directory
  716. fi
  717. PATH="$PWD/bld/lib:$PATH:/c/Program Files (x86)/stunnel/bin:/c/Program Files/OpenSSH-Win64"
  718. cmake --build bld --config '${{ matrix.type }}' --target test-ci
  719. - name: 'cmake build examples'
  720. timeout-minutes: 5
  721. run: cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target curl-examples