Skip to content

Commit 84a8a71

Browse files
committed
qt: upgrade to Qt 6.8.2
Reason: Moonpay widget login says "you can't perform this action", fixed by a newer Chromium Version. Qt 6.5 was not new enough, but Qt 6.8 is. This bumps the min requirements for Ubuntu from 20.04 to 22.04, and for macOS from 10.14 to 12: https://doc.qt.io/qt-6/supported-platforms.html Various changes were needed: - macos bumped to 14, required for building as per the above link - the webclass being in a different worker thread caused a SIGTRAP. Since our backend calls are anyway launched in goroutines (a change done after moving webclass to a thread), we can keep this in the main thread as dispatching the call is low overhead. - qwebchannel.js update is taken from https://raw.githubusercontent.com/qt/qtwebchannel/refs/tags/v6.8.2/examples/webchannel/shared/qwebchannel.js. The only local modification is to `export const QWebChannel` and drop the manual export like in 407bb24 - libxcb-cursor0 is newly required on linux - on linux, v8_context_snapshot.bin is manually copied to the target as linuxdeployqt has not been fixed yet to do it automatically, required for QtWebEngine to launch
1 parent 561ab83 commit 84a8a71

14 files changed

+157
-130
lines changed

.containerversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
27
1+
28

.github/workflows/ci.yml

