Skip to content

Commit a7b8967

Browse files
committed
Merge branch 'upstream_main' into new_next
# Conflicts: # .github/workflows/deploy.yml
2 parents 3e42145 + 67aae7d commit a7b8967

4 files changed

Lines changed: 80 additions & 89 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 64 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -12,44 +12,38 @@ permissions:
1212
id-token: write
1313

1414
concurrency:
15-
group: "deploy"
15+
group: deploy-${{ github.event_name }}-${{ github.ref }}
1616
cancel-in-progress: true
1717

1818
jobs:
1919
build-android:
20-
runs-on: ubuntu-latest
20+
runs-on: ubuntu-24.04
21+
env:
22+
QT_VERSION: '6.8.1'
23+
QT_MODULES: 'qtcharts qtpositioning'
2124
strategy:
2225
fail-fast: false
2326
matrix:
2427
qtarch: [android_arm64_v8a, android_armv7]
25-
include:
26-
- qtarch: android_arm64_v8a
27-
qttarget: 'android'
28-
qtversion: '6.8.1'
29-
qtmodules: 'qtcharts qtpositioning'
30-
- qtarch: android_armv7
31-
qttarget: 'android'
32-
qtversion: '6.8.1'
33-
qtmodules: 'qtcharts qtpositioning'
34-
28+
3529
steps:
3630
- name: Install dependencies
3731
run: |
3832
sudo apt-get update
3933
sudo apt-get install -y build-essential ninja-build openjdk-17-jdk
4034
echo "JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/" >> $GITHUB_ENV
4135
# dpkg-query -L openjdk-17-jdk-headless
42-
36+
4337
- uses: actions/checkout@v4
4438
with:
4539
fetch-depth: 0
4640
fetch-tags: true
47-
41+
4842
- name: Install Qt native version (the one provided by aqt does not seem to work)
4943
uses: jurplel/install-qt-action@v4
5044
with:
5145
aqtversion: '==3.1.*'
52-
version: ${{ matrix.qtversion }}
46+
version: ${{ env.QT_VERSION }}
5347
host: 'linux'
5448
target: 'desktop'
5549
arch: 'linux_gcc_64'
@@ -59,18 +53,18 @@ jobs:
5953

6054
- name: Set QT_HOST_ROOT_DIR
6155
run: echo "QT_HOST_ROOT_DIR=${QT_ROOT_DIR}" >> "$GITHUB_ENV"
62-
56+
6357
- name: Install Qt crosscompile target version
6458
uses: jurplel/install-qt-action@v4
6559
with:
6660
aqtversion: '==3.1.*'
67-
version: ${{ matrix.qtversion }}
61+
version: ${{ env.QT_VERSION }}
6862
host: linux
69-
target: ${{ matrix.qttarget }}
63+
target: android
7064
arch: ${{ matrix.qtarch }}
7165
dir: '${{github.workspace}}/qt'
7266
install-deps: 'true'
73-
modules: ${{ matrix.qtmodules }}
67+
modules: ${{ env.QT_MODULES }}
7468
cache: true
7569

7670
- name: Make qt cross binaries executable
@@ -80,25 +74,17 @@ jobs:
8074
- name: Set reusable strings
8175
shell: bash
8276
run: |
83-
echo "QT_HOST_ROOT_DIR=${QT_ROOT_DIR}/../gcc_64" >> $GITHUB_ENV
84-
85-
echo "${QT_ROOT_DIR}/lib/cmake/Qt6Linguist:"
86-
ls ${QT_ROOT_DIR}/lib/cmake/Qt6Linguist
87-
echo "==="
88-
echo "${QT_ROOT_DIR}/../gcc_64/lib/cmake/Qt6Linguist:"
89-
ls ${QT_ROOT_DIR}/../gcc_64/lib/cmake/Qt6Linguist
90-
91-
BUILD_DIR="build"
77+
BUILD_DIR="${{ github.workspace }}/build"
9278
APK_TARGET="app"
9379
echo "BUILD_DIR=$BUILD_DIR" >> $GITHUB_ENV
9480
echo "APK_TARGET=$APK_TARGET" >> $GITHUB_ENV
9581
96-
echo "INSTALL_DIR=install/${{ matrix.qtarch }}" >> $GITHUB_ENV
82+
echo "INSTALL_DIR=${{ github.workspace }}/install/${{ matrix.qtarch }}" >> $GITHUB_ENV
9783
echo "APK_DIR=$BUILD_DIR/$APK_TARGET/android-build/build/outputs/apk/" >> $GITHUB_ENV
9884
echo "ANDROID_BUILD_DIR=$BUILD_DIR/$APK_TARGET/android-build/" >> $GITHUB_ENV
9985
echo "DEPLOYMENT_SETTINGS=$BUILD_DIR/$APK_TARGET/android-alpineapp-deployment-settings.json" >> $GITHUB_ENV
10086
101-
- name: Configure CMake
87+
- name: Configure
10288
env:
10389
CMAKE_PREFIX_PATH: ${{env.QT_ROOT_DIR}}/lib/cmake
10490
run: >
@@ -107,19 +93,16 @@ jobs:
10793
-B $BUILD_DIR
10894
-DQT_HOST_PATH=${QT_HOST_ROOT_DIR}
10995
-DCMAKE_BUILD_TYPE=Release
110-
-DALP_WWW_INSTALL_DIR=$INSTALL_DIR
11196
-DALP_ENABLE_ASSERTS=ON
112-
-DFMT_INSTALL=OFF
113-
${{ matrix.additional_cmake_flags }}
11497
-S ${{ github.workspace }}
11598
11699
- name: Build
117-
run: cmake --build $BUILD_DIR ${{ matrix.additional_build_flags }}
100+
run: cmake --build $BUILD_DIR
118101

