Infomaniak / desktop-kDrive

:computer: Desktop Syncing Client for kDrive
GNU General Public License v3.0
19 stars 4 forks source link

WebViews not usable when built outside of AppImage container #191

Open nicolas-goudry opened 2 months ago

nicolas-goudry commented 2 months ago

Description

I’m trying to build kDrive as a standalone binary (without AppImage containerization) but even if I thoroughly follow the prerequisites listed here, when launching the application the login WebView is pretty much unusable. All UI updates only happen when the cursor leaves the window or when closing the right-click context menu.

Steps to reproduce

In a fresh Ubuntu 24.04 VM, run the following commands (might take a long time):

cd ~

# OS dependencies
sudo apt install -y git cmake clang autotools-dev automake libtool m4 libcurl4-openssl-dev curl build-essential qt6-base-dev zlib1g-dev pkg-config qt6-webengine-dev qt6-5compat-dev libsqlite3-dev qt6-svg-dev libsecret-1-dev qt6-tools-dev pkg-config qt6-positioning-dev

# log4cplus 2.1 build
git clone --recurse-submodules https://github.com/log4cplus/log4cplus.git
cd log4cplus
git checkout 2.1.x
mkdir -p cmake-build && cd $_
cmake .. -DUNICODE=1
sudo cmake --build . --target install

# OpenSSL 3.2 build
cd ../..
git clone https://github.com/openssl/openssl
cd openssl
git checkout tags/openssl-3.2.1
./Configure shared
make
sudo make install

# Poco 1.13 build
cd ..
git clone https://github.com/pocoproject/poco.git
cd poco
git checkout tags/poco-1.13.2-release
mkdir -p cmake-build && cd $_
cmake .. -DOPENSSL_ROOT_DIR=/usr/local -DOPENSSL_INCLUDE_DIR=/usr/local/include -DOPENSSL_CRYPTO_LIBRARY=/usr/local/lib64/libcrypto.so -DOPENSSL_SSL_LIBRARY=/usr/local/lib64/libssl.so
sudo cmake --build . --target install

# Sentry Native 0.6 build
cd ../..
git clone --recurse-submodules https://github.com/getsentry/sentry-native.git
cd sentry-native
git checkout tags/0.6.7
git submodule update --recursive
cmake -B build -DSENTRY_INTEGRATION_QT=YES -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build --parallel
sudo cmake --install build

# xxHash 0.8 build
cd ..
git clone https://github.com/Cyan4973/xxHash.git
cd xxHash
git checkout tags/v0.8.2
mkdir -p cmake_unofficial/build && cd $_
cmake ..
sudo cmake --build . --target install

# libzip 1.10 build
cd ../../..
git clone https://github.com/nih-at/libzip.git
cd libzip
git checkout tags/v1.10.1
mkdir -p cmake-build && cd $_
cmake ..
make
sudo make install

# kDrive build
cd ../..
git clone https://github.com/Infomaniak/desktop-kDrive.git
cd desktop-kDrive
git checkout tags/3.6.1
git submodule update --init --recursive
export BASEPATH=$PWD
export CONTENTDIR=$BASEPATH/build-linux
export BUILDDIR=$CONTENTDIR/build
export APPDIR=$CONTENTDIR/app
mkdir -p $APPDIR $BUILDDIR $BUILDDIR/client
cd $BUILDDIR
cmake -B$BUILDDIR -H$BASEPATH \
    -DOPENSSL_ROOT_DIR=/usr/local \
    -DOPENSSL_INCLUDE_DIR=/usr/local/include \
    -DOPENSSL_CRYPTO_LIBRARY=/usr/local/lib64/libcrypto.so \
    -DOPENSSL_SSL_LIBRARY=/usr/local/lib64/libssl.so \
    -DQT_FEATURE_neon=OFF \
    -DCMAKE_BUILDTYPE=Release \
    -DCMAKE_PREFIX_PATH=$BASEPATH \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBIN_INSTALL_DIR=$BUILDDIR/client \
    -DKDRIVE_VERSION_SUFFIX= \
    -DKDRIVE_THEME_DIR="$BASEPATH/infomaniak" \
    -DKDRIVE_VERSION_BUILD="$(date +%Y%m%d)" \
    -DBUILD_UNIT_TESTS=0
make -j$(nproc)
objcopy --only-keep-debug "./bin/kDrive" $CONTENTDIR/kDrive-amd64.dbg
objcopy --strip-debug "./bin/kDrive"
objcopy --add-gnu-debuglink=$CONTENTDIR/kDrive-amd64.dbg "./bin/kDrive"
objcopy --only-keep-debug "./bin/kDrive_client" $CONTENTDIR/kDrive_client-amd64.dbg
objcopy --strip-debug "./bin/kDrive_client"
objcopy --add-gnu-debuglink=$CONTENTDIR/kDrive_client-amd64.dbg "./bin/kDrive_client"
make DESTDIR=$APPDIR install
cp $BASEPATH/sync-exclude-linux.lst $APPDIR/usr/bin/sync-exclude.lst

# Run kDrive
../app/usr/bin/kDrive

# One could also use the CI build script instead
# cd ~/desktop-kDrive
# chmod +x ./infomaniak-build-tools/linux/build-ci-amd64.sh
# ./infomaniak-build-tools/linux/build-ci-amd64.sh
# cp sync-exclude-linux.lst build-linux/app/usr/bin/sync-exclude.lst
# ./build-linux/app/usr/bin/kDrive

Then you can reproduce the issue with these steps:

  1. Click on any of the login form input fields
    • Notice that the form don’t get the focus (at least as seen in the UI, in fact is is focused)
  2. Type something on your keyboard
    • Notice that nothing is shown in the input (but in fact the text is present in the input, it just doesn’t show)
  3. Move your mouse cursor outside the window to see the UI update
    • Alternatively, you can right-click in the window and click anywhere else than in the context menu to see the UI update

Expected behavior

One would expect to be able to build a fully working kDrive app without AppImage containerization. In fact, once you get past the login form pain, the app is usable and works fine!

Screenshots

N/A

Logs

Nothing relevant in logs but for the sake of completeness:

