Skip to content

Commit

Permalink
Update workflow python
Browse files Browse the repository at this point in the history
  • Loading branch information
cnheitman committed Oct 31, 2023
1 parent 850c1aa commit 6f73507
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,18 @@ jobs:
- name: Create Docker image
run: bash ./src/scripts/docker/build-docker-image.sh

- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "14.0"
directory: ${{ runner.temp }}/llvm

- name: Build Wheel packages
run: |
docker run \
docker run \
--rm \
--volume $GITHUB_WORKSPACE:/src \
--volume ${{env.LLVM_PATH}}:/llvm \
build-triton-linux-x86_64 bash /src/src/scripts/docker/build-wheel-linux.sh
- name: Upload Wheel packages (Python 3.8)
Expand Down Expand Up @@ -193,23 +200,23 @@ jobs:
- name: Download Z3
run: |
wget -q https://github.com/Z3Prover/z3/releases/download/z3-4.8.17/z3-4.8.17-x64-osx-10.16.zip
unzip z3-4.8.17-x64-osx-10.16.zip
wget -q https://github.com/Z3Prover/z3/releases/download/z3-4.12.2/z3-4.12.2-x64-osx-10.16.zip -O z3-4.12.2-x64-osx-10.16.zip
unzip z3-4.12.2-x64-osx-10.16.zip
- name: Install Capstone
run: |
wget -q https://github.com/aquynh/capstone/archive/4.0.2.tar.gz
tar -xf ./4.0.2.tar.gz
cd capstone-4.0.2
bash ./make.sh
wget -q https://github.com/capstone-engine/capstone/archive/refs/tags/5.0.1.tar.gz -O capstone-5.0.1.tar.gz && \
tar xf capstone-5.0.1.tar.gz && \
cd ./capstone-5.0.1 && \
./make.sh && \
sudo make install
- name: Build Triton Python package
run: python -m build --wheel --outdir wheelhouse/default_x86_64
env:
Z3_INTERFACE: On
Z3_INCLUDE_DIRS: ${{ github.workspace }}/z3-4.8.17-x64-osx-10.16/include
Z3_LIBRARIES: ${{ github.workspace }}/z3-4.8.17-x64-osx-10.16/bin/libz3.a
Z3_INCLUDE_DIRS: ${{ github.workspace }}/z3-4.12.2-x64-osx-10.16/include
Z3_LIBRARIES: ${{ github.workspace }}/z3-4.12.2-x64-osx-10.16/bin/libz3.a
BITWUZLA_INTERFACE: On
BITWUZLA_INCLUDE_DIRS: ${{ github.workspace }}/bitwuzla/install/include
BITWUZLA_LIBRARIES: ${{ github.workspace }}/bitwuzla/install/lib/libbitwuzla.dylib
Expand Down
6 changes: 6 additions & 0 deletions src/scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ RUN yum install -y \
sudo \
wget

# LLVM dependencies.
RUN yum install -y \
libxml2-devel \
libzstd-devel \
ncurses-devel

RUN python3.10 -m pip install meson

ENV DEPENDENCIES_DIR=/tmp/triton-dependencies
Expand Down
3 changes: 2 additions & 1 deletion src/scripts/docker/build-wheel-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ set -e
# set -x # Debugging

DEPENDENCIES_DIR=/tmp/triton-dependencies
LLVM_DIR=/llvm
SOURCE_DIR=/src
WHEEL_DIR=$SOURCE_DIR/wheelhouse

Expand All @@ -32,7 +33,7 @@ export BITWUZLA_INTERFACE=On
export BITWUZLA_INCLUDE_DIRS=$DEPENDENCIES_DIR/bitwuzla/install/include
export BITWUZLA_LIBRARIES=$DEPENDENCIES_DIR/bitwuzla/install/lib64/libbitwuzla.so
export LLVM_INTERFACE=ON
export CMAKE_PREFIX_PATH=$($DEPENDENCIES_DIR/clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-/bin/llvm-config --prefix)
export CMAKE_PREFIX_PATH=$LLVM_DIR

# Build Triton Python wheel package for Python 3.8.
echo "[+] Build Triton wheel package for Python 3.8"
Expand Down

0 comments on commit 6f73507

Please sign in to comment.