-
Notifications
You must be signed in to change notification settings - Fork 538
259 lines (222 loc) · 9.79 KB
/
python.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
name: Build Python Package
on: [push, pull_request, workflow_dispatch]
env:
package-version: '1.0.0rc2'
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create Docker image
run: bash ./src/scripts/docker/build-docker-image.sh
- name: Build Wheel packages
run: |
docker run \
--rm \
-v $GITHUB_WORKSPACE:/src \
build-triton-linux-x86_64 bash /src/src/scripts/docker/build-wheel-linux.sh
- name: Upload Wheel packages (Python 3.8)
uses: actions/upload-artifact@v3
with:
name: triton_library-${{ env.package-version }}-cp38-cp38-manylinux_2_24_x86_64.whl
path: wheel-final/triton_library-${{ env.package-version }}-cp38-cp38-manylinux_2_24_x86_64.whl
if-no-files-found: warn
- name: Upload Wheel packages (Python 3.9)
uses: actions/upload-artifact@v3
with:
name: triton_library-${{ env.package-version }}-cp39-cp39-manylinux_2_24_x86_64.whl
path: wheel-final/triton_library-${{ env.package-version }}-cp39-cp39-manylinux_2_24_x86_64.whl
if-no-files-found: warn
- name: Upload Wheel packages (Python 3.10)
uses: actions/upload-artifact@v3
with:
name: triton_library-${{ env.package-version }}-cp310-cp310-manylinux_2_24_x86_64.whl
path: wheel-final/triton_library-${{ env.package-version }}-cp310-cp310-manylinux_2_24_x86_64.whl
if-no-files-found: warn
- name: Upload Wheel packages (Python 3.11)
uses: actions/upload-artifact@v3
with:
name: triton_library-${{ env.package-version }}-cp311-cp311-manylinux_2_24_x86_64.whl
path: wheel-final/triton_library-${{ env.package-version }}-cp311-cp311-manylinux_2_24_x86_64.whl
if-no-files-found: warn
# FIXME
# build-windows:
# runs-on: windows-latest
# strategy:
# matrix:
# python-version: ['3.8', '3.9', '3.10']
# include:
# - python-version: 3.8
# pycp: cp38-cp38
# pylib: python38.lib
# - python-version: 3.9
# pycp: cp39-cp39
# pylib: python39.lib
# - python-version: 3.10
# pycp: cp310-cp310
# pylib: python310.lib
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Get CMake
# uses: lukka/get-cmake@latest
# - name: Setup Windows dev environment
# uses: ilammy/msvc-dev-cmd@v1
# with:
# arch: 'x64'
# - name: Upgrade pip version
# run: |
# python -m pip install -U pip
# - name: Install build package
# run: |
# python -m pip install build
# - name: Download and build Z3
# run: |
# wget -UseBasicParsing https://github.com/Z3Prover/z3/releases/download/z3-4.8.17/z3-4.8.17-x64-win.zip -O z3-4.8.17-x64-win.zip
# tar -xf z3-4.8.17-x64-win.zip
# wget -UseBasicParsing https://github.com/Z3Prover/z3/archive/refs/tags/z3-4.8.17.zip -O z3-4.8.17.zip
# tar -xf z3-4.8.17.zip
# cd z3-z3-4.8.17
# python scripts\mk_make.py --x64 --staticlib
# cd build
# nmake
# shell: powershell
# - name: Download Capstone
# run: |
# wget -UseBasicParsing https://github.com/capstone-engine/capstone/releases/download/4.0.2/capstone-4.0.2-win64.zip -O capstone-4.0.2-win64.zip
# tar -xf capstone-4.0.2-win64.zip
# shell: powershell
# - name: Build Triton Python package
# run: python -m build --wheel
# env:
# PYTHON_VERSION: ${{ matrix.python-version }}
# PYTHON_INCLUDE_DIRS: ${{ env.pythonLocation }}\include
# PYTHON_LIBRARIES: ${{ env.pythonLocation }}\libs\${{ matrix.pylib }}
# PYTHON_LIBRARY: ${{ env.pythonLocation }}\libs\${{ matrix.pylib }}
# Z3_INCLUDE_DIRS: ${{ github.workspace }}\z3-4.8.17-x64-win\include
# Z3_LIBRARIES: ${{ github.workspace }}\z3-z3-4.8.17\build\libz3-static.lib
# CAPSTONE_INCLUDE_DIRS: ${{ github.workspace }}\capstone-4.0.2-win64\include
# CAPSTONE_LIBRARIES: ${{ github.workspace }}\capstone-4.0.2-win64\capstone.lib
# - name: Upload
# uses: actions/upload-artifact@v3
# with:
# name: triton_library-${{ env.package-version }}-${{ matrix.pycp }}-win_amd64.whl
# path: ${{ github.workspace }}/dist/triton_library-${{ env.package-version }}-${{ matrix.pycp }}-win_amd64.whl
# if-no-files-found: warn
# FIXME
#build-macos:
# runs-on: macos-latest
# strategy:
# matrix:
# python-version: ['3.8', '3.9', '3.10']
# include:
# - python-version: 3.8
# - python-version: 3.9
# - python-version: 3.10
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install LLVM and Clang
# uses: KyleMayes/install-llvm-action@v1
# with:
# version: "14.0"
# directory: ${{ runner.temp }}/llvm
# - name: Upgrade pip version
# run: |
# sudo python -m pip install -U pip
# - name: Install build package
# run: |
# sudo python -m pip install build
# - name: Download and build GMP
# run: |
# wget https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz
# tar xvf gmp-6.2.1.tar.xz
# cd gmp-6.2.1/
# ./configure --enable-cxx
# make
# make check
# make install
# - name: Download and build Bitwuzla
# run: |
# git clone https://github.com/bitwuzla/bitwuzla.git
# cd bitwuzla
# ./contrib/setup-cadical.sh
# ./contrib/setup-btor2tools.sh
# ./contrib/setup-symfpu.sh
# ./configure.sh --shared --prefix $(pwd)/install
# cd build
# make
# make install
# - name: Download Z3
# run: |
# wget 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
# - name: Install Capstone
# run: |
# wget 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
# sudo make install
# cd ../
# - name: Build Triton Python package
# run: python -m build --wheel
# env:
# PYTHON_VERSION: ${{ matrix.python-version }}
# PYTHON_LIBRARIES: ${{ env.pythonLocation }}/lib/libpython${{ matrix.python-version }}.dylib
# PYTHON_LIBRARY: ${{ env.pythonLocation }}/lib/libpython${{ matrix.python-version }}.dylib
# PYTHON_INCLUDE_DIRS: ${{ env.pythonLocation }}/include/python${{ matrix.python-version }}
# 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
# CAPSTONE_INCLUDE_DIRS: /usr/local/include
# CAPSTONE_LIBRARIES: /usr/local/lib/libcapstone.a
# BITWUZLA_INTERFACE: On
# BITWUZLA_INCLUDE_DIRS: ${{ github.workspace }}/bitwuzla/install/include
# BITWUZLA_LIBRARIES: ${{ github.workspace }}/bitwuzla/install/lib/libbitwuzla.dylib
# LLVM_INTERFACE: On
# CMAKE_PREFIX_PATH: ${{env.LLVM_PATH}}
# - name: Repair wheel package (Python 3.8)
# if: ${{ matrix.python-version == '3.8' }}
# run: |
# pip install delocate
# delocate-wheel -w wheel-final -v ${{ github.workspace }}/dist/triton_library-${{ env.package-version }}-cp38-cp38-macosx_11_0_x86_64.whl
# - name: Upload Wheel packages (Python 3.8)
# uses: actions/upload-artifact@v3
# if: ${{ matrix.python-version == '3.8' }}
# with:
# name: triton_library-${{ env.package-version }}-cp38-cp38-macosx_11_0_x86_64.whl
# path: ${{ github.workspace }}/wheel-final/triton_library-${{ env.package-version }}-cp38-cp38-macosx_11_0_x86_64.whl
# if-no-files-found: warn
# - name: Repair wheel package (Python 3.9)
# if: ${{ matrix.python-version == '3.9' }}
# run: |
# pip install delocate
# delocate-wheel -w wheel-final -v ${{ github.workspace }}/dist/triton_library-${{ env.package-version }}-cp39-cp39-macosx_11_0_x86_64.whl
# - name: Upload Wheel packages (Python 3.9)
# uses: actions/upload-artifact@v3
# if: ${{ matrix.python-version == '3.9' }}
# with:
# name: triton_library-${{ env.package-version }}-cp39-cp39-macosx_11_0_x86_64.whl
# path: ${{ github.workspace }}/wheel-final/triton_library-${{ env.package-version }}-cp39-cp39-macosx_11_0_x86_64.whl
# if-no-files-found: warn
# - name: Repair wheel package (Python 3.10)
# if: ${{ matrix.python-version == '3.10' }}
# run: |
# pip install delocate
# delocate-wheel -w wheel-final -v ${{ github.workspace }}/dist/triton_library-${{ env.package-version }}-cp310-cp310-macosx_11_0_x86_64.whl
# - name: Upload Wheel packages (Python 3.10)
# uses: actions/upload-artifact@v3
# if: ${{ matrix.python-version == '3.10' }}
# with:
# name: triton_library-${{ env.package-version }}-cp310-cp310-macosx_11_0_x86_64.whl
# path: ${{ github.workspace }}/wheel-final/triton_library-${{ env.package-version }}-cp310-cp310-macosx_11_0_x86_64.whl
# if-no-files-found: warn