Skip to content

Conversation

@calsys456
Copy link
Contributor

@calsys456 calsys456 commented Jan 23, 2026

Since the removal of greeter, helper and auth, and the refactor of existing components, many old dependencies is exactly obsolete today. Remove them.

Summary by Sourcery

Clean up obsolete dependencies and configuration while tightening build warnings and simplifying logging and Qt usage.

Enhancements:

  • Treat compiler warnings as errors to enforce stricter build quality.
  • Simplify and modernize build configuration by replacing custom FindPAM with pkg-config modules and dropping unused QML- and helper-related settings and code.
  • Remove optional journald feature flag and always use systemd journal logging when available, simplifying message handling.
  • Streamline Qt usage to Qt6 DBus/Network only and remove unused QML-related paths and plugins from build and Nix flake.
  • Improve session leader robustness by checking write() results when communicating session IDs and PIDs over pipes.

Build:

  • Require PkgConfig and switch to pkg_search_module for PAM, systemd, libsystemd, libxau, and Wayland client detection.
  • Remove deprecated journald and QML-related CMake options and definitions, and drop unused QT policy configuration.

Chores:

  • Drop unused pixman dependency and QML import configuration from Nix packaging.

Since the removal of greeter, helper and auth, and the refactor of
existing components, many old dependencies is exactly obsolete today.
Remove them.
@deepin-ci-robot
Copy link

Hi @calsys456. Thanks for your PR.

I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 23, 2026

Reviewer's Guide

Cleans up build and packaging dependencies after removal of greeter/helper/auth/QML components, modernizes pkg-config usage, simplifies Qt usage to Qt6 Core/DBus/Network, removes optional journald feature flagging in favor of always using libsystemd journald logging, and tightens error handling and build warnings.

Sequence diagram for daemon logging via journald and fallback handlers

sequenceDiagram
    participant Qt as QtLoggingSystem
    participant Daemon as DaemonCode
    participant MH as DDM_MessageHandler
    participant Journald as systemd_journal
    participant FileLog as LogFile
    participant Stderr as stderr

    Qt->>Daemon: qInfo/qWarning/qCritical(msg)
    Daemon->>MH: DaemonMessageHandler(type, context, msg)
    MH->>MH: messageHandler(type, context, prefix, msg)
    MH->>MH: isInteractive = isatty(STDERR_FILENO) && qgetenv(USER) != dde
    alt non_interactive
        MH->>Journald: journaldLogger(type, context, msg)
    else interactive
        MH->>FileLog: standardLogger(type, msg)
        FileLog-->>MH: append to log file
        MH->>Stderr: stderrLogger(type, msg)
    end
Loading

Sequence diagram for Auth SessionLeader pipe writes with error handling

sequenceDiagram
    participant Parent as ParentProcess
    participant SL as SessionLeader
    participant Pipe as UnixPipe

    Parent->>SL: fork and set up pipe

    SL->>SL: xdgSessionId = getenv(XDG_SESSION_ID)
    SL->>Pipe: write(pipefd[1], &xdgSessionId, sizeof(int))
    alt write_xdgSessionId_failed
        Pipe-->>SL: return < 0
        SL->>SL: qCritical Failed to write XDG_SESSION_ID
        SL->>SL: exit(1)
    else write_xdgSessionId_ok
        Pipe-->>SL: return >= 0
        SL->>SL: start UserSession
        SL->>SL: sessionPid = session.processId()
        SL->>Pipe: write(pipefd[1], &sessionPid, sizeof(qint64))
        alt write_sessionPid_failed
            Pipe-->>SL: return < 0
            SL->>SL: qCritical Failed to write session PID
            SL->>SL: exit(1)
        else write_sessionPid_ok
            Pipe-->>SL: return >= 0
            SL-->>Parent: pipe conveys xdgSessionId and sessionPid
            SL->>SL: session.waitForFinished(-1)
        end
    end
Loading

Class diagram for updated DDM MessageHandler logging functions

classDiagram
    namespace DDM {
        class MessageHandlerFunctions {
            +static void journaldLogger(QtMsgType type, QMessageLogContext context, QString msg)
            +static void standardLogger(QtMsgType type, QString msg)
            +static void stderrLogger(QtMsgType type, QString msg)
            +static void messageHandler(QtMsgType type, QMessageLogContext context, QString prefix, QString msg)
            +static void DaemonMessageHandler(QtMsgType type, QMessageLogContext context, QString msg)
        }
    }
Loading

File-Level Changes

Change Details Files
Simplify and harden top-level CMake configuration and dependencies
  • Require PkgConfig instead of optional use
  • Switch from legacy pkg_check_modules to pkg_search_module with IMPORTED_TARGET for PAM, systemd, libsystemd, Xau, and Wayland client
  • Drop ENABLE_JOURNALD option and associated HAVE_SYSTEMD/HAVE_JOURNALD definitions and logic
  • Change compiler flags to treat warnings as errors via -Werror
  • Limit Qt6 find_package to Core, DBus, and Network modules and remove unused QML-related install paths
