Skip to content

GHA: add Linux and macOS mbedTLS jobs, fix issue - #15208

Closed
vszakats wants to merge 22 commits into
curl:masterfrom
vszakats:ci-mbedtls
Closed

vszakats wants to merge 22 commits into
curl:masterfrom
vszakats:ci-mbedtls

Conversation

@vszakats

@vszakats vszakats commented Oct 8, 2024 •

Copy link
Copy Markdown
Member
  • update mbedTLS repo URL.
  • switch local mbedTLS build to use CMake, and Ninja.
    CMake build is required to create and install mbedTLS pkg-config
    files. (as of v3.6.1)
    -DCMAKE_POSITION_INDEPENDENT_CODE=ON required to avoid this error
    when linking mbedtls to libcurl.so:
    /usr/bin/ld: /home/runner/mbedtls/lib/libmbedcrypto.a(cipher.c.o): warning: relocation against `mbedtls_cipher_base_lookup_table' in read-only section `.text'
    /usr/bin/ld: /home/runner/mbedtls/lib/libmbedtls.a(ssl_tls.c.o): relocation R_X86_64_PC32 against symbol `mbedtls_x509_crt_profile_suiteb' can not be used when making a shared object; recompile with -fPIC
    /usr/bin/ld: final link failed: bad value
    
    Ref: https://github.com/curl/curl/actions/runs/11245069259/job/31264386723#step:40:43
  • make local mbedTLS build 10x smaller by omitting programs and tests.
  • GHA/linux: fix cmake warning by adding -B . option.
  • GHA/linux: add build-only cmake job for packaged mbedTLS (2.x).
  • fix compiler warning when building with mbedTLS 2.x:
    /home/runner/work/curl/curl/lib/vtls/mbedtls.c:344:1: error: ‘mbed_cipher_suite_get_str’ defined but not used [-Werror=unused-function]
      344 | mbed_cipher_suite_get_str(uint16_t id, char *buf, size_t buf_size,
          | ^~~~~~~~~~~~~~~~~~~~~~~~~
    
    Ref: https://github.com/curl/curl/actions/runs/11244999065/job/31264168295#step:40:50

Also in preparation for #15193

@vszakats vszakats added TLS cmake CI Continuous Integration labels Oct 8, 2024
@vszakats vszakats changed the title GHA: add Linux and macOS mbedTLS jobs, fix issues GHA: add Linux and macOS mbedTLS jobs, fix issue Oct 9, 2024
valgrind failing consistently with these:
```
FAIL 1631: 'FTP through HTTPS-proxy' FTP, HTTPS-proxy
FAIL 1632: 'FTP through HTTPS-proxy, with connection reuse' FTP, HTTPS-proxy
```
Ref: https://github.com/curl/curl/actions/runs/11245495669/job/31266184775?pr=15208#step:45:7131
vszakats added a commit to vszakats/curl that referenced this pull request Oct 10, 2024
CMake builds mbedTLS in Debug mode by default, which was the reason
for these consistent test failures:
```
FAIL 1631: 'FTP through HTTPS-proxy' FTP, HTTPS-proxy
FAIL 1632: 'FTP through HTTPS-proxy, with connection reuse' FTP, HTTPS-proxy
```
Sometimes also:
```
FAIL 303: 'HTTPS with 8 secs timeout' HTTPS, HTTP GET, timeout, FAILURE
```
https://github.com/curl/curl/actions/runs/11260616621/job/31313234198

Ref: curl#15215
Follow-up to e377c91 curl#15208
vszakats added a commit that referenced this pull request Oct 10, 2024
CMake builds mbedTLS in Debug mode by default, which was the reason
for these consistent test failures:
```
FAIL 1631: 'FTP through HTTPS-proxy' FTP, HTTPS-proxy
FAIL 1632: 'FTP through HTTPS-proxy, with connection reuse' FTP, HTTPS-proxy
```
Sometimes also:
```
FAIL 303: 'HTTPS with 8 secs timeout' HTTPS, HTTP GET, timeout, FAILURE
```
https://github.com/curl/curl/actions/runs/11260616621/job/31313234198

Fix it by building in `RelWithDebInfo` mode, matching the bare
`Makefile` builds used earlier. (`Release` mode also works.)

Cache sizes:
- Makefile: 10MB
- CMake Release: 1MB
- CMake RelWithDebInfo: 2.5MB

Ref: #15215
Follow-up to e377c91 #15208

Closes #15238
@vszakats
vszakats deleted the ci-mbedtls branch October 24, 2024 02:03
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
- update mbedTLS repo URL.
- switch local mbedTLS build to use CMake, and Ninja.
  CMake build is required to create and install mbedTLS `pkg-config`
  files. (as of v3.6.1)
  `-DCMAKE_POSITION_INDEPENDENT_CODE=ON` required to avoid this error
  when linking mbedtls to `libcurl.so`:
  ```
  /usr/bin/ld: /home/runner/mbedtls/lib/libmbedcrypto.a(cipher.c.o): warning: relocation against `mbedtls_cipher_base_lookup_table' in read-only section `.text'
  /usr/bin/ld: /home/runner/mbedtls/lib/libmbedtls.a(ssl_tls.c.o): relocation R_X86_64_PC32 against symbol `mbedtls_x509_crt_profile_suiteb' can not be used when making a shared object; recompile with -fPIC
  /usr/bin/ld: final link failed: bad value
  ```
  Ref: https://github.com/curl/curl/actions/runs/11245069259/job/31264386723#step:40:43
- make local mbedTLS build 10x smaller by omitting programs and tests.
- GHA/linux: fix cmake warning by adding `-B .` option.
- GHA/linux: add build-only cmake job for packaged mbedTLS (2.x).
- fix compiler warning when building with mbedTLS 2.x:
  ```
  /home/runner/work/curl/curl/lib/vtls/mbedtls.c:344:1: error: ‘mbed_cipher_suite_get_str’ defined but not used [-Werror=unused-function]
    344 | mbed_cipher_suite_get_str(uint16_t id, char *buf, size_t buf_size,
        | ^~~~~~~~~~~~~~~~~~~~~~~~~
  ```
  Ref: https://github.com/curl/curl/actions/runs/11244999065/job/31264168295#step:40:50

Also in preparation for curl#15193
Closes curl#15208
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
CMake builds mbedTLS in Debug mode by default, which was the reason
for these consistent test failures:
```
FAIL 1631: 'FTP through HTTPS-proxy' FTP, HTTPS-proxy
FAIL 1632: 'FTP through HTTPS-proxy, with connection reuse' FTP, HTTPS-proxy
```
Sometimes also:
```
FAIL 303: 'HTTPS with 8 secs timeout' HTTPS, HTTP GET, timeout, FAILURE
```
https://github.com/curl/curl/actions/runs/11260616621/job/31313234198

Fix it by building in `RelWithDebInfo` mode, matching the bare
`Makefile` builds used earlier. (`Release` mode also works.)

Cache sizes:
- Makefile: 10MB
- CMake Release: 1MB
- CMake RelWithDebInfo: 2.5MB

Ref: curl#15215
Follow-up to e377c91 curl#15208

Closes curl#15238
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration cmake TLS

Development

Successfully merging this pull request may close these issues.

1 participant