cmake: fix pkg-config-based detection in FindGSS.cmake

Before this patch `pkg-config`-based detection was ignored, and used
solely as a path hint for native detection.

- fix `pkg_search_module()` result prefix to match what code expects:
  `_GSS` (was: `_GSS_PKG`). Update variable that were in sync with old
  prefix.

- update the pkg-config codepath to use `_GSS_MODULE_NAME` to detect
  GSS flavour. This requires CMake 3.16.
  Otherwise fall back to the old method. (The old method doesn't seem to
  work anymore (?) as of CMake 3.30.1. Documented
  `<prefix>_<modulename>_VERSION` variable is defined, but empty.)

- update the pkg-config codepath to use `_GSS_VERSION` set by CMake.
  Resort to the old code when this variable is empty. (The old code
  doesn't seem to work anymore (?) as of CMake 3.30.1)

- fix pkg-config codepath to set the documented result variables.

- align native detection variable names with those generated by
  `pkg_search_module()` in the pkg-config codepath.

- GHA/macos: enable GSS Heimdal in a cmake job.
  Uses the native detection.

- GHA/linux: enable GSS Heimdal in cmake and autotools jobs.
  CMake uses `pkg-config`-based detection.

- suppress test 2077 and 2078 results on Linux + Heimdal.
  ```
  FAIL-IGNORED 2077: 'curl --fail --negotiate to unauthenticated service fails' HTTP, HTTP GET, GSS-API
  FAIL-IGNORED 2078: 'curl --negotiate should not send empty POST request only' HTTP, HTTP GET, GSS-API
  ```
  Failing with valgrind errors in both autotools and cmake builds:
  https://github.com/curl/curl/actions/runs/10282222581/job/28453472068?pr=14430#step:38:3638
  https://github.com/curl/curl/actions/runs/10282222581/job/28453473398?pr=14430#step:38:7831

Closes #14430
This commit is contained in:
Viktor Szakats 2024-08-07 01:19:44 +02:00
parent 2154f7c5f3
commit 146759716c
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
3 changed files with 39 additions and 32 deletions

View file

@ -78,16 +78,16 @@ jobs:
configure: CC=clang LDFLAGS="-Wl,-rpath,$HOME/bearssl/lib" --with-bearssl=$HOME/bearssl --enable-debug
singleuse: --unit
- name: libressl
install_packages: zlib1g-dev valgrind
- name: libressl heimdal
install_packages: zlib1g-dev heimdal-dev valgrind
install_steps: libressl pytest
configure: LDFLAGS="-Wl,-rpath,$HOME/libressl/lib" --with-openssl=$HOME/libressl --enable-debug
configure: LDFLAGS="-Wl,-rpath,$HOME/libressl/lib" --with-openssl=$HOME/libressl --with-gssapi --enable-debug
singleuse: --unit
- name: libressl
install_packages: zlib1g-dev valgrind
- name: libressl heimdal
install_packages: zlib1g-dev heimdal-dev valgrind
install_steps: libressl pytest
generate: -DOPENSSL_ROOT_DIR=$HOME/libressl -DENABLE_DEBUG=ON -DCURL_LIBCURL_VERSIONED_SYMBOLS=ON
generate: -DOPENSSL_ROOT_DIR=$HOME/libressl -DCURL_USE_GSSAPI=ON -DENABLE_DEBUG=ON -DCURL_LIBCURL_VERSIONED_SYMBOLS=ON
singleuse: --unit
- name: libressl-clang
@ -468,10 +468,13 @@ jobs:
if: ${{ matrix.build.generate }}
name: 'make tests (cmake)'
- run: make V=1 VERBOSE=1 test-ci
name: 'run tests'
env:
TFLAGS: "${{ matrix.build.tflags }}"
- name: 'run tests'
run: |
export TFLAGS='${{ matrix.build.tflags }}'
if [[ '${{ matrix.build.install_packages }}' = *'heimdal-dev'* ]]; then
TFLAGS+=' ~2077 ~2078' # valgrind errors
fi
make V=1 VERBOSE=1 test-ci
- if: contains(matrix.build.install_steps, 'pytest')
# run for `tests` directory, so pytest does not pick up any other

View file

@ -283,9 +283,9 @@ jobs:
- name: 'SecureTransport ws debug+'
generate: -DCURL_USE_SECTRANSP=ON -DENABLE_WEBSOCKETS=ON -DENABLE_DEBUG=ON -DENABLE_CURLDEBUG=ON
macos-version-min: '10.8'
- name: 'LibreSSL !ldap'
install: libressl
generate: -DOPENSSL_ROOT_DIR=$(brew --prefix libressl) -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON -DBUILD_EXAMPLES=ON
- name: 'LibreSSL !ldap heimdal'
install: libressl heimdal
generate: -DOPENSSL_ROOT_DIR=$(brew --prefix libressl) -DCURL_USE_GSSAPI=ON -DGSS_ROOT_DIR=$(brew --prefix heimdal) -DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON -DBUILD_EXAMPLES=ON
macos-version-min: '10.15'
- name: 'wolfSSL !ldap'
install: wolfssl