CMakeLists.txt
Update daemon/common targets to use new pkg-config targets and Qt6-only linkage
  • Remove manual include_directories for Xau and local WAYLAND search in daemon target
  • Replace Qt${QT_MAJOR_VERSION} usage with explicit Qt6::DBus and Qt6::Network
  • Link daemon against PkgConfig::Pam, PkgConfig::LibSystemd, and PkgConfig::WaylandClient
  • Link common against PkgConfig::LibXau and remove unused QML/Network/DBus link variants
  • Remove conditional linkage on JOURNALD_LIBRARIES
src/daemon/CMakeLists.txt
src/common/CMakeLists.txt
Always use journald-based logging and drop obsolete message handlers
  • Remove HAVE_JOURNALD guards around inclusion and use of <systemd/sd-journal.h>
  • Simplify messageHandler to always consider journald (with interactive-session check) without compile-time feature flags
  • Delete HelperMessageHandler and GreeterMessageHandler entry points that are no longer used
src/common/MessageHandler.h
Improve robustness of inter-process communication in Auth session leader
  • Check the return value of write() when sending XDG_SESSION_ID and session PID to the parent process
  • On write failure, log a critical error with strerror(errno) and terminate the process
src/daemon/Auth.cpp
Simplify Nix flake/dev shell and build derivation dependencies after QML/greeter removal
  • Reduce QT_PLUGIN_PATH to only qtbase plugins and drop QML/QQuick-related plugin and import paths from dev shell
  • Remove pixman from buildInputs
  • Rename SDDM_INITIAL_VT CMake definition to DDM_INITIAL_VT and drop QT_IMPORTS_DIR definition, aligning with new codebase naming and lack of QML components
flake.nix
nix/default.nix
Simplify src-level CMake config by removing obsolete Qt policy and PAM find module
  • Remove QTP0001 policy configuration now that only Qt6 is used
  • Delete custom FindPAM.cmake in favor of pkg_search_module-based PAM discovery
src/CMakeLists.txt
cmake/FindPAM.cmake

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Enabling -Werror globally in the top-level CMakeLists.txt can make the project fragile across different compilers and distro toolchains; consider making this configurable via an option (e.g. ENABLE_WERROR) and defaulting it off for release/packaging builds.
  • The removal of ENABLE_JOURNALD and HAVE_JOURNALD now makes libsystemd/sd-journal a hard, unconditional dependency; if you still want to support non-systemd environments or alternate logging backends, consider reintroducing a feature option and guarding the sd-journal include and usage behind it.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Enabling `-Werror` globally in the top-level `CMakeLists.txt` can make the project fragile across different compilers and distro toolchains; consider making this configurable via an option (e.g. `ENABLE_WERROR`) and defaulting it off for release/packaging builds.
- The removal of `ENABLE_JOURNALD` and `HAVE_JOURNALD` now makes libsystemd/sd-journal a hard, unconditional dependency; if you still want to support non-systemd environments or alternate logging backends, consider reintroducing a feature option and guarding the `sd-journal` include and usage behind it.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

zccrs
zccrs previously approved these changes Jan 23, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR performs a comprehensive cleanup of obsolete dependencies following the removal of greeter, helper, and auth components, and refactoring of existing components. The changes modernize the build system, simplify Qt usage, and enforce stricter Linux/systemd requirements.

Changes:

  • Modernized CMake build configuration by replacing custom FindPAM with pkg-config modules and using IMPORTED_TARGET pattern
  • Simplified Qt dependencies to Qt6 Core/DBus/Network only, removing all QML-related components
  • Made systemd/journald mandatory by removing conditional compilation flags

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
CMakeLists.txt Replaced custom PAM finder with pkg_search_module, added WERROR option, removed journald conditional logic, streamlined Qt6 dependencies
src/CMakeLists.txt Removed obsolete Qt policy configuration
src/common/CMakeLists.txt Updated to use Qt6 and PkgConfig::LibXau directly
src/common/Constants.h.in Removed unused QML imports directory constant
src/common/MessageHandler.h Removed conditional journald compilation, deleted unused Greeter and Helper message handlers
src/daemon/CMakeLists.txt Removed manual include_directories, switched to PkgConfig IMPORTED_TARGET pattern for cleaner dependency management
src/daemon/Auth.cpp Added error checking for write() calls when communicating session IDs and PIDs over pipes
cmake/FindPAM.cmake Deleted custom PAM finder in favor of pkg-config
debian/control Removed QML module dependencies, simplified to essential build requirements
debian/rules Removed NO_SYSTEMD and ENABLE_JOURNALD flags (now Linux-only)
debian/ddm.postinst Replaced manual user/group creation with systemd-sysusers and systemd-tmpfiles
services/debian.ddm.pam Added pam_systemd.so for proper systemd session management
services/ddm.pam Added pam_systemd.so for proper systemd session management
nix/default.nix Removed pixman dependency, fixed SDDM_INITIAL_VT to DDM_INITIAL_VT, removed QML import path
flake.nix Removed QML plugin paths from development shell environment

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: calsys456, zccrs

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zccrs zccrs merged commit 8ff3f0a into linuxdeepin:master Jan 23, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants