VCPKG process fails while compiling QCA dependency

Hi everyone,

I’m really sorry to bother the community, but I’m not able to compile QField throughout the vcpkg compilation processes. The compilation always fails at the step of compiling Qca dependency. After much research, I haven’t been able to find the solution to this.

This issue occurs when compiling the project for Android on a Manjaro Linux distro as well as when compiling for iOS on macOS. However, the docker image for android using Ubuntu works well.

Am I forgetting a step or something ?

Sincerely,


Imported from GitHub discussion by @MARC-GEOCODE on 2023-02-24T16:48:22Z

Hi GeoCode-Dev, can you share the exact commands you are running and the errors you are getting?


Imported from GitHub comment by @m-kuhn on 2023-03-29T06:31:46Z

Hi. Thanks a lot for the reply.

So, on Manjora Linux. I’ve tried to compile QField outside of the given docker script (witch works well), and it’s always failing at task around 66 up to 88. It’s when “vcpkg” try to compile “Qca”.

So, the commands are those:

echo -e "y" | /opt/android-sdk/cmdline-tools/latest/bin/sdkmanager "ndk;22.1.7171670"  # For ndk installation (Qt5 requirement)

echo -e "y" | sudo pacman -Sy --needed jdk8-openjdk && sudo archlinux-java set java-8-openjdk # To set up Java 8 (Qt5 requirement)

export ANDROID_NDK_HOME=/opt/android-sdk/ndk/22.1.7171670/ # Export ndk

cmake -S /opt/qfield -B /opt/qfield/qfield-build-android -DVCPKG_TARGET_TRIPLET=arm64-android -DWITH_VCPKG=ON -DSYSTEM_QT=ON # To compile the dependencies with VCPKG

Then, i get this message on the terminal :

`
Building qca[core]:arm64-android…
– [OVERLAY] Loading triplet configuration from: /opt/qfield/vcpkg/triplets/arm64-android.cmake
– Installing port from location: /opt/qfield/vcpkg/overlay/qca
– Downloading https://github.com/KDE/qca/archive/v2.3.4.tar.gz → KDE-qca-v2.3.4.tar.gz…
– Extracting source /opt/qfield/qfield-build-android/_deps/vcpkg-src/downloads/KDE-qca-v2.3.4.tar.gz
– Applying patch 0001-fix-path-for-vcpkg.patch
– Applying patch 0002-fix-build-error.patch
– Applying patch fix-static.patch
– Applying patch ios.patch
– Using source at /opt/qfield/qfield-build-android/_deps/vcpkg-src/buildtrees/qca/src/v2.3.4-0d8566d20c.clean
– Importing certstore
– Importing certstore done
– Found external ninja(‘1.11.1’).
– Configuring arm64-android
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:112 (message):
Command failed: /usr/bin/ninja -v
Working Directory: /opt/qfield/qfield-build-android/_deps/vcpkg-src/buildtrees/qca/arm64-android-rel/vcpkg-parallel-configure
Error code: 1
See logs for more information:
/opt/qfield/qfield-build-android/_deps/vcpkg-src/buildtrees/qca/config-arm64-android-rel-CMakeCache.txt.log
/opt/qfield/qfield-build-android/_deps/vcpkg-src/buildtrees/qca/config-arm64-android-out.log

Call Stack (most recent call first):
/opt/qfield/qfield-build-android/vcpkg_installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_configure.cmake:248 (vcpkg_execute_required_process)
/opt/qfield/vcpkg/overlay/qca/portfile.cmake:58 (vcpkg_cmake_configure)
scripts/ports.cmake:147 (include)

error: building qca:arm64-android failed with: BUILD_FAILED
error: Please ensure you’re using the latest port files with git pull and vcpkg update.
Then check for known issues at:
GitHub · Where software is built
You can submit a new issue at:
Sign in to GitHub · GitHub
Include ‘[qca] Build error’ in your bug report title, the following version information in your bug description, and attach any relevant failure logs from above.
vcpkg-tool version: 2022-12-14-7ae0d8527fb488fde10a89c2813802dc9b03b6f9
vcpkg-scripts version: e69dd972b 2023-01-20 (10 weeks ago)
`

On macOS to get the iOS app, I adapt the commands for the system but the error message is the same. So it doesn’t seem to come from the system but maybe something I’ve missed ?

Sincerely,


Imported from GitHub comment by @MARC-GEOCODE on 2023-03-29T13:53:11Z

Check these logs for more information:

/opt/qfield/qfield-build-android/_deps/vcpkg-src/buildtrees/qca/config-arm64-android-rel-CMakeCache.txt.log
/opt/qfield/qfield-build-android/_deps/vcpkg-src/buildtrees/qca/config-arm64-android-out.log


Imported from GitHub comment by @m-kuhn on 2023-03-29T14:16:45Z

Hi Matthias,

I’ve tried many things, but still, outside the docker script the compilation process fails when building Qca.

So for more information, I’ve tried to build QField for iOS on macOS Ventura with this command:

cmake -S . -B build-arm64-ios -DCMAKE_PREFIX_PATH=/Users/marc/Documents/qt5/5.15.2/ios/lib/cmake/Qt5 -DVCPKG_TARGET_TRIPLET=arm64-ios -GXcode -DWITH_VCPKG=ON -DSYSTEM_QT=ON -DCMAKE_FIND_ROOT_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64

