diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6b0b0ffe..07577e57 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,37 +1,101 @@ name: Build LLVM XCFrameworks for Release -on: [push] + +on: + push: + workflow_dispatch: + jobs: prepare-build-tools: - runs-on: macos-latest - if: ${{ false }} + runs-on: macos-26 + steps: - uses: actions/checkout@v3 - - run: ./build-tools.sh + + - name: Show available Xcodes + run: | + echo "===== Installed Xcodes =====" + ls /Applications | grep Xcode || true + echo + xcodebuild -version || true + + - name: Select Xcode (prefer 26.0) + run: | + if [ -d /Applications/Xcode_26.5.app ]; then + sudo xcode-select -s /Applications/Xcode_26.5.app/Contents/Developer + fi + + echo "===== Current Xcode =====" + xcodebuild -version + echo + echo "===== SDK =====" + xcrun --sdk iphoneos --show-sdk-version + echo + echo "===== Clang =====" + clang --version + - run: | - curl -OL https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-mac.zip - unzip ninja-mac.zip - mv ninja tools/bin + mkdir -p tools/bin + + curl -s \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/ninja-build/ninja/actions/runs/30174578673/artifacts" \ + | jq -r '.artifacts[] | select(.name=="ninja-binary-archives") | .archive_download_url' \ + | xargs curl -L \ + -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -o outer.zip + + unzip -o outer.zip + unzip -o ninja-mac.zip -d tools/bin + chmod +x tools/bin/ninja + - run: tar -cJf tools.tar.xz tools/ + - uses: actions/upload-artifact@v4 with: name: tools path: tools.tar.xz build-llvm: - runs-on: macos-latest + needs: prepare-build-tools + + runs-on: macos-26 + timeout-minutes: 1200 + steps: - uses: actions/checkout@v3 + with: + submodules: true + + - name: Select Xcode (prefer 26.0) + run: | + if [ -d /Applications/Xcode_26.5.app ]; then + sudo xcode-select -s /Applications/Xcode_26.5.app/Contents/Developer + fi + + echo "===== Current Xcode =====" + xcodebuild -version + echo + echo "===== SDK =====" + xcrun --sdk iphoneos --show-sdk-version + echo + echo "===== Clang =====" + clang --version + - run: | make all - - name: create CoreCompiler framework archive - run: tar -cJf CoreCompiler.framework.tar.xz CoreCompiler.framework + + - name: create LLVM.xcframework archive + run: tar -cJf LLVM.xcframework.tar.xz LLVM.xcframework + - name: create CoreCompilerSupportLibs archive run: tar -cJf CoreCompilerSupportLibs.tar.xz CoreCompilerSupportLibs + - uses: actions/upload-artifact@v4 with: - name: CoreCompiler.framework - path: CoreCompiler.framework.tar.xz + name: LLVM.xcframework + path: LLVM.xcframework.tar.xz + - uses: actions/upload-artifact@v4 with: name: CoreCompilerSupportLibs diff --git a/Makefile b/Makefile index 9514b92c..ef3ed63a 100644 --- a/Makefile +++ b/Makefile @@ -25,10 +25,8 @@ swift: perl -i -0pe 's|(// Swift LLVM fork downstream change start\n)(.*?)(// Swift LLVM fork downstream change end\n)|$$1/* NYXIAN: apple lies, lld works fine for MachO\n$$2*/\n$$3|s' \ llvm-project/lld/MachO/InputFiles.cpp -build/LLVMClangSwift_iphoneos/llvm-macosx-x86_64: - mkdir -p build/LLVMClangSwift_iphoneos; cd build/LLVMClangSwift_iphoneos; ln -sfn llvm-macosx-arm64 llvm-macosx-x86_64 -.SwiftToolchain-iphoneos: swift build/LLVMClangSwift_iphoneos/llvm-macosx-x86_64 +.SwiftToolchain-iphoneos: swift $(call log_info,building iOS-native swift toolchain ($(SWIFT_BRANCH))) SWIFT_BRANCH="$(SWIFT_BRANCH)" SWIFT_SOURCE_DIR="$(SWIFT_SOURCE_DIR)" Scripts/build-swift-toolchain.sh build touch .SwiftToolchain-iphoneos diff --git a/Scripts/build-swift-toolchain.sh b/Scripts/build-swift-toolchain.sh index 3e1964cd..7c902f1f 100755 --- a/Scripts/build-swift-toolchain.sh +++ b/Scripts/build-swift-toolchain.sh @@ -165,8 +165,7 @@ copy_ios_install() { local build_dir="${SWIFT_BUILD_ROOT}/${SWIFT_BUILD_SUBDIR}" local install_prefix="Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr" local candidates=( - "${build_dir}/intermediate-install/iphoneos-arm64/${install_prefix}" - "${build_dir}/toolchain-macosx-arm64/${install_prefix}" + "${build_dir}/intermediate-install/iphoneos-arm64/${install_prefix}" ) local swift_build="${build_dir}/swift-iphoneos-arm64" local llvm_build="${build_dir}/llvm-iphoneos-arm64"