Bug 495217 - Compiling Qt-tools with kdesrc-build on Kubuntu 24.10 results in the error "Targets not yet defined: zstd::libzstd"
Summary: Compiling Qt-tools with kdesrc-build on Kubuntu 24.10 results in the error "T...
Status: REPORTED
Alias: None
Product: kdesrc-build
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Pyne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-23 03:24 UTC by azad
Modified: 2024-10-23 04:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description azad 2024-10-23 03:24:38 UTC
Trying to compile Qt 6.7 with kdesrc-build with instructions from https://community.kde.org/Get_Involved/development/More#Build_Qt_using_kdesrc-build results in the following error when trying to compile qttools:

```
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/zstd/zstdTargets.cmake:42 (message): Some (but not all) targets in this export set were already defined.
  Targets Defined: zstd::libzstd_shared, zstd::libzstd_static
  Targets not yet defined: zstd::libzstd

Call Stack (most recent call first):
   /usr/lib/x86_64-linux-gnu/cmake/zstd/zstdConfig.cmake:42 (include)
   /home/redacted/kde/src/qtbase/cmake/FindWrapZSTD.cmake:24 (find_package)
   /home/redacted/kde/src/qtbase/cmake/QtFindPackageHelpers.cmake:141 (find_package)
   src/designer/src/lib/CMakeLists.txt:425 (qt_find_package)
```

- Kubuntu 24.10.
- Trying to compile KDE's Qt from the 6.7 branch
- (from Ubuntu apt sources) libzstd-dev = 1.5.6+dfsg-1
- (from Ubuntu apt sources) clang-19, llvm-19, libclang-19-dev, and related dev packages = 1:19.1.1-1ubuntu1

**WORKAROUND**
Disabling QtDesigner build from the command line seems to work. i.e the following full command line:

```
kdesrc-build qt6-set --cmake-options="-DQT_FEATURE_xcb=ON -DQT_FEATURE_designer=OFF -DQT_FEATURE_assistant=OFF"
```

For some reason (probably lack of knowledge), supplying the `-DQT_FEATURE_designer=OFF` or `-DQT_FEATURE_zstd=OFF` in the file `~/.local/state/sysadmin-repo-metadata/module-definitions/qt6.ksb` did not fix it.

**ADDITIONAL INFORMATION**

There are similar (but not identical) errors regarding the zstd on Qt bug tracker, but they seem to not apply here or have been fixed in version 6.7.3, which is already available during this compilation. Setting `branch 6.8` in qt6.ksb does not seem to have any effect either.
Comment 1 azad 2024-10-23 04:02:52 UTC
If you're just interested in installing Qt 6.7 on your OS, better download the online installer versions as per this part of the docs: https://community.kde.org/Get_Involved/development/More#Qt_6_installed_using_the_Qt_online_installer instead of using the provided workaround.

The time and disk space wasted for compiling Qt are totally not worth it.