Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion .github/workflows/arm-zink.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 <unistd.h>
#include <stdlib.h>
Expand Down Expand Up @@ -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}
Expand Down