2
0

macos.yml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. # Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  2. #
  3. # SPDX-License-Identifier: curl
  4. name: macOS
  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. # Deprecated Apple APIs and the macos-version-min value required to avoid
  34. # deprecation warnings with llvm/clang:
  35. #
  36. # - 10.7 Lion (2011) - GSS
  37. # - 10.8 Mountain Lion (2012) - CFURLCreateDataAndPropertiesFromResource (used by curl Secure Transport code)
  38. # - 10.9 Maverick (2013) - LDAP
  39. # - 10.14 Mojave (2018) - Secure Transport
  40. #
  41. # For Secure Transport, curl implements features that require a target
  42. # newer than the 10.8 required by `CFURLCreateDataAndPropertiesFromResource`.
  43. env:
  44. LDFLAGS: -w # suppress 'object file was built for newer macOS version than being linked' warnings
  45. MAKEFLAGS: -j 4
  46. jobs:
  47. macos:
  48. name: "${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.compiler }} ${{ matrix.build.name }}"
  49. runs-on: 'macos-latest'
  50. timeout-minutes: 45
  51. env:
  52. DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer"
  53. CC: ${{ matrix.compiler }}
  54. CFLAGS: ''
  55. strategy:
  56. fail-fast: false
  57. matrix:
  58. compiler: [clang, llvm@15, gcc-12]
  59. build:
  60. # automake
  61. - name: '!ssl !debug brotli zstd'
  62. compiler: clang
  63. install: brotli zstd
  64. configure: --without-ssl --with-brotli --with-zstd
  65. - name: '!ssl !debug'
  66. compiler: gcc-12
  67. configure: --without-ssl
  68. - name: '!ssl'
  69. compiler: clang
  70. configure: --enable-debug --without-ssl
  71. - name: '!ssl libssh2 AppleIDN'
  72. compiler: clang
  73. configure: --enable-debug --with-libssh2=$(brew --prefix libssh2) --without-ssl --with-apple-idn
  74. - name: 'OpenSSL libssh c-ares'
  75. compiler: clang
  76. install: libssh
  77. configure: --enable-debug --with-libssh --with-openssl=$(brew --prefix openssl) --enable-ares
  78. - name: 'OpenSSL libssh'
  79. compiler: llvm@15
  80. install: libssh
  81. configure: --enable-debug --with-libssh --with-openssl=$(brew --prefix openssl)
  82. - name: '!ssl c-ares'
  83. compiler: clang
  84. configure: --enable-debug --enable-ares --without-ssl
  85. - name: '!ssl HTTP-only'
  86. compiler: clang
  87. configure: >-
  88. --enable-debug
  89. --disable-alt-svc --disable-dict --disable-file --disable-ftp --disable-gopher --disable-imap
  90. --disable-ldap --disable-pop3 --disable-rtmp --disable-rtsp --disable-scp --disable-sftp
  91. --disable-shared --disable-smb --disable-smtp --disable-telnet --disable-tftp --disable-unix-sockets
  92. --without-brotli --without-gssapi --without-libidn2 --without-libpsl --without-librtmp --without-libssh2
  93. --without-nghttp2 --without-ntlm-auth --without-ssl --without-zlib --without-zstd
  94. macos-version-min: '10.15' # Catalina (2019)
  95. - name: 'SecureTransport libssh2'
  96. compiler: clang
  97. configure: --enable-debug --with-secure-transport --with-libssh2=$(brew --prefix libssh2)
  98. macos-version-min: '10.8'
  99. - name: 'SecureTransport libssh2 10.12'
  100. compiler: clang
  101. configure: --enable-debug --with-secure-transport --with-libssh2=$(brew --prefix libssh2)
  102. macos-version-min: '10.12' # for monotonic timers
  103. - name: 'SecureTransport libssh2'
  104. compiler: gcc-12
  105. configure: --enable-debug --with-secure-transport --with-libssh2=$(brew --prefix libssh2)
  106. macos-version-min: '10.8'
  107. - name: 'LibreSSL +examples'
  108. compiler: clang
  109. install: libressl
  110. configure: --enable-debug --with-openssl=$(brew --prefix libressl)
  111. - name: 'OpenSSL'
  112. compiler: clang
  113. configure: --enable-debug --with-openssl=$(brew --prefix openssl)
  114. - name: 'OpenSSL event-based'
  115. compiler: clang
  116. configure: --enable-debug --with-openssl=$(brew --prefix openssl)
  117. tflags: --test-event
  118. - name: 'OpenSSL libssh2 !ldap 10.15'
  119. compiler: clang
  120. configure: --enable-debug --disable-ldap --with-openssl=$(brew --prefix openssl)
  121. macos-version-min: '10.15'
  122. # cmake
  123. - name: 'OpenSSL gsasl AppleIDN'
  124. install: gsasl
  125. generate: -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DCURL_USE_GSASL=ON -DUSE_APPLE_IDN=ON
  126. - name: 'OpenSSL +static libssh +examples'
  127. install: libssh
  128. generate: -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DBUILD_STATIC_LIBS=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON
  129. - name: 'SecureTransport debug'
  130. generate: -DCURL_USE_SECTRANSP=ON -DENABLE_DEBUG=ON
  131. macos-version-min: '10.8'
  132. - name: 'LibreSSL !ldap heimdal c-ares +examples'
  133. install: libressl heimdal
  134. generate: -DOPENSSL_ROOT_DIR=$(brew --prefix libressl) -DENABLE_ARES=ON -DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=$(brew --prefix heimdal) -DCURL_DISABLE_LDAP=ON
  135. - name: 'wolfSSL !ldap brotli zstd'
  136. install: brotli wolfssl zstd
  137. generate: -DCURL_USE_WOLFSSL=ON -DCURL_DISABLE_LDAP=ON -DUSE_ECH=ON
  138. - name: 'mbedTLS !ldap brotli zstd'
  139. install: brotli mbedtls zstd
  140. generate: -DCURL_USE_MBEDTLS=ON -DCURL_DISABLE_LDAP=ON
  141. - name: 'GnuTLS !ldap krb5'
  142. install: gnutls nettle krb5
  143. generate: -DCURL_USE_GNUTLS=ON -DCURL_USE_OPENSSL=OFF -DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=$(brew --prefix krb5) -DCURL_DISABLE_LDAP=ON
  144. - name: 'OpenSSL torture !FTP'
  145. generate: -DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_THREADED_RESOLVER=OFF -DOPENSSL_ROOT_DIR=$(brew --prefix openssl)
  146. tflags: -t --shallow=25 !FTP
  147. torture: true
  148. - name: 'OpenSSL torture FTP'
  149. generate: -DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_THREADED_RESOLVER=OFF -DOPENSSL_ROOT_DIR=$(brew --prefix openssl)
  150. tflags: -t --shallow=20 FTP
  151. torture: true
  152. exclude:
  153. - { compiler: llvm@15, build: { macos-version-min: '10.15' } }
  154. - { compiler: llvm@15, build: { torture: true } }
  155. - { compiler: gcc-12, build: { torture: true } }
  156. # opt out jobs from combinations that have the compiler set manually
  157. - { compiler: llvm@15, build: { compiler: 'clang' } }
  158. - { compiler: llvm@15, build: { compiler: 'gcc-12' } }
  159. - { compiler: gcc-12, build: { compiler: 'clang' } }
  160. - { compiler: gcc-12, build: { compiler: 'llvm@15' } }
  161. - { compiler: clang, build: { compiler: 'gcc-12' } }
  162. - { compiler: clang, build: { compiler: 'llvm@15' } }
  163. steps:
  164. - name: 'brew install'
  165. # Run this command with retries because of spurious failures seen
  166. # while running the tests, for example
  167. # https://github.com/curl/curl/runs/4095721123?check_suite_focus=true
  168. run: |
  169. echo ${{ matrix.build.generate && 'ninja' || 'automake libtool' }} \
  170. pkgconf libpsl libssh2 nghttp2 stunnel ${{ matrix.build.install }} | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
  171. while [[ $? == 0 ]]; do for i in 1 2 3; do brew update && brew bundle install --no-lock --file /tmp/Brewfile && break 2 || { echo Error: wait to try again; sleep 10; } done; false Too many retries; done
  172. - name: 'brew unlink openssl'
  173. run: |
  174. if test -d $(brew --prefix)/include/openssl; then
  175. brew unlink openssl
  176. fi
  177. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  178. with:
  179. persist-credentials: false
  180. - name: 'toolchain versions'
  181. run: |
  182. [[ '${{ matrix.compiler }}' = 'llvm'* ]] && CC="$(brew --prefix ${{ matrix.compiler }})/bin/clang"
  183. [[ '${{ matrix.compiler }}' = 'gcc'* ]] && "${CC}" --print-sysroot
  184. which "${CC}"; "${CC}" --version || true
  185. xcodebuild -version || true
  186. xcrun --sdk macosx --show-sdk-path 2>/dev/null || true
  187. xcrun --sdk macosx --show-sdk-version || true
  188. ls -l /Library/Developer/CommandLineTools/SDKs || true
  189. echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::'
  190. echo '::group::brew packages installed'; ls -l "$(brew --prefix)/opt"; echo '::endgroup::'
  191. - name: 'autoreconf'
  192. if: ${{ matrix.build.configure }}
  193. run: autoreconf -fi
  194. - name: 'configure'
  195. run: |
  196. if [[ '${{ matrix.compiler }}' = 'gcc'* ]]; then
  197. sysroot="$("${CC}" --print-sysroot)" # Must match the SDK gcc was built for
  198. else
  199. sysroot="$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)"
  200. fi
  201. if [[ '${{ matrix.compiler }}' = 'llvm'* ]]; then
  202. CC="$(brew --prefix ${{ matrix.compiler }})/bin/clang"
  203. CC+=" --sysroot=${sysroot}"
  204. CC+=" --target=$(uname -m)-apple-darwin"
  205. fi
  206. if [ -n '${{ matrix.build.configure }}' ]; then
  207. export CFLAGS
  208. if [[ '${{ matrix.compiler }}' = 'llvm'* ]]; then
  209. options+=" --target=$(uname -m)-apple-darwin"
  210. fi
  211. if [ '${{ matrix.compiler }}' != 'clang' ]; then
  212. options+=" --with-sysroot=${sysroot}"
  213. CFLAGS+=" --sysroot=${sysroot}"
  214. fi
  215. [ -n '${{ matrix.build.macos-version-min }}' ] && CFLAGS+=' -mmacosx-version-min=${{ matrix.build.macos-version-min }}'
  216. mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
  217. --disable-dependency-tracking \
  218. --with-libpsl=$(brew --prefix libpsl) \
  219. ${{ matrix.build.configure }} ${options}
  220. else
  221. [ -n '${{ matrix.build.macos-version-min }}' ] && options+=' -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.build.macos-version-min }}'
  222. cmake -B bld -G Ninja -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \
  223. "-DCMAKE_OSX_SYSROOT=${sysroot}" \
  224. "-DCMAKE_C_COMPILER_TARGET=$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \
  225. ${{ matrix.build.generate }} ${options}
  226. fi
  227. - name: 'configure log'
  228. if: ${{ !cancelled() }}
  229. run: cat bld/config.log bld/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
  230. - name: 'curl_config.h'
  231. run: |
  232. echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
  233. grep -F '#define' bld/lib/curl_config.h | sort || true
  234. - name: 'build-cert'
  235. if: contains(matrix.build.generate, '-DCURL_USE_SECTRANSP=ON') || contains(matrix.build.configure, '--with-secure-transport')
  236. run: |
  237. if [ -n '${{ matrix.build.configure }}' ]; then
  238. make -C bld/tests/certs clean-certs
  239. make -C bld/tests/certs build-certs -j1
  240. else
  241. cmake --build bld --target clean-certs
  242. cmake --build bld --target build-certs --parallel 1
  243. fi
  244. - name: 'build'
  245. run: |
  246. if [ -n '${{ matrix.build.configure }}' ]; then
  247. make -C bld V=1
  248. else
  249. cmake --build bld --verbose
  250. fi
  251. - name: 'curl version'
  252. run: bld/src/curl --disable --version
  253. - name: 'build tests'
  254. run: |
  255. if [ -n '${{ matrix.build.configure }}' ]; then
  256. make -C bld V=1 -C tests
  257. else
  258. cmake --build bld --target testdeps
  259. fi
  260. - name: 'install test prereqs'
  261. run: |
  262. python3 -m venv $HOME/venv
  263. source $HOME/venv/bin/activate
  264. python3 -m pip install -r tests/requirements.txt
  265. - name: 'run tests'
  266. timeout-minutes: ${{ matrix.build.torture && 20 || 10 }}
  267. run: |
  268. export TFLAGS='-j20 ${{ matrix.build.tflags }}'
  269. if [ -z '${{ matrix.build.torture }}' ]; then
  270. TFLAGS+=' ~2037 ~2041' # flaky
  271. if [[ '${{ matrix.compiler }}' = 'gcc'* ]]; then
  272. TFLAGS+=' ~RTSP' # 567 568 569 570 571 572 577 689 3100
  273. TFLAGS+=' ~1156 ~1539' # HTTP Content-Range, Content-Length
  274. if [[ -n '${{ matrix.build.configure }}' || \
  275. '${{ matrix.build.generate }}' = *'-DCURL_USE_SECTRANSP=ON'* ]]; then
  276. TFLAGS+=' ~2100' # 2100:'HTTP GET using DoH' https://github.com/curl/curl/actions/runs/9942146678/job/27462937524#step:15:5059
  277. fi
  278. if [[ '${{ matrix.build.configure }}' = *'--with-secure-transport'* || \
  279. '${{ matrix.build.generate }}' = *'-DCURL_USE_SECTRANSP=ON'* ]]; then
  280. TFLAGS+=' ~HTTP/2' # 2400 2401 2402 2403 2404 2406, Secure Transport + nghttp2
  281. else
  282. TFLAGS+=' ~2402 ~2404' # non-Secure Transport + nghttp2
  283. fi
  284. fi
  285. if [[ '${{ matrix.build.configure }}' = *'--with-secure-transport'* || \
  286. '${{ matrix.build.generate }}' = *'-DCURL_USE_SECTRANSP=ON'* ]]; then
  287. TFLAGS+=' ~313' # Secure Transport does not support crl file
  288. TFLAGS+=' ~1631 ~1632' # Secure Transport is not able to shutdown ftp over https gracefully yet
  289. fi
  290. fi
  291. source $HOME/venv/bin/activate
  292. rm -f $HOME/.curlrc
  293. if [ -n '${{ matrix.build.configure }}' ]; then
  294. make -C bld V=1 ${{ matrix.build.torture && 'test-torture' || 'test-ci' }}
  295. else
  296. cmake --build bld --target ${{ matrix.build.torture && 'test-torture' || 'test-ci' }}
  297. fi
  298. - name: 'build examples'
  299. if: ${{ contains(matrix.build.name, '+examples') }}
  300. run: |
  301. if [ -n '${{ matrix.build.configure }}' ]; then
  302. make -C bld examples V=1
  303. else
  304. cmake --build bld --target curl-examples --verbose
  305. fi
  306. combinations: # Test buildability with host OS, Xcode / SDK, compiler, target-OS, Secure Transport/not, built tool, combinations
  307. if: true # Set to `true` to enable this test matrix. It runs quickly.
  308. name: "${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.compiler }} ${{ matrix.image }} ${{ matrix.xcode }} ${{ matrix.config }}"
  309. runs-on: ${{ matrix.image }}
  310. timeout-minutes: 10
  311. env:
  312. DEVELOPER_DIR: "/Applications/Xcode${{ matrix.xcode && format('_{0}', matrix.xcode) || '' }}.app/Contents/Developer"
  313. CC: ${{ matrix.compiler }}
  314. strategy:
  315. fail-fast: false
  316. matrix:
  317. config: [SecureTransport] # also: OpenSSL
  318. compiler: [gcc-12, gcc-13, gcc-14, llvm@15, llvm@18, clang]
  319. # Xcode support matrix as of 2024-07, with default macOS SDK versions and OS names, years:
  320. # * = default Xcode on the runner.
  321. # macos-13: 14.1, 14.2, 14.3.1, 15.0.1, 15.1,*15.2
  322. # macos-14: 15.0.1, 15.1, 15.2, 15.3,*15.4
  323. # macos-15: *16.0, 16.1
  324. # macOSSDK: 13.0, 13.1, 13.3, 14.0, 14.2, 14.2, 14.4, 14.5, 15.0, 15.1
  325. # Ventura (2022) Sonoma (2023) Sequoia (2024)
  326. # https://github.com/actions/runner-images/tree/main/images/macos
  327. # https://en.wikipedia.org/wiki/MacOS_version_history
  328. image: [macos-13, macos-14, macos-15]
  329. # Can skip these to reduce jobs:
  330. # 15.1 has the same default macOS SDK as 15.2 and identical test result.
  331. # 14.1, 15.4 not revealing new fallouts.
  332. #xcode: ['14.1', '14.2', '14.3.1', '15.0.1', '15.1', '15.2', '15.3', '15.4', '16.0', '16.1'] # all Xcode
  333. #xcode: ['14.1', '14.2', '14.3.1', '15.0.1' , '15.2', '15.3', '15.4', '16.0', '16.1'] # all SDK
  334. #xcode: [ '14.2', '14.3.1', '15.0.1' , '15.2', '15.3' , '16.0' ] # coverage
  335. xcode: [''] # default Xcodes
  336. macos-version-min: ['']
  337. build: [autotools, cmake]
  338. exclude:
  339. # Combinations uncovered by runner images:
  340. - { image: macos-13, xcode: '15.3' }
  341. - { image: macos-13, xcode: '15.4' }
  342. - { image: macos-13, xcode: '16.0' }
  343. - { image: macos-13, xcode: '16.1' }
  344. - { image: macos-14, xcode: '14.1' }
  345. - { image: macos-14, xcode: '14.2' }
  346. - { image: macos-14, xcode: '14.3.1' }
  347. - { image: macos-14, xcode: '16.0' }
  348. - { image: macos-14, xcode: '16.1' }
  349. - { image: macos-15, xcode: '14.1' }
  350. - { image: macos-15, xcode: '14.2' }
  351. - { image: macos-15, xcode: '14.3.1' }
  352. - { image: macos-15, xcode: '15.0.1' }
  353. - { image: macos-15, xcode: '15.1' }
  354. - { image: macos-15, xcode: '15.2' }
  355. - { image: macos-15, xcode: '15.3' }
  356. - { image: macos-15, xcode: '15.4' }
  357. - { image: macos-13, compiler: 'llvm@18' }
  358. - { image: macos-14, compiler: 'llvm@18' }
  359. - { image: macos-15, compiler: 'llvm@15' }
  360. # Reduce build combinations, by dropping less interesting ones
  361. - { compiler: gcc-12, config: SecureTransport }
  362. - { compiler: gcc-13, build: cmake }
  363. - { compiler: gcc-14, build: autotools }
  364. steps:
  365. - name: 'install autotools'
  366. if: ${{ matrix.build == 'autotools' }}
  367. run: |
  368. echo automake libtool | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile
  369. while [[ $? == 0 ]]; do for i in 1 2 3; do brew update && brew bundle install --no-lock --file /tmp/Brewfile && break 2 || { echo Error: wait to try again; sleep 10; } done; false Too many retries; done
  370. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  371. with:
  372. persist-credentials: false
  373. - name: 'toolchain versions'
  374. run: |
  375. [[ '${{ matrix.compiler }}' = 'llvm'* ]] && CC="$(brew --prefix ${{ matrix.compiler }})/bin/clang"
  376. [[ '${{ matrix.compiler }}' = 'gcc'* ]] && "${CC}" --print-sysroot
  377. which "${CC}"; "${CC}" --version || true
  378. xcodebuild -version || true
  379. xcrun --sdk macosx --show-sdk-path 2>/dev/null || true
  380. xcrun --sdk macosx --show-sdk-version || true
  381. ls -l /Library/Developer/CommandLineTools/SDKs || true
  382. echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::'
  383. echo '::group::brew packages preinstalled'; ls -l "$(brew --prefix)/opt"; echo '::endgroup::'
  384. - name: 'autoreconf'
  385. if: ${{ matrix.build == 'autotools' }}
  386. run: autoreconf -fi
  387. - name: 'configure / ${{ matrix.build }}'
  388. run: |
  389. if [[ '${{ matrix.compiler }}' = 'gcc'* ]]; then
  390. sysroot="$("${CC}" --print-sysroot)" # Must match the SDK gcc was built for
  391. else
  392. sysroot="$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)"
  393. fi
  394. if [[ '${{ matrix.compiler }}' = 'llvm'* ]]; then
  395. CC="$(brew --prefix ${{ matrix.compiler }})/bin/clang"
  396. CC+=" --sysroot=${sysroot}"
  397. CC+=" --target=$(uname -m)-apple-darwin"
  398. fi
  399. if [ '${{ matrix.build }}' = 'autotools' ]; then
  400. export CFLAGS
  401. if [[ '${{ matrix.compiler }}' = 'llvm'* ]]; then
  402. options+=" --target=$(uname -m)-apple-darwin"
  403. fi
  404. if [ '${{ matrix.compiler }}' != 'clang' ]; then
  405. options+=" --with-sysroot=${sysroot}"
  406. CFLAGS+=" --sysroot=${sysroot}"
  407. fi
  408. [ '${{ matrix.config }}' = 'OpenSSL' ] && options+=" --with-openssl=$(brew --prefix openssl)"
  409. [ '${{ matrix.config }}' = 'SecureTransport' ] && options+=' --with-secure-transport'
  410. [ -n '${{ matrix.macos-version-min }}' ] && CFLAGS+=' -mmacosx-version-min=${{ matrix.macos-version-min }}'
  411. # would pick up nghttp2, libidn2, but libssh2 is disabled by default
  412. mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
  413. --disable-dependency-tracking \
  414. --disable-docs --disable-manual \
  415. --without-nghttp2 --without-libidn2 \
  416. --without-libpsl \
  417. ${options}
  418. else
  419. [ '${{ matrix.config }}' = 'OpenSSL' ] && options+=' -DCURL_USE_OPENSSL=ON'
  420. [ '${{ matrix.config }}' = 'SecureTransport' ] && options+=' -DCURL_USE_SECTRANSP=ON'
  421. [ -n '${{ matrix.macos-version-min }}' ] && options+=' -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.macos-version-min }}'
  422. # would pick up nghttp2, libidn2, and libssh2
  423. cmake -B bld -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \
  424. "-DCMAKE_OSX_SYSROOT=${sysroot}" \
  425. "-DCMAKE_C_COMPILER_TARGET=$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \
  426. "-DCMAKE_IGNORE_PREFIX_PATH=$(brew --prefix)" \
  427. -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF \
  428. -DUSE_NGHTTP2=OFF -DUSE_LIBIDN2=OFF \
  429. -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF \
  430. ${options}
  431. fi
  432. - name: 'configure log'
  433. if: ${{ !cancelled() }}
  434. run: cat bld/config.log bld/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
  435. - name: 'curl_config.h'
  436. run: |
  437. echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
  438. grep -F '#define' bld/lib/curl_config.h | sort || true
  439. - name: 'build / ${{ matrix.build }}'
  440. run: make -C bld V=1 VERBOSE=1
  441. - name: 'curl version'
  442. run: bld/src/curl --disable --version