windows.yml 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820
  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@11bd71901bbe5b1630ceea73d27597364c9af683 # 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: |
  89. echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
  90. grep -F '#define' bld/lib/curl_config.h | sort || true
  91. - name: 'autotools build'
  92. if: ${{ matrix.build == 'automake' }}
  93. timeout-minutes: 10
  94. run: make -C bld -j5 V=1 install
  95. - name: 'curl version'
  96. if: ${{ matrix.build == 'automake' }}
  97. timeout-minutes: 1
  98. run: |
  99. find . -name '*.exe' -o -name '*.dll'
  100. bld/src/curl.exe --disable --version
  101. - name: 'autotools build tests'
  102. if: ${{ matrix.build == 'automake' && matrix.tflags != 'skipall' }}
  103. timeout-minutes: 15
  104. run: make -C bld -j5 V=1 -C tests
  105. - name: 'autotools run tests'
  106. if: ${{ matrix.build == 'automake' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
  107. timeout-minutes: 15
  108. run: |
  109. export TFLAGS='-j20 ${{ matrix.tflags }} ~615'
  110. if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
  111. TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
  112. fi
  113. make -C bld -j5 V=1 test-ci
  114. - name: 'cmake configure'
  115. if: ${{ matrix.build == 'cmake' }}
  116. timeout-minutes: 5
  117. run: |
  118. PATH="/usr/bin:$(cygpath "${SYSTEMROOT}")/System32"
  119. cmake -B bld -G Ninja ${options} \
  120. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
  121. -DCURL_WERROR=ON \
  122. -DCURL_BROTLI=ON \
  123. ${{ matrix.config }}
  124. - name: 'cmake configure log'
  125. if: ${{ matrix.build == 'cmake' && !cancelled() }}
  126. run: cat bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
  127. - name: 'curl_config.h'
  128. if: ${{ matrix.build == 'cmake' }}
  129. run: |
  130. echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
  131. grep -F '#define' bld/lib/curl_config.h | sort || true
  132. - name: 'cmake build'
  133. if: ${{ matrix.build == 'cmake' }}
  134. timeout-minutes: 10
  135. run: cmake --build bld --config '${{ matrix.type }}'
  136. - name: 'curl version'
  137. if: ${{ matrix.build == 'cmake' }}
  138. timeout-minutes: 1
  139. run: |
  140. find . -name '*.exe' -o -name '*.dll'
  141. PATH="$PWD/bld/lib:$PATH"
  142. bld/src/curl.exe --disable --version
  143. - name: 'cmake build tests'
  144. if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skipall' }}
  145. timeout-minutes: 15
  146. run: cmake --build bld --config '${{ matrix.type }}' --target testdeps
  147. - name: 'cmake run tests'
  148. if: ${{ matrix.build == 'cmake' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
  149. timeout-minutes: 15
  150. run: |
  151. export TFLAGS='-j8 ${{ matrix.tflags }} ~615'
  152. if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
  153. TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
  154. fi
  155. PATH="$PWD/bld/lib:$PATH"
  156. cmake --build bld --config '${{ matrix.type }}' --target test-ci
  157. - name: 'cmake build examples'
  158. if: ${{ matrix.build == 'cmake' }}
  159. timeout-minutes: 5
  160. run: cmake --build bld --config '${{ matrix.type }}' --target curl-examples
  161. msys2: # both msys and mingw-w64
  162. name: "${{ matrix.sys == 'msys' && 'msys2' || 'mingw' }}, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.env }} ${{ matrix.name }} ${{ matrix.test }}"
  163. runs-on: windows-latest
  164. timeout-minutes: 30
  165. defaults:
  166. run:
  167. shell: msys2 {0}
  168. strategy:
  169. matrix:
  170. include:
  171. - { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: '!19 !1233', config: '--enable-debug --disable-threaded-resolver --disable-proxy', name: '!proxy' }
  172. - { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: 'skiprun' , config: '--enable-debug --disable-threaded-resolver', name: 'default' }
  173. - { build: 'cmake' , sys: 'msys' , env: 'x86_64' , tflags: '!19 !504 !704 !705 !1233', config: '-DENABLE_DEBUG=ON -DENABLE_THREADED_RESOLVER=OFF', name: 'default' }
  174. - { build: 'autotools', sys: 'msys' , env: 'x86_64' , tflags: '!19 !504 !704 !705 !1233', config: '', name: 'default R' }
  175. - { build: 'autotools', sys: 'mingw64', env: 'x86_64' , tflags: 'skiprun' , config: '--enable-debug --disable-threaded-resolver --disable-curldebug --enable-static=no --without-zlib', name: 'default' }
  176. - { build: 'autotools', sys: 'mingw64', env: 'x86_64' , tflags: '~472 ~1299 ~1613' , config: '--enable-debug --enable-windows-unicode --enable-ares', name: 'c-ares U' }
  177. # FIXME: WebSockets test results ignored due to frequent failures on native Windows:
  178. - { 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' }
  179. - { 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' }
  180. - { 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' }
  181. - { 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' }
  182. - { build: 'cmake' , sys: 'mingw64', env: 'x86_64' , tflags: 'skiprun' , config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=ON -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=ON -DCMAKE_VERBOSE_MAKEFILE=ON', type: 'Debug', cflags: '-DCURL_SCHANNEL_DEV_DEBUG', name: 'schannel dev debug' }
  183. - { 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' }
  184. fail-fast: false
  185. steps:
  186. - run: git config --global core.autocrlf input
  187. shell: pwsh
  188. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  189. - uses: msys2/setup-msys2@c52d1fa9c7492275e60fe763540fb601f5f232a1 # v2
  190. if: ${{ matrix.sys == 'msys' }}
  191. with:
  192. msystem: ${{ matrix.sys }}
  193. # https://packages.msys2.org/search
  194. install: >-
  195. gcc
  196. ${{ matrix.build }} ${{ matrix.build == 'autotools' && 'make' || 'ninja' }}
  197. openssh
  198. openssl-devel
  199. zlib-devel
  200. brotli-devel
  201. libnghttp2-devel
  202. libpsl-devel
  203. libssh2-devel
  204. - uses: msys2/setup-msys2@c52d1fa9c7492275e60fe763540fb601f5f232a1 # v2
  205. if: ${{ matrix.sys != 'msys' }}
  206. with:
  207. msystem: ${{ matrix.sys }}
  208. install: >-
  209. mingw-w64-${{ matrix.env }}-cc
  210. mingw-w64-${{ matrix.env }}-${{ matrix.build }} ${{ matrix.build == 'autotools' && 'make' || '' }}
  211. openssh
  212. mingw-w64-${{ matrix.env }}-openssl
  213. mingw-w64-${{ matrix.env }}-libssh2
  214. mingw-w64-${{ matrix.env }}-libpsl
  215. mingw-w64-${{ matrix.env }}-c-ares
  216. - name: 'autotools autoreconf'
  217. if: ${{ matrix.build == 'autotools' }}
  218. timeout-minutes: 2
  219. run: autoreconf -fi
  220. - name: 'autotools configure'
  221. if: ${{ matrix.build == 'autotools' }}
  222. timeout-minutes: 5
  223. run: |
  224. mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
  225. --prefix="${HOME}"/install \
  226. --with-openssl \
  227. --with-libssh2 \
  228. --disable-dependency-tracking \
  229. ${{ matrix.config }}
  230. - name: 'autotools configure log'
  231. if: ${{ matrix.build == 'autotools' && !cancelled() }}
  232. run: cat bld/config.log 2>/dev/null || true
  233. - name: 'curl_config.h'
  234. if: ${{ matrix.build == 'autotools' }}
  235. run: |
  236. echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
  237. grep -F '#define' bld/lib/curl_config.h | sort || true
  238. - name: 'autotools build'
  239. if: ${{ matrix.build == 'autotools' }}
  240. timeout-minutes: 10
  241. run: make -C bld -j5 V=1 install
  242. - name: 'curl version'
  243. if: ${{ matrix.build == 'autotools' }}
  244. timeout-minutes: 1
  245. run: |
  246. # avoid libtool's curl.exe wrapper
  247. mv bld/src/.libs/curl.exe bld/src/curl.exe
  248. mv bld/lib/.libs/*.dll bld/src || true
  249. find . -name '*.exe' -o -name '*.dll'
  250. bld/src/curl.exe --disable --version
  251. - name: 'autotools build tests'
  252. if: ${{ matrix.build == 'autotools' && matrix.tflags != 'skipall' }}
  253. timeout-minutes: 10
  254. run: make -C bld -j5 V=1 -C tests
  255. - name: 'install test prereqs'
  256. if: ${{ matrix.build == 'autotools' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
  257. timeout-minutes: 5
  258. run: |
  259. /c/ProgramData/chocolatey/choco.exe install --yes --no-progress --limit-output --timeout 180 --force stunnel || true
  260. curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 https://live.sysinternals.com/handle64.exe --output /bin/handle64.exe
  261. - name: 'autotools run tests'
  262. if: ${{ matrix.build == 'autotools' && matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
  263. timeout-minutes: 10
  264. run: |
  265. export TFLAGS='-j8 ${{ matrix.tflags }} ~SCP'
  266. if [ '${{ matrix.sys }}' != 'msys' ]; then
  267. TFLAGS+=' ~2301 ~2302' # WebSockets'
  268. TFLAGS+=' ~612 ~613 ~616 ~618' # SFTP
  269. else
  270. TFLAGS+=' ~SFTP'
  271. fi
  272. if [ -x "$(cygpath "${SYSTEMROOT}/System32/curl.exe")" ]; then
  273. TFLAGS+=" -ac $(cygpath "${SYSTEMROOT}/System32/curl.exe")"
  274. fi
  275. PATH="$PATH:/c/Program Files (x86)/stunnel/bin"
  276. make -C bld -j5 V=1 test-ci
  277. - name: 'autotools build examples'
  278. if: ${{ matrix.build == 'autotools' && (matrix.tflags == 'skipall' || matrix.tflags == 'skiprun') }}
  279. timeout-minutes: 5
  280. run: make -C bld -j5 V=1 examples
  281. - name: 'cmake configure'
  282. if: ${{ matrix.build == 'cmake' }}
  283. timeout-minutes: 5
  284. run: |
  285. if [[ '${{ matrix.env }}' = 'clang'* ]]; then
  286. options='-DCMAKE_C_COMPILER=clang'
  287. else
  288. options='-DCMAKE_C_COMPILER=gcc'
  289. fi
  290. if [ '${{ matrix.test }}' = 'uwp' ]; then
  291. options+=' -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0'
  292. pacman --noconfirm --ask 20 --noprogressbar --sync --needed 'mingw-w64-${{ matrix.env }}-winstorecompat-git'
  293. specs="$(realpath gcc-specs-uwp)"
  294. gcc -dumpspecs | sed -e 's/-lmingwex/-lwindowsapp -lmingwex -lwindowsapp -lwindowsappcompat/' -e 's/-lmsvcrt/-lmsvcr120_app/' > "${specs}"
  295. cflags="-specs=$(cygpath -w "${specs}") -DWINSTORECOMPAT -DWINAPI_FAMILY=WINAPI_FAMILY_APP"
  296. # CMake (as of v3.26.4) gets confused and applies the MSVC rc.exe command-line
  297. # template to windres. Reset it to the windres template manually:
  298. rcopts='<CMAKE_RC_COMPILER> -O coff <DEFINES> <INCLUDES> <FLAGS> <SOURCE> <OBJECT>'
  299. else
  300. rcopts=''
  301. fi
  302. [ '${{ matrix.type }}' = 'Debug' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG='
  303. [ '${{ matrix.type }}' = 'Release' ] && options+=' -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE='
  304. cmake -B bld -G Ninja ${options} \
  305. "-DCMAKE_C_FLAGS=${{ matrix.cflags }} ${cflags}" \
  306. "-DCMAKE_RC_COMPILE_OBJECT=${rcopts}" \
  307. '-DCMAKE_BUILD_TYPE=${{ matrix.type }}' \
  308. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
  309. -DCURL_WERROR=ON \
  310. -DCURL_BROTLI=ON \
  311. ${{ matrix.config }}
  312. - name: 'cmake configure log'
  313. if: ${{ matrix.build == 'cmake' && !cancelled() }}
  314. run: cat bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
  315. - name: 'curl_config.h'
  316. if: ${{ matrix.build == 'cmake' }}
  317. run: |
  318. echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
  319. grep -F '#define' bld/lib/curl_config.h | sort || true
  320. - name: 'cmake build'
  321. if: ${{ matrix.build == 'cmake' }}
  322. timeout-minutes: 10
  323. run: cmake --build bld --config '${{ matrix.type }}'
  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 }}' --target testdeps
  337. - name: 'install test prereqs'
  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 }}' --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@6849a6489940f00c2f30c0fb92c6274307ccb58a # 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@11bd71901bbe5b1630ceea73d27597364c9af683 # 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: |
  434. echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
  435. grep -F '#define' bld/lib/curl_config.h | sort || 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 prereqs'
  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@11bd71901bbe5b1630ceea73d27597364c9af683 # 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: 'curl_config.h'
  506. if: ${{ matrix.build == 'autotools' }}
  507. run: |
  508. echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
  509. grep -F '#define' bld/lib/curl_config.h | sort || true
  510. - name: 'autotools build'
  511. if: ${{ matrix.build == 'autotools' }}
  512. run: make -C bld -j5
  513. - name: 'autotools build examples'
  514. if: ${{ matrix.build == 'autotools' }}
  515. run: make -C bld -j5 examples
  516. - name: 'cmake configure'
  517. if: ${{ matrix.build == 'cmake' }}
  518. run: |
  519. cmake -B bld -G Ninja \
  520. -DCMAKE_SYSTEM_NAME=Windows \
  521. -DCMAKE_C_COMPILER_TARGET=${TRIPLET} \
  522. -DCMAKE_C_COMPILER=${TRIPLET}-gcc \
  523. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
  524. -DCURL_WERROR=ON \
  525. -DCURL_USE_SCHANNEL=ON -DUSE_WIN32_IDN=ON \
  526. -DCURL_USE_LIBPSL=OFF
  527. - name: 'cmake configure log'
  528. if: ${{ matrix.build == 'cmake' && !cancelled() }}
  529. run: cat bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
  530. - name: 'curl_config.h'
  531. if: ${{ matrix.build == 'cmake' }}
  532. run: |
  533. echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
  534. grep -F '#define' bld/lib/curl_config.h | sort || true
  535. - name: 'cmake build'
  536. if: ${{ matrix.build == 'cmake' }}
  537. run: cmake --build bld
  538. - name: 'cmake build tests'
  539. if: ${{ matrix.build == 'cmake' }}
  540. run: cmake --build bld --target testdeps
  541. - name: 'cmake build examples'
  542. if: ${{ matrix.build == 'cmake' }}
  543. run: cmake --build bld --target curl-examples
  544. msvc:
  545. name: 'msvc, CM ${{ matrix.arch }}-${{ matrix.plat }} ${{ matrix.name }}'
  546. runs-on: windows-latest
  547. timeout-minutes: 55
  548. defaults:
  549. run:
  550. shell: C:\msys64\usr\bin\bash.exe {0}
  551. env:
  552. VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
  553. VCPKG_DISABLE_METRICS: '1'
  554. strategy:
  555. matrix:
  556. include:
  557. - name: 'schannel MultiSSL U'
  558. install: 'brotli zlib zstd libpsl nghttp2 libssh2[core,zlib] pkgconf gsasl openssl mbedtls'
  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=ON -DCURL_USE_OPENSSL=ON -DCURL_USE_MBEDTLS=ON -DCURL_DEFAULT_SSL_BACKEND=schannel
  566. -DCURL_USE_GSASL=ON -DUSE_WIN32_IDN=ON -DENABLE_UNICODE=ON
  567. - name: 'openssl'
  568. install: 'brotli zlib zstd libpsl nghttp2 nghttp3 openssl libssh2 pkgconf gsasl c-ares libuv krb5'
  569. arch: 'x64'
  570. plat: 'windows'
  571. type: 'Debug'
  572. tflags: '~1516 ~2301 ~2302 ~2303 ~2307'
  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_GSASL=ON -DENABLE_ARES=ON -DCURL_USE_LIBUV=ON -DCURL_USE_GSSAPI=ON
  577. - name: 'openssl'
  578. install: 'brotli zlib zstd nghttp2 nghttp3 openssl libssh2'
  579. arch: 'x64'
  580. plat: 'uwp'
  581. type: 'Debug'
  582. tflags: 'skiprun'
  583. config: >-
  584. -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=ON
  585. -DCURL_USE_SCHANNEL=OFF -DCURL_USE_OPENSSL=ON -DUSE_OPENSSL_QUIC=ON
  586. -DCURL_USE_LIBPSL=OFF
  587. - name: 'libressl'
  588. install: 'brotli zlib zstd libpsl nghttp2 libressl libssh2[core,zlib] pkgconf ngtcp2[libressl] nghttp3'
  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 -DUSE_NGTCP2=ON
  596. -DCURL_CA_SEARCH_SAFE=ON
  597. - name: 'boringssl'
  598. install: 'brotli zlib zstd libpsl nghttp2 boringssl libssh2[core,zlib]'
  599. arch: 'x64'
  600. plat: 'windows'
  601. type: 'Debug'
  602. tflags: '~1516 ~2301 ~2302 ~2303 ~2307'
  603. config: >-
  604. -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=ON
  605. -DCURL_USE_SCHANNEL=OFF -DCURL_USE_OPENSSL=ON
  606. -DUSE_HTTPSRR=ON -DUSE_ECH=ON
  607. - name: 'wolfssl'
  608. install: 'brotli zlib zstd libpsl nghttp2 wolfssl libssh2 pkgconf gsasl ngtcp2[wolfssl] nghttp3'
  609. arch: 'x64'
  610. plat: 'windows'
  611. type: 'Debug'
  612. tflags: '~1516'
  613. config: >-
  614. -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=ON
  615. -DCURL_USE_SCHANNEL=OFF -DCURL_USE_WOLFSSL=ON -DUSE_NGTCP2=ON
  616. -DCURL_USE_GSASL=ON
  617. - name: 'mbedtls'
  618. install: 'brotli zlib zstd libpsl nghttp2 mbedtls libssh pkgconf gsasl'
  619. arch: 'x64'
  620. plat: 'windows'
  621. type: 'Debug'
  622. tflags: '~1516'
  623. # WARNING: libssh uses hard-coded world-writable paths (/etc/..., ~/.ssh/) to
  624. # read its configuration from, making it vulnerable to attacks on
  625. # Windows. Do not use this component till there is a fix for these.
  626. # https://github.com/curl/curl-for-win/blob/3951808deb04df9489ee17430f236ed54436f81a/libssh.sh#L6-L8
  627. config: >-
  628. -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON
  629. -DCURL_USE_SCHANNEL=OFF -DCURL_USE_MBEDTLS=ON
  630. -DCURL_USE_GSASL=ON
  631. - name: 'msh3'
  632. install: 'brotli zlib zstd libpsl nghttp2 msh3 libssh2 pkgconf gsasl'
  633. arch: 'x64'
  634. plat: 'windows'
  635. type: 'Debug'
  636. tflags: 'skipall'
  637. config: >-
  638. -DCURL_BROTLI=ON -DCURL_ZSTD=ON -DCURL_USE_LIBSSH2=ON
  639. -DCURL_USE_SCHANNEL=OFF -DUSE_MSH3=ON
  640. -DCURL_USE_GSASL=ON
  641. fail-fast: false
  642. steps:
  643. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  644. - name: 'vcpkg cache setup'
  645. uses: actions/github-script@v7
  646. with:
  647. script: |
  648. core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
  649. core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
  650. - name: 'vcpkg versions'
  651. timeout-minutes: 1
  652. run: |
  653. git -C "$VCPKG_INSTALLATION_ROOT" show --no-patch --format='%H %ai'
  654. vcpkg version
  655. - name: 'vcpkg build'
  656. timeout-minutes: 35
  657. run: vcpkg x-set-installed ${{ matrix.install }} '--triplet=${{ matrix.arch }}-${{ matrix.plat }}'
  658. - name: 'cmake configure'
  659. timeout-minutes: 5
  660. run: |
  661. PATH="/c/msys64/usr/bin:$PATH"
  662. cmake -B bld ${options} \
  663. "-DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" \
  664. "-DVCPKG_INSTALLED_DIR=$VCPKG_INSTALLATION_ROOT/installed" \
  665. '-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-${{ matrix.plat }}' \
  666. -DCMAKE_VS_GLOBALS=TrackFileAccess=false \
  667. '-DCMAKE_BUILD_TYPE=${{ matrix.type }}' \
  668. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
  669. -DCURL_WERROR=ON \
  670. -DBUILD_SHARED_LIBS=OFF \
  671. -DENABLE_DEBUG=ON \
  672. -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \
  673. -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE= \
  674. ${{ matrix.config }}
  675. - name: 'cmake configure log'
  676. if: ${{ !cancelled() }}
  677. run: cat bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
  678. - name: 'curl_config.h'
  679. run: |
  680. echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
  681. grep -F '#define' bld/lib/curl_config.h | sort || true
  682. - name: 'cmake build'
  683. timeout-minutes: 5
  684. run: |
  685. PATH="/c/msys64/usr/bin:$PATH"
  686. cmake --build bld --config '${{ matrix.type }}' --parallel 5
  687. - name: 'curl version'
  688. timeout-minutes: 1
  689. run: |
  690. find . -name '*.exe' -o -name '*.dll'
  691. if [ '${{ matrix.plat }}' != 'uwp' ]; then
  692. PATH="$PWD/bld/lib:$PATH"
  693. bld/src/curl.exe --disable --version
  694. fi
  695. - name: 'cmake build tests'
  696. if: ${{ matrix.tflags != 'skipall' }}
  697. timeout-minutes: 10
  698. run: |
  699. PATH="/c/msys64/usr/bin:$PATH"
  700. cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target testdeps
  701. - name: 'install test prereqs'
  702. if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
  703. timeout-minutes: 5
  704. run: |
  705. # GnuTLS is not fully functional on Windows, so skip the tests
  706. # https://github.com/ShiftMediaProject/gnutls/issues/23
  707. if [[ '${{ matrix.name }}' != *'gnutls'* ]]; then
  708. /c/ProgramData/chocolatey/choco.exe install --yes --no-progress --limit-output --timeout 180 --force stunnel openssh || true
  709. fi
  710. curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 https://live.sysinternals.com/handle64.exe --output /bin/handle64.exe
  711. python3 -m pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary impacket
  712. - name: 'cmake run tests'
  713. if: ${{ matrix.tflags != 'skipall' && matrix.tflags != 'skiprun' }}
  714. timeout-minutes: 10
  715. run: |
  716. export TFLAGS='-j8 ~WebSockets ~SCP ~612 ${{ matrix.tflags }}'
  717. if [[ '${{ matrix.install }}' = *'libssh2[core,zlib]'* ]]; then
  718. TFLAGS+=' ~SFTP'
  719. elif [[ '${{ matrix.install }}' = *'libssh '* ]]; then
  720. TFLAGS+=' ~614' # 'SFTP pre-quote chmod' SFTP, pre-quote, directory
  721. fi
  722. PATH="$PWD/bld/lib:$PATH:/c/Program Files (x86)/stunnel/bin:/c/Program Files/OpenSSH-Win64"
  723. PATH="/c/msys64/usr/bin:$PATH"
  724. cmake --build bld --config '${{ matrix.type }}' --target test-ci
  725. - name: 'cmake build examples'
  726. timeout-minutes: 5
  727. run: |
  728. PATH="/c/msys64/usr/bin:$PATH"
  729. cmake --build bld --config '${{ matrix.type }}' --parallel 5 --target curl-examples