SUMMARY Ideally, building the project twice on equivalent systems should result in the same bit-by-bit result. This helps verify there's been no compromise of build systems, especially when the project is part of a larger aggregate. You can read more about this at https://reproducible-builds.org/. powerdevil seems quite close to being reproducible, but to suffer from an issue similar to https://qt-project.atlassian.net/browse/QTBUG-137440: a missing explicit library dependency in the CMakeLists.txt of a project using qml leads to a nondeterminism in what code is generated for it. In this case, I've observed a nondeterminism building version 6.5.3, in the generation of the code for ./applets/brightness/main.qml on lines :108 and :172, which have correspond to "Connections { target: screenBrightnessControl.displays }" and "Connections { target: screenBrightnessControl }". I'm not familiar enough with QML to go from here to determining what dependency might be missing, though - I'd love your assistance with that! This issue was identified while reproducing the NixOS graphical installation issue, and is tracked there as https://github.com/NixOS/nixpkgs/issues/467100 STEPS TO REPRODUCE Build powerdevil twice on "essentially the same" environment, perhaps varying the parallelism of the build (I pretty consistently get differences between running with 2 and with 16 cores) OBSERVED RESULT Different generated code / output EXPECTED RESULT The same generated code / output
It seems the "org.kde.plasma.brightness" applet is missing a dependency on the "brightnesscontrolplugin" module. However, "org.kde.plasma.brightness" is defined with "plasma_add_applet" (https://invent.kde.org/plasma/powerdevil/-/blob/master/applets/brightness/CMakeLists.txt?ref_type=heads#L9), and "plasma_add_applet" does not seem to allow adding additional dependencies (https://invent.kde.org/plasma/libplasma/-/blob/master/PlasmaMacros.cmake?ref_type=heads#L104) Is that something that should be added to libplasma? Or am I on the wrong track?
I saw https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/6075/diffs does link additional things into a "add_plasma_plugin", but doing that naively gets me: CMake Error at applets/brightness/CMakeLists.txt:20 (target_link_libraries): Target "brightnesscontrolplugin" of type MODULE_LIBRARY may not be linked into another target. One may link only to INTERFACE, OBJECT, STATIC or SHARED libraries, or to executables with the ENABLE_EXPORTS property set.
Ah doing it via 'add_dependencies' appears to have the intended effect: https://invent.kde.org/plasma/powerdevil/-/merge_requests/595 I guess you might expect the same to be needed for batterymonitor, but I haven't observed the problem there yet, so I haven't made that change.