-
Notifications
You must be signed in to change notification settings - Fork 110
428 lines (385 loc) · 16 KB
/
build.yml
File metadata and controls
428 lines (385 loc) · 16 KB
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
name: Build
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
ubuntu:
strategy:
fail-fast: false
matrix:
container_version:
- '22.04'
- '24.04'
runs-on: ubuntu-latest
container: ubuntu:${{ matrix.container_version }}
steps:
- name: Install Qt
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes \
build-essential \
python3 \
python3-dev \
libpython3-dev \
qtbase5-dev \
qtbase5-private-dev \
qt5-qmake \
qtbase5-dev-tools \
qttools5-dev \
qtdeclarative5-dev \
libqt5svg5* \
libqt5xmlpatterns5* \
libqt5multimedia5* \
libqt5multimediawidgets5* \
libqt5qml5* \
libqt5quickwidgets5* \
qtmultimedia5-dev
apt-get clean
- name: Checkout PythonQt
uses: actions/checkout@v5
- name: Ccache
uses: hendrikmuhs/ccache-action@v1.2.19
with:
key: ${{ runner.os }}-ubuntu-${{ matrix.container_version }}
evict-old-files: 'job'
- name: Build PythonQt (generator_only)
run: |
export QT_SELECT=qt5
echo ======= SYSTEM INFO ========
uname -a; gcc --version | grep "gcc"; qmake --version
echo ============================
qmake -r PythonQt.pro CONFIG+=ccache CONFIG+=release CONFIG+=force_debug_info \
CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \
CONFIG+=generator_only
make -j $(nproc)
- name: Generate Wrappers
run: |
# workaround to allow to find the Qt include dirs for installed standard qt packages
mkdir /usr/include/qt5; ln -s /usr/include/x86_64-linux-gnu/qt5 /usr/include/qt5/include
export QTDIR=/usr/include/qt5
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
./generator/pythonqt_generator \
--output-directory=.
- name: Build PythonQt (exclude_generator)
run: |
export QT_SELECT=qt5
echo ======= SYSTEM INFO ========
uname -a; gcc --version | grep "gcc"; python3 --version; qmake --version
echo ============================
qmake -r PythonQt.pro CONFIG+=ccache CONFIG+=release CONFIG+=force_debug_info \
CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \
CONFIG+=exclude_generator \
PYTHON_VERSION=$(python3 --version | cut -d " " -f 2 | cut -d "." -f1,2) \
PYTHON_DIR=$(which python3 | xargs dirname | xargs dirname)
make -j $(nproc)
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
make check TESTARGS="-platform offscreen"
- name: Run memory tests with sanitizers
run: |
QT_VERSION_FULL=$(qmake -query QT_VERSION)
if [[ "$QT_VERSION_FULL" == 5.12* ]]; then
echo "leak:QPlatformIntegrationFactory::create" >> $PWD/lsan.supp
export LSAN_OPTIONS="suppressions=$PWD/lsan.supp"
fi
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=1:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
PYTHONQT_RUN_ONLY_MEMORY_TESTS=1 \
make check TESTARGS="-platform minimal"
- name: Run cleanup tests with sanitizers
run: |
# CPython 3.12 only: suppress its known interned-unicode leak that
# shows up as allocations via PyUnicode_New (python/cpython#113190).
# Fixed in 3.13 (python/cpython#113601), so we scope this to 3.12.
PYVER=$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
if [[ "$PYVER" == "3.12" ]]; then
echo "leak:PyUnicode_New" >> $PWD/lsan.supp
export LSAN_OPTIONS="suppressions=$PWD/lsan.supp"
fi
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=1:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
PYTHONQT_RUN_ONLY_CLEANUP_TESTS=1 \
PYTHONQT_DISABLE_ASYNCIO=1 \
make check TESTARGS="-platform minimal"
- name: Upload Wrappers
uses: actions/upload-artifact@v5
with:
name: wrappers_ubuntu_${{ matrix.container_version }}
path: generated_cpp
if-no-files-found: error
oldschool:
strategy:
fail-fast: false
matrix:
container_os: ['rockylinux']
container_os_version: ['9']
configuration: ['debug', 'release']
runs-on: ubuntu-latest
container: '${{ matrix.container_os }}:${{ matrix.container_os_version }}'
steps:
- name: Install Qt
run: |
yum update -y
yum groupinstall "Development Tools" -y
yum install -y \
which \
python-devel \
qt5-qtbase-* \
qt5-qttools* \
qt5-qtsvg \
qt5-qtxmlpatterns \
qt5-qtmultimedia \
qt5-qt3d \
qt5-*-devel
- name: Checkout PythonQt
uses: actions/checkout@v5
- name: Build PythonQt (generator_only)
run: |
export QT_SELECT=qt5
echo ======= SYSTEM INFO ========
uname -a; gcc --version | grep "gcc"; qmake-qt5 --version
echo ============================
qmake-qt5 -r PythonQt.pro CONFIG+=${{ matrix.configuration }} \
CONFIG+=generator_only
make -j $(nproc)
- name: Generate Wrappers
run: |
export QTDIR=/usr/include/qt5
# Specify "/usr/include" so that header "bits/wordsize.h" included from "qconfig.h" is found.
# See https://git.rockylinux.org/staging/rpms/qt5-qtbase/-/blob/r8/SOURCES/qconfig-multilib.h
./generator/pythonqt_generator \
--include-paths=/usr/include \
--output-directory=.
- name: Build PythonQt (exclude_generator)
run: |
export QT_SELECT=qt5
echo ======= SYSTEM INFO ========
which python 2>/dev/null && export PYTHON_VERSION_SUFFIX= || export PYTHON_VERSION_SUFFIX=3
uname -a; gcc --version | grep "gcc"; python${PYTHON_VERSION_SUFFIX} --version; qmake-qt5 --version
echo ============================
export PYTHON_VERSION_SHORT=`python${PYTHON_VERSION_SUFFIX} --version | cut -d " " -f 2 | cut -d "." -f1,2`
if [[ `echo ${PYTHON_VERSION_SHORT} | wc -w` = 0 ]]; then export PYTHON_VERSION_SHORT=2.7; fi
export PYTHON_DIR=`which python${PYTHON_VERSION_SUFFIX} | xargs dirname | xargs dirname`
echo PYTHON_VERSION_SHORT=${PYTHON_VERSION_SHORT}
echo PYTHON_DIR=${PYTHON_DIR}
qmake-qt5 -r PythonQt.pro CONFIG+=${{ matrix.configuration }} \
CONFIG+=exclude_generator \
"PYTHON_VERSION=${PYTHON_VERSION_SHORT}" "PYTHON_DIR=${PYTHON_DIR}"
make -j $(nproc) && \
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
make check TESTARGS="-platform offscreen"
- name: Upload Wrappers
uses: actions/upload-artifact@v5
with:
name: wrappers_${{ matrix.container_os }}-${{ matrix.container_os_version }}_${{ matrix.configuration }}
path: generated_cpp
if-no-files-found: error
macOS:
strategy:
fail-fast: false
matrix:
macos-version: ['latest']
python-version: ['3.9']
qt-version: ['5.9.*']
configuration: ['release','debug']
include:
- macos-version: 'latest'
python-version: '3.11'
qt-version: '5.12.*'
configuration: 'debug'
runs-on: macos-${{ matrix.macos-version }}
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt-version }}
host: 'mac'
target: 'desktop'
arch: 'clang_64'
modules: 'qtscript'
archives: 'qtmultimedia qtmacextras qtbase qttools'
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: '${{ matrix.python-version }}'
- name: Checkout PythonQt
uses: actions/checkout@v5
- name: Ccache
uses: hendrikmuhs/ccache-action@v1.2.19
with:
key: ${{ runner.os }}-${{ matrix.qt-version }}
evict-old-files: 'job'
- name: Detect exact versions
id : versions
run : |
set -eu
PYTHON_VERSION_FULL=$(python --version 2>&1 | cut -f 2 -d ' ')
PYTHON_VERSION_SHORT=$(cut -f 1,2 -d . <<< $PYTHON_VERSION_FULL)
QT_VERSION_FULL=$($QT_ROOT_DIR/bin/qmake -query QT_VERSION)
QT_VERSION_SHORT=$(cut -f 1,2 -d . <<< $QT_VERSION_FULL)
MACOS_VERSION_FULL=$(sw_vers -productVersion)
MACOS_VERSION_SHORT=$(cut -f 1,2 -d . <<< $MACOS_VERSION_FULL)
echo "PYTHON_VERSION_FULL=$PYTHON_VERSION_FULL" | tee -a $GITHUB_OUTPUT
echo "PYTHON_VERSION_SHORT=$PYTHON_VERSION_SHORT" | tee -a $GITHUB_OUTPUT
echo "QT_VERSION_FULL=$QT_VERSION_FULL" | tee -a $GITHUB_OUTPUT
echo "QT_VERSION_SHORT=$QT_VERSION_SHORT" | tee -a $GITHUB_OUTPUT
echo "MACOS_VERSION_FULL=$MACOS_VERSION_FULL" | tee -a $GITHUB_OUTPUT
echo "MACOS_VERSION_SHORT=$MACOS_VERSION_SHORT" | tee -a $GITHUB_OUTPUT
- name: Build PythonQt (generator_only)
run: |
set -ue
echo ======= SYSTEM INFO ========
uname -a; gcc --version | head -n 1; qmake --version
echo ============================
qmake CONFIG+=ccache CONFIG+=${{ matrix.configuration }} CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \
CONFIG+=generator_only \
-r PythonQt.pro
make -j $(nproc)
- name: Generate Wrappers
run: |
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
./generator/pythonqt_generator \
--output-directory=.
- name: Build PythonQt (exclude_generator)
run: |
set -ue
echo ======= SYSTEM INFO ========
uname -a; gcc --version | head -n 1; python --version; qmake --version
echo ============================
PYTHON_VERSION_MAJOR=$(cut -d . -f1 <<< ${{ steps.versions.outputs.PYTHON_VERSION_SHORT }})
for i in "python${{ steps.versions.outputs.PYTHON_VERSION_SHORT }}-embed" "python${{ steps.versions.outputs.PYTHON_VERSION_SHORT }}" \
"python${PYTHON_VERSION_MAJOR}-embed" "python${PYTHON_VERSION_MAJOR}"
do if pkg-config --exists "$i"; then PYTHON_PKGCONFIG_NAME="$i"; break; fi; done
qmake CONFIG+=ccache CONFIG+=${{ matrix.configuration }} CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address \
CONFIG+=exclude_generator \
PYTHON_VERSION=${{ steps.versions.outputs.PYTHON_VERSION_SHORT }} \
PYTHON_DIR="$pythonLocation" \
PKGCONFIG+=$PYTHON_PKGCONFIG_NAME \
-r PythonQt.pro
make -j $(nproc)
PYTHONDEVMODE=1 PYTHONASYNCIODEBUG=1 PYTHONWARNINGS=error PYTHONMALLOC=malloc_debug \
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
make check TESTARGS="-platform offscreen"
- name: Upload Wrappers
if: ${{ contains(matrix.configuration, 'release') }}
uses: actions/upload-artifact@v5
with:
name: wrappers_macos${{ steps.versions.outputs.MACOS_VERSION_SHORT }}_qt${{ steps.versions.outputs.QT_VERSION_SHORT }}
path: generated_cpp
if-no-files-found: error
windows:
strategy:
fail-fast: false
matrix:
qt-arch: ['win64_mingw73']
python-version: ['3.10']
qt-version: ['5.12.*']
python-arch: ['x64']
pythonqtall-config: ['']
# msvc-toolset: ['14.0']
include:
- qt-arch: 'win64_msvc2017_64'
python-version: '3.6'
python-arch: 'x64'
qt-version: '5.11.*'
# msvc-toolset: '14.16'
- qt-arch: 'win64_msvc2019_64'
python-version: '3.13'
python-arch: 'x64'
qt-version: '5.15.*'
pythonqtall-config: 'PythonQtCore PythonQtGui PythonQtMultimedia'
- qt-arch: 'win32_mingw53'
python-version: '3.6'
python-arch: 'x86'
qt-version: '5.11.*'
#Either MSVC2015 is sick or Qt5.9 is buggy :(
#Main problem is QBasicMutex with default ctor, that (by no means) is missing in dll-export of QtCore, but linker tries to find it
# - qt-arch: 'win32_msvc2015'
# python-version: '2.7'
# python-arch: 'x86'
# qt-version: '5.9.*'
# pythonqtall-config: 'PythonQtCore PythonQtGui PythonQtMultimedia'
runs-on: windows-latest
steps:
- name: Checkout PythonQt
uses: actions/checkout@v5
- name: Reset PATH
uses: egor-tensin/cleanup-path@v4
- name: Install MSVC++
uses: ilammy/msvc-dev-cmd@v1
if: ${{ contains(matrix.qt-arch, 'msvc') }}
with:
arch: amd64${{ contains(matrix.python-arch, 'x86') && '_x86' || '' }}
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt-version }}
host: 'windows'
target: 'desktop'
arch: ${{ matrix.qt-arch }}
modules: 'qtscript'
archives: 'qtwinextras qtmultimedia qtbase'
tools: ${{ contains(matrix.qt-arch, 'mingw') && format('tools_mingw,qt.tools.{0}0', matrix.qt-arch) || '' }}
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: '${{ matrix.python-version }}'
architecture: ${{ matrix.python-arch }}
- name: Detect exact versions
shell: bash
id: versions
run: |
set -eu
QT_VERSION_FULL=$("$QT_ROOT_DIR/bin/qmake" -query QT_VERSION)
QT_VERSION_SHORT=$(cut -f 1,2 -d . <<< $QT_VERSION_FULL)
PYTHON_VERSION_FULL=$(python --version 2>&1 | cut -f 2 -d ' ')
PYTHON_VERSION_SHORT=$(cut -f 1,2 -d . <<< $PYTHON_VERSION_FULL)
echo "QT_VERSION_FULL=$QT_VERSION_FULL" | tee -a $GITHUB_OUTPUT
echo "QT_VERSION_SHORT=$QT_VERSION_SHORT" | tee -a $GITHUB_OUTPUT
echo "PYTHON_VERSION_SHORT=$PYTHON_VERSION_SHORT" | tee -a $GITHUB_OUTPUT
- name: Build PythonQt (generator_only)
shell: cmd
run: |
qmake -query
qmake CONFIG+=release CONFIG-=debug_and_release CONFIG-=debug_and_release_target ^
CONFIG+=generator_only ^
PythonQt.pro
mingw32-make -j 2 ^
|| set CL=/MP && nmake
- name: Generate Wrappers
shell: cmd
run: |
set QTDIR=%QT_ROOT_DIR%
generator\pythonqt_generator ^
--output-directory=.
- name: Build PythonQt (exclude_generator)
shell: cmd
run: |
qmake -query
python --version
set PYTHONQTALL_CONFIG=${{ matrix.pythonqtall-config }}
qmake CONFIG+=release CONFIG-=debug_and_release CONFIG-=debug_and_release_target ^
CONFIG+=exclude_generator ^
"PYTHON_PATH=%pythonLocation%" ^
"PYTHON_VERSION=${{ steps.versions.outputs.PYTHON_VERSION_SHORT }}" ^
PythonQt.pro
set PYTHONDEVMODE=1
set PYTHONASYNCIODEBUG=1
set PYTHONWARNINGS=error
mingw32-make -j 2 && mingw32-make check "TESTARGS=-platform offscreen" ^
|| set CL=/MP && nmake && nmake check "TESTARGS=-platform offscreen"
- name: Upload Wrappers
if: (matrix.pythonqtall-config || '') == ''
uses: actions/upload-artifact@v5
with:
name: wrappers_${{ matrix.qt-arch }}_${{ steps.versions.outputs.QT_VERSION_SHORT }}
path: generated_cpp
if-no-files-found: error