Then the log files return this error. It looks like “CMake” can’t find Qt directory even thought I’ve specified the path in the command. Did someone manage to overcome this issue ?

`-- Building Qt 5 version
CMake Error at /Users/marc/Documents/qfield/build-arm64-ios/vcpkg_installed/arm64-ios/share/qt5/vcpkg-cmake-wrapper.cmake:94 (_find_package):
By not providing “FindQt5.cmake” in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by “Qt5”, but
CMake did not find one.

Could not find a package configuration file provided by “Qt5” (requested
version 5.14) with any of the following names:

Qt5Config.cmake
qt5-config.cmake

Add the installation prefix of “Qt5” to CMAKE_PREFIX_PATH or set “Qt5_DIR”
to a directory containing one of the above files. If “Qt5” provides a
separate development package or SDK, be sure it has been installed.`

Sincerely,


Imported from GitHub comment by @MARC-GEOCODE on 2023-04-13T10:47:40Z

Strange, did you follow the steps in the ios build guide, in particular the aqt install-qt and export Qt5_DIR commands?


Imported from GitHub comment by @m-kuhn on 2023-04-13T11:29:37Z

Hi Matthias,

Thanks for your help. So, I needed to adapt the commands a bit, but overall, I’ve successfully compiled all the dependencies. However, I’ve reached another issue almost at the end of cmake configuration. After trying many possibilities, I didn’t see where this issue could come from. Have you seen something similar ?

Full shell commands :

`cd Documents && git clone GitHub - opengisch/QField: A simplified touch optimized interface for QGIS qfield && cd qfield

pip3 install aqtinstall && aqt install-qt mac ios 5.15.2 -O qt5 -m qtcharts

export PATH=“$(brew --prefix flex)/bin:$PATH” && export PATH=“$(brew --prefix bison)/bin:$PATH”

export Qt5_DIR=/Users/marc/Documents/qfield/qt5/5.15.2/ios/

cmake -S . -B build-arm64-ios
-DCMAKE_PREFIX_PATH=/Users/marc/Documents/qfield/qt5/5.15.2/ios/lib/cmake/Qt5
-DCMAKE_FIND_ROOT_PATH=/Users/marc/Documents/qfield/qt5/5.15.2/ios/
-DSYSTEM_QT=ON
-DWITH_QT5=1
-DVCPKG_TARGET_TRIPLET=arm64-ios
-DWITH_VCPKG=ON
-DVCPKG_BUILD_TYPE=release
-DCMAKE_SYSTEM_NAME=iOS
-DCMAKE_OSX_SYSROOT=iphoneos
-DCMAKE_OSX_ARCHITECTURES=arm64
-GXcode`

And the issue about PROJ version configuration :

`-- Found Libtasn1: /Users/marc/Documents/qfield/build-arm64-ios/vcpkg_installed/arm64-ios/include
– Found PROJ: /Users/marc/Documents/qfield/build-arm64-ios/vcpkg_installed/arm64-ios/lib/libproj.a (found version “9.2.0”)
– Found ZLIB: /Users/marc/Documents/qfield/build-arm64-ios/vcpkg_installed/arm64-ios/lib/libz.a (found suitable version “1.2.13”, minimum required is “1”)
– Found Iconv: /Users/marc/Documents/qfield/build-arm64-ios/vcpkg_installed/arm64-ios/lib/libiconv.a
– Found ZLIB: /Users/marc/Documents/qfield/build-arm64-ios/vcpkg_installed/arm64-ios/lib/libz.a (found version “1.2.13”)
– Found OpenSSL: /Users/marc/Documents/qfield/build-arm64-ios/vcpkg_installed/arm64-ios/lib/libcrypto.a (found version “1.1.1n”) found components: SSL Crypto

CMake Error at build-arm64-ios/_deps/vcpkg-src/scripts/buildsystems/vcpkg.cmake:852 (_find_package):

Could not find a configuration file for package “PROJ” that is compatible with requested version “9”.

The following configuration files were considered but not accepted:

/Users/marc/Documents/qfield/build-arm64-ios/vcpkg_installed/arm64-ios/share/proj/proj-config.cmake, version: 9.2.0 (target = iOS-aarch64)

Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.26.3/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package)
build-arm64-ios/vcpkg_installed/arm64-ios/share/gdal/GDALConfig.cmake:22 (find_dependency)
build-arm64-ios/vcpkg_installed/arm64-ios/share/gdal/vcpkg-cmake-wrapper.cmake:13 (_find_package)
build-arm64-ios/_deps/vcpkg-src/scripts/buildsystems/vcpkg.cmake:806 (include)
CMakeLists.txt:144 (find_package)`


Imported from GitHub comment by @MARC-GEOCODE on 2023-04-17T13:52:11Z

That is something that is not perfect in the ios build system. You can mitigate it by manually editing the file build/CMakeFiles/[version]/CMakeSystem.cmake and adjusting a variable, unfortuantely I’m not completely sure which one it was, possibly CMAKE_SYSTEM_PROCESSOR.


Imported from GitHub comment by @m-kuhn on 2023-04-17T14:56:11Z

Hi Matthias,

Thanks a lot for the help. I’ve successfully managed to build and install a custom QField on my devices.

I’ve made a pull request on the main branch in which one I have added all the needed steps into the build guide (qfield/doc/dev.md).

Sincerely,


Imported from GitHub comment by @MARC-GEOCODE on 2023-04-27T13:58:54Z