+9-10
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
name: BitBoxApp-linux-${{github.sha}}.rpm
125125
if-no-files-found: error
126126
macos:
127-
runs-on: macos-13
127+
runs-on: macos-14
128128
outputs:
129129
artifact-url: ${{ steps.upload.outputs.artifact-url }}
130130
steps:
@@ -151,9 +151,9 @@ jobs:
151151
# qtwebengine is for rendering the frontend.
152152
run: |
153153
pip install aqtinstall
154-
aqt install-qt mac desktop 6.2.4 --modules qtpositioning qtserialport qtwebchannel qtwebengine --outputdir ~/Qt
155-
echo "$HOME/Qt/6.2.4/macos/bin" >> $GITHUB_PATH
156-
echo "$HOME/Qt/6.2.4/macos/libexec" >> $GITHUB_PATH
154+
aqt install-qt mac desktop 6.8.2 --modules qtpositioning qtserialport qtwebchannel qtwebengine --outputdir ~/Qt
155+
echo "$HOME/Qt/6.8.2/macos/bin" >> $GITHUB_PATH
156+
echo "$HOME/Qt/6.8.2/macos/libexec" >> $GITHUB_PATH
157157
- name: Build macOS app
158158
run: >
159159
./scripts/github-ci.sh qt-osx;
@@ -202,7 +202,7 @@ jobs:
202202
make gomobileinit
203203
(cd $GOPATH/$GO_SRC_DIR; make ios)
204204
windows:
205-
runs-on: windows-2019
205+
runs-on: windows-2022
206206
outputs:
207207
artifact-url: ${{ steps.upload.outputs.artifact-url }}
208208
defaults:
@@ -227,16 +227,16 @@ jobs:
227227
- name: Install Qt
228228
uses: jurplel/install-qt-action@v4
229229
with:
230-
version: '6.2'
230+
version: '6.8.2'
231231
host: 'windows'
232232
target: 'desktop'
233-
arch: 'win64_msvc2019_64'
233+
arch: 'win64_msvc2022_64'
234234
modules: 'qtwebengine qtwebchannel qtpositioning'
235235
- name: Link Visual Studio editions
236236
# This is needed due to our build expecting the Community edition, but Enterprise being pre-installed
237237
shell: cmd
238238
run: |
239-
mklink /J "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"
239+
mklink /J "C:\Program Files\Microsoft Visual Studio\2022\Community" "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
240240
- name: Build Windows app
241241
run: |
242242
make qt-windows
@@ -289,8 +289,7 @@ jobs:
289289
**Oh no! [${{ steps.vars.outputs.git_sha_short }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) failed to build.**
290290
See [run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details.
291291
bitbox02-simulator:
292-
# This is a separate job because the simulator runs on Ubuntu 22.04+, while the
293-
# Docker CI image is still on Ubuntu 20.04 (the min supported version for BitBoxApp).
292+
# This is a separate job because the simulator platform requirements are independent of our CI image Ubuntu version.
294293
runs-on: ubuntu-22.04
295294
steps:
296295
- name: Clone the repo

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Changelog
22

33
## Unreleased
4+
- Reduced support for BitBox01
5+
- Fix a bug that would prevent the app to perform firmware upgrade when offline.
46

57
# 4.47.0
68
- Bundle BitBox02 firmware version v9.22.0
@@ -21,6 +23,7 @@
2123
- Create desktop shortcut by default on Windows during installation
2224
- Migrate from deprecated Walletconnect web3wallet to Reown, add Sepolia, Arbitrum, Base, and Optimism to supported chains
2325
- Added BTC Direct buy option
26+
- Upgraded to Qt 6.8.2, dropping support for macOS 11 and Ubuntu 20.04.
2427

2528
# 4.46.3
2629
- Fix camera access on linux

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
FROM thyrlian/android-sdk:4.0 as android
1515

16-
FROM ubuntu:20.04
16+
FROM ubuntu:22.04
1717

1818
ENV DEBIAN_FRONTEND noninteractive
1919

@@ -30,6 +30,6 @@ ENV PATH $GOROOT/bin:$GOPATH/bin:$PATH
3030
ADD Makefile /tmp/
3131
RUN make -C /tmp/ envinit
3232

33-
ENV PATH /opt/qt6/6.2.4/gcc_64/bin:/opt/qt6/6.2.4/gcc_64/libexec:$PATH
33+
ENV PATH /opt/qt6/6.8.2/gcc_64/bin:/opt/qt6/6.8.2/gcc_64/libexec:$PATH
3434

3535
CMD ["bash"]

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ To build the app or run the development workflow, the following dependencies nee
5050
- [Go](https://golang.org/doc/install) version 1.23
5151
- [Node.js](https://nodejs.org/) version 20.x
5252
- [NPM](https://docs.npmjs.com/about-npm-versions) version 10.x or newer
53-
- [Qt](https://www.qt.io) version 6.2.4
53+
- [Qt](https://www.qt.io) version 6.8.2
5454
- install Qt for your platform, including the WebEngine component
5555

5656
## Build the BitBoxApp

docs/BUILD.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ platforms should be viable for development, building, and use of the BitBox
44
Wallet application.
55

66
* Debian: 11 bullseye or newer
7-
* Ubuntu: 20.04+
7+
* Ubuntu: 22.04+
88
* Fedora: 36+
9-
* MacOS: 10.15+
9+
* MacOS: 12+
1010
* Windows: Windows 10+
1111

1212
## Debian, Ubuntu, and Fedora GNU/Linux with Docker
@@ -39,15 +39,15 @@ brew install [email protected]
3939
brew install create-dmg
4040
# Install Qt. Can also use the official installer.
4141
pip install aqtinstall
42-
aqt list-qt mac desktop --arch 6.2.4
43-
aqt install-qt mac desktop 6.2.4 --modules qtpositioning qtserialport qtwebchannel qtwebengine --outputdir ~/Qt
42+
aqt list-qt mac desktop --arch 6.8.2
43+
aqt install-qt mac desktop 6.8.2 --modules qtpositioning qtserialport qtwebchannel qtwebengine --outputdir ~/Qt
4444
```
4545

4646
Make sure you have `qt@6/bin`, `qt@6/libexec`, `[email protected]/bin` and `go/bin` in your PATH, i.e. add to your `.zshrc`:
4747

4848
```bash
49-
export PATH="$PATH:$HOME/Qt/6.2.4/macos/bin"
50-
export PATH="$PATH:$HOME/Qt/6.2.4/macos/libexec"
49+
export PATH="$PATH:$HOME/Qt/6.8.2/macos/bin"
50+
export PATH="$PATH:$HOME/Qt/6.8.2/macos/libexec"
5151
export PATH="$PATH:/usr/local/opt/[email protected]/bin"
5252
export PATH="$PATH:$HOME/go/bin"
5353
```
@@ -81,10 +81,10 @@ xcrun altool --list-providers --username "APPLE_ID" --password "PASSWORD"
8181

8282
## Windows
8383

84-
The build requires `Microsoft Visual Studio 2019 Community Edition`, with the `MSVC v142 - VS 2019 C++ x64/x86 build tools (Latest)`
84+
The build requires `Microsoft Visual Studio 2022 Community Edition`, with the `MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)`
8585
individual component.
8686

87-
It also requires `mingw-w64`, `bash` (e.g. `git-bash`), `make`,`go 1.23`, `node@20`, `QT 5.15.2` with `qtwebengine`, `nsis`
87+
It also requires `mingw-w64`, `bash` (e.g. `git-bash`), `make`,`go 1.23`, `node@20`, `QT 6.8.2` with `qtwebengine`, `nsis`
8888
and possibly other tools.
8989

9090
Some of the tools are easy to install with `choco`:
@@ -98,7 +98,7 @@ Add a system environment variable `MINGW_BIN` pointing to the bin directory of m
9898
(e.g. `/c/MinGW/bin` or `/c/Program Files/Git/mingw64/bin`).
9999

100100
Add to the system environment variable `PATH`:
101-
- Location of `qmake`, e.g. `C:\Qt\5.15.2\msvc2019_64\bin`
101+
- Location of `qmake`, e.g. `C:\Qt\6.8.2\msvc2022_64\bin`
102102
- Location of nsis, e.g. `C:\Program Files (x86)\NSIS\Bin`
103103

104104
Build the QT frontend for Windows: `make qt-windows`

frontends/qt/BitBox.pro

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ win32 {
4242
#QMAKE_LFLAGS += -Wl,--nxcompat
4343
#QMAKE_LFLAGS += -Wl,--dynamicbase
4444
} else {
45-
QMAKE_CXXFLAGS += -std=c++11
45+
QMAKE_CXXFLAGS += -std=c++17
4646
LIBS += -L$$PWD/server -lserver
4747
QMAKE_CXXFLAGS += $$CFORTIFY
4848
QMAKE_CXXFLAGS += $$CSTACK

frontends/qt/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ linux:
3838
# The list of related plugins was found by: `find $(qmake -query QT_INSTALL_PLUGINS) | grep wayland`
3939
-extra-plugins=platforms/libqwayland-generic.so,platforms/libqwayland-egl.so,wayland-graphics-integration-client,wayland-decoration-client,wayland-shell-integration
4040
cp /usr/lib/x86_64-linux-gnu/nss/* build/linux-tmp/lib
41+
# See https://github.com/probonopd/linuxdeployqt/issues/554#issuecomment-1761834180
42+
cp "$(shell qmake -query QT_INSTALL_DATA)/resources/v8_context_snapshot.bin" build/linux-tmp/resources
4143
cp -aR resources/linux build/tmp-deb
4244
cp resources/linux/usr/share/applications/bitbox.desktop build/linux-tmp
4345
cp resources/linux/usr/share/icons/hicolor/128x128/apps/bitbox.png build/linux-tmp
@@ -59,6 +61,7 @@ osx:
5961
mkdir build/osx
6062
mv build/BitBox.app build/osx/
6163
cp resources/MacOS/Info.plist build/osx/BitBox.app/Contents/
64+
mkdir -p build/osx/BitBox.app/Contents/Resources
6265
cp resources/MacOS/icon.icns build/osx/BitBox.app/Contents/Resources/
6366
cd build/osx/ && macdeployqt BitBox.app
6467
cp server/libserver.so build/osx/BitBox.app/Contents/Frameworks

frontends/qt/compile_windows.bat

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
:: Compiles the Qt app. Part of `make windows`, which also compiles/bundles the deps
22

3-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
3+
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
44
cd build
55
qmake ..\BitBox.pro
66
nmake
7-
COPY "%VCToolsRedistDir%\x64\Microsoft.VC142.CRT\msvcp140.dll" windows\
8-
COPY "%VCToolsRedistDir%\x64\Microsoft.VC142.CRT\msvcp140_1.dll" windows\
9-
COPY "%VCToolsRedistDir%\x64\Microsoft.VC142.CRT\msvcp140_2.dll" windows\
10-
COPY "%VCToolsRedistDir%\x64\Microsoft.VC142.CRT\msvcp140_atomic_wait.dll" windows\
11-
COPY "%VCToolsRedistDir%\x64\Microsoft.VC142.CRT\msvcp140_codecvt_ids.dll" windows\
12-
COPY "%VCToolsRedistDir%\x64\Microsoft.VC142.CRT\vccorlib140.dll" windows\
13-
COPY "%VCToolsRedistDir%\x64\Microsoft.VC142.CRT\vcruntime140.dll" windows\
14-
COPY "%VCToolsRedistDir%\x64\Microsoft.VC142.CRT\vcruntime140_1.dll" windows\
7+
COPY "%VCToolsRedistDir%\x64\Microsoft.VC143.CRT\msvcp140.dll" windows\
8+
COPY "%VCToolsRedistDir%\x64\Microsoft.VC143.CRT\msvcp140_1.dll" windows\
9+
COPY "%VCToolsRedistDir%\x64\Microsoft.VC143.CRT\msvcp140_2.dll" windows\
10+
COPY "%VCToolsRedistDir%\x64\Microsoft.VC143.CRT\msvcp140_atomic_wait.dll" windows\
11+
COPY "%VCToolsRedistDir%\x64\Microsoft.VC143.CRT\msvcp140_codecvt_ids.dll" windows\
12+
COPY "%VCToolsRedistDir%\x64\Microsoft.VC143.CRT\vccorlib140.dll" windows\
13+
COPY "%VCToolsRedistDir%\x64\Microsoft.VC143.CRT\vcruntime140.dll" windows\
14+
COPY "%VCToolsRedistDir%\x64\Microsoft.VC143.CRT\vcruntime140_1.dll" windows\

frontends/qt/main.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -379,11 +379,7 @@ int main(int argc, char *argv[])
379379
preferredLocale = uiLangs.first();
380380
}
381381

382-
QThread workerThread;
383382
webClass = new WebClass();
384-
// Run client queries in a separate thread to not block the UI.
385-
webClass->moveToThread(&workerThread);
386-
workerThread.start();
387383

388384
serve(
389385
// cppHeapFree
@@ -480,8 +476,6 @@ int main(int argc, char *argv[])
480476
delete view;
481477
view = nullptr;
482478
webClassMutex.unlock();
483-
workerThread.quit();
484-
workerThread.wait();
485479
});
486480

487481
#if defined(_WIN32)

frontends/web/.eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"plugin:react/recommended",
66
"plugin:react-hooks/recommended"
77
],
8+
"ignorePatterns": ["src/utils/qwebchannel.js"],
89
"settings": {
910
"react": {
1011
"version": "detect"

0 commit comments

Comments
 (0)