From e20413980cffae67524fd548f3cb2078df00b7ec Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 7 Aug 2024 03:15:04 +0200 Subject: [PATCH] GHA/macos: tweak toolchain dump steps - use documented flavour of `xcrun` option. - show SDK version with a dedicated command. (Sometimes the SDK path is a symlink and doesn't tell the version. This is not at the moment the case in CI, but handle it anyway.) - align group header with reality. Preinstalled vs. installed Homebrew packages can be recognized by their directory timestamps. Installed ones have a current date. Closes #14434 --- .github/workflows/macos.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 53588b898d..18e52ebe85 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -189,9 +189,10 @@ jobs: grep -h -r -E -o '.+[0-9.]+\.sdk/' "$(dirname "$("${CC}" -print-libgcc-file-name)")/include-fixed" | sed -E 's/^\t+//g' | tr -d '"' | sort -u || true which "${CC}"; "${CC}" --version || true xcodebuild -version || true - xcrun -sdk macosx --show-sdk-path 2>/dev/null || true + xcrun --sdk macosx --show-sdk-path 2>/dev/null || true + xcrun --sdk macosx --show-sdk-version || true echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::' - echo '::group::brew packages preinstalled'; ls -l "$(brew --prefix)/opt"; echo '::endgroup::' + echo '::group::brew packages installed'; ls -l "$(brew --prefix)/opt"; echo '::endgroup::' - name: 'autoreconf' run: autoreconf -fi @@ -215,8 +216,8 @@ jobs: CC+=" --target=$(uname -m)-apple-darwin" fi if [ '${{ matrix.compiler }}' != 'clang' ]; then - options+=" --with-sysroot=$(xcrun -sdk macosx --show-sdk-path 2>/dev/null)" - CFLAGS+=" --sysroot=$(xcrun -sdk macosx --show-sdk-path 2>/dev/null)" + options+=" --with-sysroot=$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)" + CFLAGS+=" --sysroot=$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)" fi mkdir bld && cd bld && ../configure --enable-warnings --enable-werror \ --disable-dependency-tracking \ @@ -323,9 +324,10 @@ jobs: grep -h -r -E -o '.+[0-9.]+\.sdk/' "$(dirname "$("${CC}" -print-libgcc-file-name)")/include-fixed" | sed -E 's/^\t+//g' | tr -d '"' | sort -u || true which "${CC}"; "${CC}" --version || true xcodebuild -version || true - xcrun -sdk macosx --show-sdk-path 2>/dev/null || true + xcrun --sdk macosx --show-sdk-path 2>/dev/null || true + xcrun --sdk macosx --show-sdk-version || true echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::' - echo '::group::brew packages preinstalled'; ls -l "$(brew --prefix)/opt"; echo '::endgroup::' + echo '::group::brew packages installed'; ls -l "$(brew --prefix)/opt"; echo '::endgroup::' - name: 'cmake configure' run: | @@ -460,7 +462,8 @@ jobs: grep -h -r -E -o '.+[0-9.]+\.sdk/' "$(dirname "$("${CC}" -print-libgcc-file-name)")/include-fixed" | sed -E 's/^\t+//g' | tr -d '"' | sort -u || true which "${CC}"; "${CC}" --version || true xcodebuild -version || true - xcrun -sdk macosx --show-sdk-path 2>/dev/null || true + xcrun --sdk macosx --show-sdk-path 2>/dev/null || true + xcrun --sdk macosx --show-sdk-version || true echo '::group::macros predefined'; "${CC}" -dM -E - < /dev/null | sort || true; echo '::endgroup::' echo '::group::brew packages preinstalled'; ls -l "$(brew --prefix)/opt"; echo '::endgroup::' @@ -574,8 +577,8 @@ jobs: CC+=" --target=$(uname -m)-apple-darwin" fi if [ '${{ matrix.compiler }}' != 'clang' ]; then - options+=" --with-sysroot=$(xcrun -sdk macosx --show-sdk-path 2>/dev/null)" - CFLAGS+=" --sysroot=$(xcrun -sdk macosx --show-sdk-path 2>/dev/null)" + options+=" --with-sysroot=$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)" + CFLAGS+=" --sysroot=$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)" fi [ '${{ matrix.config }}' = 'OpenSSL' ] && options+=" --with-openssl=$(brew --prefix openssl)" [ '${{ matrix.config }}' = 'SecureTransport' ] && options+=' --with-secure-transport' -- 2.47.3