Bug 512867 - Build is not reproducible
Summary: Build is not reproducible
Status: CONFIRMED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_powerdevil (other bugs)
Version First Reported In: 6.5.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-02 13:00 UTC by Arnout Engelen
Modified: 2025-12-14 11:08 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arnout Engelen 2025-12-02 13:00:55 UTC
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
Comment 1 Arnout Engelen 2025-12-14 10:29:29 UTC
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?
Comment 2 Arnout Engelen 2025-12-14 10:40:34 UTC
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.
Comment 3 Arnout Engelen 2025-12-14 11:08:42 UTC
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.