119102
- name: Signing Android package with common key
120103
env:
121104
secret_test: ${{ secrets.KEYSTOREPASSWORD }}
122-
if: matrix.qttarget == 'android' && env.secret_test != ''
105+
if: env.secret_test != ''
123106
run: |
124107
echo ${{ secrets.SIGNINGKEYBASE64 }} > release.keystore.base64
125108
base64 -d release.keystore.base64 > release.keystore
@@ -128,7 +111,7 @@ jobs:
128111
- name: Signing Android packages with generated key
129112
env:
130113
secret_test: ${{ secrets.KEYSTOREPASSWORD }}
131-
if: matrix.qttarget == 'android' && env.secret_test == ''
114+
if: env.secret_test == ''
132115
run: |
133116
keytool -genkey -v -keystore release.keystore -alias alpinemaps -keyalg RSA -sigalg SHA1withRSA -keysize 2048 -validity 10000 -keypass asdfasdf -storepass asdfasdf -dname "CN=Franz, OU=IT, O=Furz, L=Rattenberg, ST=Tirol, C=AT"
134117
$QT_HOST_ROOT_DIR/bin/androiddeployqt --input $DEPLOYMENT_SETTINGS --output $ANDROID_BUILD_DIR --android-platform android-35 --gradle --release --sign release.keystore alpinemaps --storepass asdfasdf
@@ -150,7 +133,6 @@ jobs:
150133
echo "Oh, and I hope this saved your day :)" >> $README_PATH
151134
152135
- name: Copy android packages
153-
if: matrix.qttarget == 'android'
154136
run: |
155137
mkdir -p $INSTALL_DIR
156138
cp -r $APK_DIR/* $INSTALL_DIR
@@ -164,110 +146,111 @@ jobs:
164146

165147

166148
build-wasm:
167-
runs-on: ubuntu-latest
149+
runs-on: ubuntu-24.04
150+
env:
151+
QT_VERSION: '6.8.1'
152+
WEBASSEMBLY_VERSION: '3.1.56'
168153
strategy:
169154
fail-fast: false
170155
matrix:
171-
config: [wasm_mt, wasm_st]
156+
config: [wasm_st, wasm_st_debug, wasm_st_lto, wasm_mt, wasm_mt_debug, wasm_mt_lto]
172157
include:
173-
- config: wasm_mt_lto
174-
qtflags: '-ltcg $(cat $QT_LITE_CONFIG) -feature-thread'
175-
cmakeflags: '-DALP_ENABLE_THREADING=ON -DALP_ENABLE_ASSERTS=OFF'
176-
qtversion: '6.8.1'
177-
webassembly_version: "3.1.56"
178-
- config: wasm_st_lto
179-
qtflags: '-ltcg $(cat $QT_LITE_CONFIG) -no-feature-thread'
180-
cmakeflags: '-DALP_ENABLE_THREADING=OFF -DALP_ENABLE_ASSERTS=OFF'
181-
qtversion: '6.8.1'
182-
webassembly_version: "3.1.56"
183-
- config: wasm_mt
184-
qtflags: '$(cat $QT_LITE_CONFIG) -feature-thread'
185-
cmakeflags: '-DALP_ENABLE_THREADING=ON -DALP_ENABLE_ASSERTS=OFF'
186-
qtversion: '6.8.1'
187-
webassembly_version: "3.1.56"
188158
- config: wasm_st
189-
qtflags: '-$(cat $QT_LITE_CONFIG) -no-feature-thread'
159+
qtflags: '-release -optimize-size -submodules qtdeclarative,qtbase -skip qtlanguageserver,qtquicktimeline,qtimageformats -make libs -gui $(cat $QT_LITE_CONFIG) -no-feature-thread'
190160
cmakeflags: '-DALP_ENABLE_THREADING=OFF -DALP_ENABLE_ASSERTS=OFF'
191-
qtversion: '6.8.1'
192-
webassembly_version: "3.1.56"
193161
- config: wasm_st_debug
194-
qtflags: '-no-feature-thread'
162+
qtflags: '-release -optimize-size -submodules qtdeclarative,qtbase -skip qtlanguageserver,qtquicktimeline,qtimageformats -make libs -gui -no-feature-thread'
195163
cmakeflags: '-DALP_ENABLE_THREADING=OFF -DALP_ENABLE_ASSERTS=ON'
196-
qtversion: '6.8.1'
197-
webassembly_version: "3.1.56"
164+
- config: wasm_st_lto
165+
qtflags: '-release -optimize-size -submodules qtdeclarative,qtbase -skip qtlanguageserver,qtquicktimeline,qtimageformats -make libs -gui -ltcg $(cat $QT_LITE_CONFIG) -no-feature-thread'
166+
cmakeflags: '-DALP_ENABLE_THREADING=OFF -DALP_ENABLE_ASSERTS=OFF -DALP_ENABLE_LTO=ON'
167+
- config: wasm_mt
168+
qtflags: '-release -optimize-size -submodules qtdeclarative,qtbase -skip qtlanguageserver,qtquicktimeline,qtimageformats -make libs -gui $(cat $QT_LITE_CONFIG) -feature-thread'
169+
cmakeflags: '-DALP_ENABLE_THREADING=ON -DALP_ENABLE_ASSERTS=OFF'
170+
- config: wasm_mt_debug
171+
qtflags: '-release -optimize-size -submodules qtdeclarative,qtbase -skip qtlanguageserver,qtquicktimeline,qtimageformats -make libs -gui -feature-thread'
172+
cmakeflags: '-DALP_ENABLE_THREADING=ON -DALP_ENABLE_ASSERTS=ON'
173+
- config: wasm_mt_lto
174+
qtflags: '-release -optimize-size -submodules qtdeclarative,qtbase -skip qtlanguageserver,qtquicktimeline,qtimageformats -make libs -gui -ltcg $(cat $QT_LITE_CONFIG) -feature-thread'
175+
cmakeflags: '-DALP_ENABLE_THREADING=ON -DALP_ENABLE_ASSERTS=OFF -DALP_ENABLE_LTO=ON'
198176

199177
steps:
200178
- name: Install dependencies
201179
run: |
202180
sudo apt-get update
203181
sudo apt-get install -y build-essential ninja-build
204-
182+
205183
- uses: actions/checkout@v4
206184
with:
207185
fetch-depth: 0
208186
fetch-tags: true
209-
187+
210188
- uses: mymindstorm/setup-emsdk@v13
211189
with:
212-
version: ${{matrix.webassembly_version}}
213-
190+
version: ${{ env.WEBASSEMBLY_VERSION }}
191+
214192
- name: Install Qt native version (required for cross building)
215193
uses: jurplel/install-qt-action@v4
216194
with:
217195
aqtversion: '==3.1.*'
218-
version: ${{matrix.qtversion}}
196+
version: ${{ env.QT_VERSION }}
219197
host: linux
220198
target: 'desktop'
221199
arch: linux_gcc_64
222200
dir: '${{github.workspace}}/qt_host'
223201
install-deps: 'true'
224202
modules: 'qtshadertools'
225203
cache: true
204+
tools: 'tools_cmake'
226205

227206
- name: Set reusable strings
228207
shell: bash
229208
run: |
230-
echo "BUILD_DIR="$(pwd)/build"" >> $GITHUB_ENV
209+
echo "BUILD_DIR=$(pwd)/build" >> $GITHUB_ENV
231210
echo "INSTALL_DIR=install/${{ matrix.config}}" >> $GITHUB_ENV
232211
echo "QT_WASM_ROOT_DIR=$(pwd)/qt_wasm_lite" >> $GITHUB_ENV
233212
echo "QT_SRC_CONFIGURE=$(pwd)/qt_src/configure" >> $GITHUB_ENV
234213
echo "QT_LITE_CONFIG=$(pwd)/misc/qt_lite.txt" >> $GITHUB_ENV
235214
236-
- name: Verify emcc
237-
run: emcc -v
238-
239215
- name: Cache Qt WebAssembly build
240216
id: qt-cache
241217
uses: actions/cache@v4
242218
with:
243219
path: qt_wasm_lite
244-
key: ${{ matrix.config }}_qt-${{ matrix.qtversion }}_emcc-${{ matrix.webassembly_version }}
220+
key: ${{ matrix.config }}_qt-${{ env.QT_VERSION }}_emcc-${{ env.WEBASSEMBLY_VERSION }}
245221

246222
- name: Download and patch Qt
247223
if: steps.qt-cache.outputs.cache-hit != 'true'
248224
shell: bash
249225
run: |
250-
git clone --branch v${{matrix.qtversion}} git://code.qt.io/qt/qt5.git qt_src
251-
$QT_SRC_CONFIGURE -init-submodules -submodules qtdeclarative,qtbase -skip qtlanguageserver,qtquicktimeline,qtimageformats,qtsvg
252-
cd qt_src/qtbase
253-
git apply ../../misc/qt_68_qtbase_remove_dejavu_fonts.patch
254-
226+
git clone --branch $QT_VERSION git://code.qt.io/qt/qt5.git qt_src
227+
mkdir qt_wasm_build
228+
cd qt_wasm_build
229+
$QT_SRC_CONFIGURE -qt-host-path $QT_ROOT_DIR -platform wasm-emscripten -init-submodules -submodules qtdeclarative,qtbase -skip qtlanguageserver,qtquicktimeline,qtimageformats
230+
cd ${{github.workspace}}/qt_src/qtbase
231+
git apply ${{github.workspace}}/misc/qt_68_qtbase_remove_dejavu_fonts.patch
232+
233+
255234
- name: Build Qt for Webassembly (custom version)
256235
if: steps.qt-cache.outputs.cache-hit != 'true'
257236
shell: bash
258237
run: |
259-
dest_dir="${{env.QT_WASM_ROOT_DIR}}"
260-
mkdir qt_wasm_build
261238
cd qt_wasm_build
262-
${{env.QT_SRC_CONFIGURE}} -qt-host-path $QT_ROOT_DIR -release -optimize-size -platform wasm-emscripten -submodules qtdeclarative,qtbase -skip qtlanguageserver,qtquicktimeline,qtimageformats,qtsvg -make libs -gui ${{ matrix.qtflags }} -prefix "${QT_WASM_ROOT_DIR}/"
263-
# cat ./build.ninja
239+
${{env.QT_SRC_CONFIGURE}} -qt-host-path $QT_ROOT_DIR -platform wasm-emscripten ${{ matrix.qtflags }} -prefix "${QT_WASM_ROOT_DIR}/"
240+
# fix broken lto=thin build (https://bugreports.qt.io/browse/QTBUG-129522)
264241
sed -i 's/-flto=thin/-flto/g' ./build.ninja
265-
# echo "=============================================================================================================================================="
266-
# cat ./build.ninja
267242
cmake --build . --parallel && cmake --install .
268243
# Fail if the directory is not created or is empty
269244
[ -d "$QT_WASM_ROOT_DIR" ] && [ "$(ls -A $QT_WASM_ROOT_DIR)" ] || exit 1
270245
246+
- name: Debug output
247+
run: |
248+
emcc -v
249+
echo "cmake version:"
250+
cmake --version
251+
cd ${{ github.workspace }} && ls -l
252+
cat ./qt_wasm_build/build.ninja
253+
271254
- name: Remove StatsWindow, otherwise the webassembly will link against qtwidgets and charts.
272255
run: rm ./app/StatsWindow.qml
273256

@@ -280,7 +263,6 @@ jobs:
280263
-B $BUILD_DIR
281264
-DCMAKE_BUILD_TYPE=MinSizeRel
282265
-DALP_WWW_INSTALL_DIR=$INSTALL_DIR
283-
-DALP_ENABLE_LTO=ON
284266
-DFMT_INSTALL=OFF
285267
${{ matrix.cmakeflags }}
286268
-S ${{ github.workspace }}

.github/workflows/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [ "main" ]
88

99
concurrency:
10-
group: "linux"
10+
group: linux-${{ github.event_name }}-${{ github.ref }}
1111
cancel-in-progress: true
1212

1313
jobs:

.github/workflows/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [ "main" ]
88

99
concurrency:
10-
group: "windows"
10+
group: windows-${{ github.event_name }}-${{ github.ref }}
1111
cancel-in-progress: true
1212

1313
jobs:

cmake/alp_add_git_repository.cmake

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ function(alp_add_git_repository name)
4343
if(EXISTS "${repo_dir}/.git")
4444
message(STATUS "Updating git repo in ${short_repo_dir}")
4545

46+
# check internet connection
47+
execute_process(COMMAND ${GIT_EXECUTABLE} ls-remote ${PARAM_URL}
48+
OUTPUT_QUIET
49+
ERROR_QUIET
50+
RESULT_VARIABLE GIT_LSREMOTE_RESULT)
51+
4652
# Check if COMMITISH is a branch, tag, or commit hash
4753
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --verify ${PARAM_COMMITISH}
4854
WORKING_DIRECTORY ${repo_dir}
@@ -60,6 +66,14 @@ function(alp_add_git_repository name)
6066
if (GIT_HEAD_OUTPUT STREQUAL GIT_COMMIT_OUTPUT)
6167
message(STATUS "Repo in ${short_repo_dir} is already at ${PARAM_COMMITISH}. Skipping checkout.")
6268
else()
69+
if (${GIT_LSREMOTE_RESULT})
70+
message(WARNING "No internet connection or remote unavailable. Leaving ${name} as is.")
71+
else()
72+
message(STATUS "Fetching updates for ${name}.")
73+
execute_process(COMMAND ${GIT_EXECUTABLE} fetch
74+
WORKING_DIRECTORY ${repo_dir}
75+
RESULT_VARIABLE GIT_FETCH_RESULT)
76+
endif()
6377
message(STATUS "Checking out ${PARAM_COMMITISH} in ${name}.")
6478
execute_process(COMMAND ${GIT_EXECUTABLE} checkout --quiet ${PARAM_COMMITISH}
6579
WORKING_DIRECTORY ${repo_dir}
@@ -74,11 +88,6 @@ function(alp_add_git_repository name)
7488
# COMMITISH is likely a branch name
7589
message(STATUS "COMMITISH ${PARAM_COMMITISH} is a branch, checking for internet connection.")
7690

77-
execute_process(COMMAND ${GIT_EXECUTABLE} ls-remote ${PARAM_URL}
78-
OUTPUT_QUIET
79-
ERROR_QUIET
80-
RESULT_VARIABLE GIT_LSREMOTE_RESULT)
81-
8291
if (${GIT_LSREMOTE_RESULT})
8392
message(WARNING "No internet connection or remote unavailable. Leaving branch ${PARAM_COMMITISH} as-is.")
8493
else()

0 commit comments

Comments
 (0)