From 6fb60c611f693980462231da7408b1229b32f143 Mon Sep 17 00:00:00 2001 From: CatViolet02 Date: Sat, 17 Oct 2026 17:37:55 -0400 Subject: [PATCH] Align Xcode toolchain and compile Zink launcher Added steps to align Xcode toolchain for arm64e.x1 support and compile native launcher with Zink. --- .github/workflows/arm-zink.yml | 38 +++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/.github/workflows/arm-zink.yml b/.github/workflows/arm-zink.yml index 91ee5b8..da546ef 100644 --- a/.github/workflows/arm-zink.yml +++ b/.github/workflows/arm-zink.yml @@ -11,6 +11,30 @@ jobs: runs-on: macos-latest steps: + # NUEVO: El SDK 27 trae .tbd con la arquitectura nueva "arm64e.x1-macos" + # que linkers antiguos (ld-classic del CLT, ld64.lld de LLVM < 23.1.3) + # no saben parsear -> "tapi error: malformed file ... unknown architecture". + # Fix: seleccionar el Xcode completo (su ld SI soporta arm64e.x1) y + # exportar SDKROOT para que TODOS los pasos usen ese SDK alineado. + - name: Alinear toolchain Xcode (fix tbd arm64e.x1) + run: | + XCODE_DEV="/Applications/Xcode.app/Contents/Developer" + if [ ! -d "$XCODE_DEV" ]; then + XCODE_DEV=$(ls -d /Applications/Xcode*.app/Contents/Developer 2>/dev/null | sort -V | tail -n 1 || true) + fi + if [ -n "$XCODE_DEV" ] && [ -d "$XCODE_DEV" ]; then + echo "Seleccionando: $XCODE_DEV" + sudo xcode-select -s "$XCODE_DEV" + echo "DEVELOPER_DIR=$XCODE_DEV" >> $GITHUB_ENV + echo "SDKROOT=$(xcrun --show-sdk-path)" >> $GITHUB_ENV + echo "ld en uso: $(xcrun --find ld)" + else + echo "::warning::No se encontro Xcode completo; parcheando .tbd del CLT (workaround arm64e.x1)" + SDK_PATH="$(xcrun --show-sdk-path)" + sudo find "$SDK_PATH" -name '*.tbd' -exec perl -pi -e 's/,\s*arm64e\.x1-(macos|maccatalyst)//g; s/arm64e\.x1-(macos|maccatalyst),\s*//g' {} + + echo "SDKROOT=$SDK_PATH" >> $GITHUB_ENV + fi + - name: Clonar repositorio Trinity uses: actions/checkout@v4 with: @@ -172,6 +196,11 @@ jobs: - name: Compilar launcher nativo con soporte Zink (C wrapper) run: | + echo "=== Verificacion de toolchain ===" + echo "Developer dir: $(xcode-select -p)" + echo "SDK: ${SDKROOT:-$(xcrun --show-sdk-path)}" + echo "clang: $(/usr/bin/clang --version | head -n 1)" + cat << 'LAUNCHER_EOF' > trinity_launcher.c #include #include @@ -273,14 +302,21 @@ jobs: } LAUNCHER_EOF - clang -target arm64-apple-macos14.0 \ + # Compilar con el clang de Apple (/usr/bin/clang) y el SDK alineado. + # NO usar el clang de Homebrew: su ld64.lld antiguo no soporta arm64e.x1 + # (necesitaria LLVM >= 23.1.3). El -isysroot evita resolver el SDK del CLT. + /usr/bin/clang -target arm64-apple-macos14.0 \ -o launcher \ trinity_launcher.c \ + -isysroot "${SDKROOT:-$(xcrun --show-sdk-path)}" \ -framework CoreFoundation \ -mmacosx-version-min=14.0 \ -O2 \ -Wno-deprecated-declarations + echo "=== Binario generado ===" + file launcher + - name: Crear Application Bundle con Zink y Wrapper C run: | mkdir -p dist/Trinity.app/Contents/{MacOS,Frameworks,Resources/mcpelauncher,Resources/vulkan/icd.d}