From 0188f2e8602a9dbdc795368f2c7e0e7d53d1fe42 Mon Sep 17 00:00:00 2001 From: dijunkun Date: Mon, 2 Nov 2026 12:35:23 +0800 Subject: [PATCH] [fix] provide host pkg-config for Xcode Cloud dependencies --- apps/ios/README.md | 11 +++++++---- apps/ios/ci_scripts/ci_post_clone.sh | 11 ++++++++++- apps/ios/scripts/build_minirtc_ios.sh | 10 ++++++---- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/apps/ios/README.md b/apps/ios/README.md index 5137a819..69ab15eb 100644 --- a/apps/ios/README.md +++ b/apps/ios/README.md @@ -150,11 +150,14 @@ Commit and push the intended signing settings and shared scheme to the branch selected by the workflow before starting a build. Xcode Cloud automatically runs `ci_scripts/ci_post_clone.sh` next to the Xcode -project. It installs Xmake, CMake, and Python 3.13 with Homebrew, prepares an +project. It installs Xmake, CMake, pkgconf, and Python 3.13 with Homebrew, prepares an isolated host Python environment with pip/setuptools/wheel, verifies the minimum -Xmake version, and initializes the pinned MiniRTC submodules. The native build -phase selects these tools again and preserves Cloud's proxy settings for package -downloads. No manual workflow PATH setting or `sudo` command is required. +Xmake version and host `pkg-config`, and initializes the pinned MiniRTC submodules. +It exposes both `pkgconf` and `pkg-config` from the Homebrew formula in the host +tool directory, allowing GLib's Meson build to resolve Xmake's iOS PCRE2 and +libffi packages instead of compiling bundled fallback versions. The native build +phase checks and selects these tools again and preserves Cloud's proxy settings +for package downloads. No manual workflow PATH setting or `sudo` command is required. For **Archive - iOS**, `ci_scripts/ci_pre_xcodebuild.sh` builds the native dependencies before `xcodebuild`, using `Release / iphoneos / arm64` to match the diff --git a/apps/ios/ci_scripts/ci_post_clone.sh b/apps/ios/ci_scripts/ci_post_clone.sh index 20b433e5..233dfec0 100755 --- a/apps/ios/ci_scripts/ci_post_clone.sh +++ b/apps/ios/ci_scripts/ci_post_clone.sh @@ -13,8 +13,9 @@ if ! command -v brew >/dev/null 2>&1; then fi echo "Installing Xcode Cloud native build tools" -brew install xmake cmake python@3.13 +brew install xmake cmake pkgconf python@3.13 BREW_PREFIX="$(brew --prefix)" +PKGCONF_PREFIX="$(brew --prefix pkgconf)" PYTHON_PREFIX="$(brew --prefix python@3.13)" # Match GitHub Actions' host Python dependencies without modifying Homebrew's @@ -25,6 +26,14 @@ PYTHON_PREFIX="$(brew --prefix python@3.13)" for tool in xmake xrepo cmake ctest cpack; do ln -sf "${BREW_PREFIX}/bin/${tool}" "${HOST_TOOLS_DIR}/bin/${tool}" done +# Meson needs the host pkg-config executable to find Xmake's iOS packages. +# Without it, GLib falls back to bundled PCRE2/libffi sources. Use the formula's +# prefix so an older pkg-config elsewhere on PATH cannot shadow this tool. +for tool in pkgconf pkg-config; do + ln -sf "${PKGCONF_PREFIX}/bin/${tool}" "${HOST_TOOLS_DIR}/bin/${tool}" +done +echo "Verifying Xcode Cloud host pkg-config" +"${HOST_TOOLS_DIR}/bin/pkg-config" --version "${HOST_TOOLS_DIR}/bin/xmake" --version > "${HOST_TOOLS_DIR}/xmake-version.txt" "${HOST_TOOLS_DIR}/bin/python3" -B "${IOS_DIR}/scripts/verify_native_build.py" \ diff --git a/apps/ios/scripts/build_minirtc_ios.sh b/apps/ios/scripts/build_minirtc_ios.sh index de34a841..dba51d4a 100755 --- a/apps/ios/scripts/build_minirtc_ios.sh +++ b/apps/ios/scripts/build_minirtc_ios.sh @@ -50,10 +50,12 @@ fi # tools again here instead of relying on exported PATH changes surviving. if [[ "${CI_XCODE_CLOUD:-}" == "TRUE" ]]; then CLOUD_HOST_BIN="${IOS_DIR}/.xmake/xcode-cloud-host/bin" - if [[ ! -x "${CLOUD_HOST_BIN}/xmake" || ! -x "${CLOUD_HOST_BIN}/python3" ]]; then - print -u2 "Xcode Cloud build tools are missing. Run ci_scripts/ci_post_clone.sh before building." - exit 69 - fi + for host_tool in xmake python3 pkg-config; do + if [[ ! -x "${CLOUD_HOST_BIN}/${host_tool}" ]]; then + print -u2 "Xcode Cloud host tool ${host_tool} is missing. Run ci_scripts/ci_post_clone.sh before building." + exit 69 + fi + done export PATH="${CLOUD_HOST_BIN}:${PATH}" fi