# kf6-config Multi-Arch Notes

## Previous state in Debian
We used to ship libkf6config-bin with the following contents :
    /usr/bin/kreadconfig6
    /usr/bin/kwriteconfig6
    /usr/lib/${DEB_HOST_MULTIARCH}/libexec/kf6/kconf_update
This prevented the libkf6config-bin package from being :
- either Multi-Arch: same, not coinstallable due to the binaries in /usr/bin
- or Multi-Arch: foreign, due to the kconfig-enabled application built against same arch libkf6configcore6 looking for kconf_update in that particular arch’s triplet location at runtime and failing if kconf_update is provided by a foreign architecture. (See #1103160’s initial description)

## Analysis of the KF Config framework behaviour
How kconf_update works :
- kf config is a framework for applications to manage upgrades/migrations of their data between versions
- it runs on application launch by the end-user when the application was built against the KF Config framework
- the application will link to the libKF6ConfigCore library which will :
   - look for the kconf_update binary at KCONF_UPDATE_INSTALL_LOCATION (code in src/core/kconfig.cpp in KConfig::checkUpdate())
   - which is set to "${KDE_INSTALL_FULL_LIBEXECDIR_KF}/$<TARGET_FILE_NAME:KF6::kconf_update>" (in src/core/CMakeLists.txt)
   - and run it when appropriate
- kconf_update looks for update commands to be run that are shipped by that application above linking against libKF6ConfigCore :
   - either from /usr/share/kconf_update/ for arch-independent data listing scripts to run (.upd) or scripts themselves
   - or from /usr/lib/${ARCH}/kconf_update_bin/ for arch dependent binaries
- analyzing the Debian archive using sources.debian.org showed no explicit use of the kconf_update binary outside of libkf6configcore6 code

## Solution
- Moving kconf_update from libkf6config-bin to libkf6configcore6

This will :
- make kconf_update predictibly available when being used from inside libkf6configcore6 code.
- make it possible to mark libkf6config-bin Multi-Arch: foreign since it now only contains binaries in /usr/bin
- not impact packages depending on libkf6config-bin (only plasma-workspace at the time of the writing) because they were already not using the kconf_update binary directly
