From 02f75c6c77f860386c321cdd506a8243e2ff1f1f Mon Sep 17 00:00:00 2001 From: Christian Heitman Date: Thu, 9 Apr 2026 21:43:24 -0300 Subject: [PATCH] Add CI action for installing Triton deps on macOS --- .../install-triton-deps/macos/action.yml | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/actions/install-triton-deps/macos/action.yml diff --git a/.github/actions/install-triton-deps/macos/action.yml b/.github/actions/install-triton-deps/macos/action.yml new file mode 100644 index 00000000..5f8aa32a --- /dev/null +++ b/.github/actions/install-triton-deps/macos/action.yml @@ -0,0 +1,84 @@ +name: Install Triton dependencies (macOS) + +description: Installs all dependencies required to build and test Triton on macOS + +inputs: + python-version: + description: Python version to use + default: '3.11' + llvm-version: + description: LLVM version to install + default: '17' + bitwuzla-version: + description: Bitwuzla version to install + default: '0.9.0' + capstone-version: + description: Capstone version to install + default: '5.0.7' + +runs: + using: composite + steps: + - name: Set up Python ${{ inputs.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ inputs.python-version }} + + - name: Upgrade pip + run: | + python -m pip install -U pip + shell: bash + + - name: Fix Homebrew git installation + run: | + brew update + brew reinstall git + shell: bash + + - name: Install Python build dependencies + run: | + python -m pip install setuptools importlib-resources build meson + shell: bash + + - name: Install LLVM + uses: KyleMayes/install-llvm-action@v2 + with: + version: ${{ inputs.llvm-version }} + directory: ${{ runner.temp }}/llvm + + - name: Install z3 + run: | + wget -q https://github.com/Z3Prover/z3/releases/download/z3-4.16.0/z3-4.16.0-arm64-osx-15.7.3.zip + unzip -q z3-4.16.0-arm64-osx-15.7.3.zip + echo "Z3_INCLUDE_DIRS=$GITHUB_WORKSPACE/z3-4.16.0-arm64-osx-15.7.3/include" >> $GITHUB_ENV + echo "Z3_LIBRARIES=$GITHUB_WORKSPACE/z3-4.16.0-arm64-osx-15.7.3/bin/libz3.a" >> $GITHUB_ENV + shell: bash + + - name: Install Bitwuzla + run: | + wget -q https://github.com/bitwuzla/bitwuzla/archive/refs/tags/${{ inputs.bitwuzla-version }}.tar.gz + tar -xf ${{ inputs.bitwuzla-version }}.tar.gz + cd bitwuzla-${{ inputs.bitwuzla-version }} + python ./configure.py --shared --prefix $(pwd)/install + cd build + ninja install + find . -name "libcadical*.dylib" -exec cp {} ../install/lib/ \; + cd .. + echo "BITWUZLA_INCLUDE_DIRS=$GITHUB_WORKSPACE/bitwuzla-${{ inputs.bitwuzla-version }}/install/include" >> $GITHUB_ENV + echo "BITWUZLA_LIBRARIES=$GITHUB_WORKSPACE/bitwuzla-${{ inputs.bitwuzla-version }}/install/lib/libbitwuzla.dylib" >> $GITHUB_ENV + echo "DYLD_LIBRARY_PATH=$GITHUB_WORKSPACE/bitwuzla-${{ inputs.bitwuzla-version }}/install/lib:/opt/homebrew/lib:/usr/local/lib" >> $GITHUB_ENV + shell: bash + + - name: Install Capstone + run: | + wget -q https://github.com/capstone-engine/capstone/releases/download/5.0.7/capstone-${{ inputs.capstone-version }}.tar.xz + tar -xf capstone-${{ inputs.capstone-version }}.tar.xz + cd capstone-${{ inputs.capstone-version }} + bash ./make.sh + sudo make install + shell: bash + + - name: Install Unicorn and LIEF + run: | + python -m pip install unicorn lief + shell: bash