2024-06-26 13:58:53:977 [I] (123981144665216) log.cpp:109 - Logger initialization done
2024-06-26 13:58:53:977 [I] (123981144665216) appserver.cpp:2752 - kDrive locale:[en_US] version:[3.6.1 (build 20240626)] os:[Ubuntu 24.04 LTS]
2024-06-26 13:58:53:977 [I] (123981144665216) appserver.cpp:162 - New DB exists : /home/nicolas/.config/kDrive/.parms.db => 1
2024-06-26 13:58:53:977 [I] (123981144665216) appserver.cpp:163 - Old config exists : /home/nicolas/.config/kDrive/kDrive.cfg => 0
2024-06-26 13:58:53:977 [D] (123981144665216) db.cpp:538 - sqlite3 version=3.45.1
2024-06-26 13:58:53:977 [D] (123981144665216) db.cpp:554 - sqlite3 locking_mode=normal
2024-06-26 13:58:53:977 [D] (123981144665216) db.cpp:571 - sqlite3 journal_mode=wal
2024-06-26 13:58:53:977 [D] (123981144665216) db.cpp:590 - sqlite3 synchronous=NORMAL
2024-06-26 13:58:53:978 [D] (123981144665216) db.cpp:605 - sqlite3 case_sensitivity=ON
2024-06-26 13:58:53:978 [D] (123981144665216) db.cpp:620 - sqlite3 foreign_keys=ON
2024-06-26 13:58:53:978 [D] (123981144665216) db.cpp:328 - Check DB version
2024-06-26 13:58:53:978 [I] (123981144665216) db.cpp:419 - Prepare DB
2024-06-26 13:58:53:978 [I] (123981144665216) parmsdb.cpp:535 - ParmsDb initialization done
2024-06-26 13:58:57:232 [I] (123981144665216) appserver.cpp:250 - Adding extra plugin search path:/usr/lib/x86_64-linux-gnu/kDrive/plugins
2024-06-26 13:58:57:232 [I] (123981144665216) appserver.cpp:262 - VFS suffix plugin is available
2024-06-26 13:58:57:234 [D] (123981144665216) updaterserver.cpp:172 - Sys Info size: 0
2024-06-26 13:58:57:236 [D] (123981144665216) updaterserver.cpp:184 - https://www.infomaniak.com/drive/update/desktopclient?version=3.6.1.20240626&platform=stranger&versionsuffix=
2024-06-26 13:58:57:237 [D] (123981144665216) socketapi.cpp:126 - Creating /run/user/1000/kDrive1
2024-06-26 13:58:57:237 [I] (123981144665216) socketapi.cpp:136 - Server started - path=/run/user/1000/kDrive/socket
2024-06-26 13:58:57:237 [D] (123980784600768) commserver.cpp:348 - Worker started
2024-06-26 13:58:57:238 [D] (123981144665216) commserver.cpp:111 - Comm server started - port=38179
2024-06-26 13:58:57:238 [I] (123981144665216) appserver.cpp:3021 - Starting kDrive client - path=/home/nicolas/desktop-kDrive/build-linux/app/usr/bin/kDrive_client args=38179
2024-06-26 13:58:57:247 [D] (123981144665216) appserver.cpp:1877 - Start SyncPals - trials = 1
2024-06-26 13:58:57:577 [D] (123981144665216) commserver.cpp:125 - New connection
2024-06-26 13:58:57:579 [D] (123981144665216) commserver.cpp:194 - Rqst rcvd 0 54
2024-06-26 13:58:57:580 [D] (123981144665216) commserver.cpp:247 - Snd rpl 0
2024-06-26 13:58:57:582 [D] (123981144665216) commserver.cpp:194 - Rqst rcvd 1 49
2024-06-26 13:58:57:582 [D] (123981144665216) commserver.cpp:247 - Snd rpl 1
2024-06-26 13:58:57:586 [D] (123981144665216) commserver.cpp:194 - Rqst rcvd 2 3
2024-06-26 13:58:57:586 [D] (123981144665216) commserver.cpp:247 - Snd rpl 2
2024-06-26 13:58:57:586 [D] (123981144665216) commserver.cpp:194 - Rqst rcvd 3 7
2024-06-26 13:58:57:587 [D] (123981144665216) commserver.cpp:247 - Snd rpl 3
2024-06-26 13:58:57:587 [D] (123981144665216) commserver.cpp:194 - Rqst rcvd 4 8
2024-06-26 13:58:57:587 [D] (123981144665216) commserver.cpp:247 - Snd rpl 4
2024-06-26 13:58:57:587 [D] (123981144665216) commserver.cpp:194 - Rqst rcvd 5 15
2024-06-26 13:58:57:588 [D] (123981144665216) commserver.cpp:247 - Snd rpl 5
2024-06-26 13:58:57:698 [D] (123981144665216) commserver.cpp:194 - Rqst rcvd 6 55
2024-06-26 13:58:57:698 [D] (123981144665216) commserver.cpp:194 - Rqst rcvd 7 12
2024-06-26 13:58:57:698 [D] (123981144665216) commserver.cpp:194 - Rqst rcvd 8 12
2024-06-26 13:58:57:699 [D] (123981144665216) commserver.cpp:247 - Snd rpl 6
2024-06-26 13:58:57:699 [D] (123981144665216) commserver.cpp:247 - Snd rpl 7
2024-06-26 13:58:57:699 [D] (123981144665216) commserver.cpp:247 - Snd rpl 8
2024-06-26 13:58:57:701 [D] (123981144665216) commserver.cpp:194 - Rqst rcvd 9 56
2024-06-26 13:58:57:701 [D] (123981144665216) commserver.cpp:247 - Snd rpl 9
2024-06-26 13:58:57:727 [D] (123981144665216) commserver.cpp:194 - Rqst rcvd 10 26
2024-06-26 13:58:57:728 [D] (123981144665216) commserver.cpp:247 - Snd rpl 10
2024-06-26 13:58:57:728 [D] (123981144665216) commserver.cpp:194 - Rqst rcvd 11 12
2024-06-26 13:58:57:729 [D] (123981144665216) commserver.cpp:247 - Snd rpl 11
2024-06-26 13:58:57:730 [D] (123981144665216) commserver.cpp:194 - Rqst rcvd 12 12
2024-06-26 13:58:57:730 [D] (123981144665216) commserver.cpp:247 - Snd rpl 12
2024-06-26 13:58:58:637 [D] (123981144665216) commserver.cpp:194 - Rqst rcvd 13 38
2024-06-26 13:58:58:639 [D] (123981144665216) commserver.cpp:247 - Snd rpl 13
2024-06-26 13:59:00:147 [I] (123981144665216) kdcupdater.cpp:111 - Checking for available update.
2024-06-26 13:59:00:443 [W] (123981144665216) kdcupdater.cpp:234 - Failed to reach version check url: Error transferring https://www.infomaniak.com/drive/update/desktopclient?version=3.6.1.20240626&platform=stranger&versionsuffix= - server replied: 

Additional context

Basically, I’m trying to build a binary version of kDrive for NixOS. I managed to build the AppImage version but I have the same issue with the login form, so I tried to build it as a standalone binary and also succeeded with the same issue. I then decided to try to build it on Ubuntu as a standalone binary to see if there was the same issue, and indeed the issue arise even on Ubuntu.

I know that kDrive is not meant to be built as a standalone binary, but I believe I’m not far from a working solution, I just have to figure what the heck is going on with the login form. Would love some help on this matter!

I might add that even if in the steps to reproduce I used the Qt packages from Ubuntu repositories, I also tried the build with the Qt tools installed through Qt installer, with the same result.

yoyozbi commented 3 days ago

Any news on this ? I cannot use the client as it is right now...