Skip to content

Conversation

@wineee
Copy link
Member

@wineee wineee commented Dec 2, 2025

Removed the conditional WAYLAND_DEBUG environment variable setting that was only enabled in debug builds. This change eliminates unnecessary debug output in production environments and ensures cleaner system logs. The debug flag was previously set for both TreeLand compositor and single Wayland helper processes when compiled in debug mode.

Influence:

  1. Verify Wayland compositor starts normally without debug output
  2. Check system logs for reduced debug message clutter
  3. Test TreeLand compositor functionality remains unchanged
  4. Validate single Wayland helper process operation
  5. Confirm no regression in display server initialization

fix: 在发布版本中移除 WAYLAND_DEBUG 环境变量设置

移除了仅在调试版本中启用的 WAYLAND_DEBUG 环境变量条件设置。此更改消除了
生产环境中不必要的调试输出,确保系统日志更清晰。之前该调试标志在调试模式
下同时为 TreeLand 合成器和单 Wayland 助手进程设置。

Influence:

  1. 验证 Wayland 合成器正常启动且无调试输出
  2. 检查系统日志中调试消息杂乱度是否降低
  3. 测试 TreeLand 合成器功能保持不变
  4. 验证单 Wayland 助手进程运行正常
  5. 确认显示服务器初始化无回归问题

Summary by Sourcery

Bug Fixes:

  • Stop unintentionally enabling WAYLAND_DEBUG in release builds, preventing excessive Wayland debug output in production logs.

Removed the conditional WAYLAND_DEBUG environment variable setting that
was only enabled in debug builds. This change eliminates unnecessary
debug output in production environments and ensures cleaner system
logs. The debug flag was previously set for both TreeLand compositor and
single Wayland helper processes when compiled in debug mode.

Influence:
1. Verify Wayland compositor starts normally without debug output
2. Check system logs for reduced debug message clutter
3. Test TreeLand compositor functionality remains unchanged
4. Validate single Wayland helper process operation
5. Confirm no regression in display server initialization

fix: 在发布版本中移除 WAYLAND_DEBUG 环境变量设置

移除了仅在调试版本中启用的 WAYLAND_DEBUG 环境变量条件设置。此更改消除了
生产环境中不必要的调试输出,确保系统日志更清晰。之前该调试标志在调试模式
下同时为 TreeLand 合成器和单 Wayland 助手进程设置。

Influence:
1. 验证 Wayland 合成器正常启动且无调试输出
2. 检查系统日志中调试消息杂乱度是否降低
3. 测试 TreeLand 合成器功能保持不变
4. 验证单 Wayland 助手进程运行正常
5. 确认显示服务器初始化无回归问题
@sourcery-ai
Copy link

sourcery-ai bot commented Dec 2, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Removes all conditional WAYLAND_DEBUG environment variable settings so that even debug builds no longer force Wayland protocol debug logging, while keeping the rest of the compositor and helper process startup environment unchanged.

Sequence diagram for Wayland compositor startup without WAYLAND_DEBUG

sequenceDiagram
    participant Daemon_Display as Daemon_Display
    participant QProcessEnvironment as QProcessEnvironment
    participant TreeLand_Compositor as TreeLand_Compositor
    participant SingleWaylandHelper as SingleWaylandHelper

    Daemon_Display->>QProcessEnvironment: systemEnvironment()
    QProcessEnvironment-->>Daemon_Display: base_env

    Daemon_Display->>QProcessEnvironment: insert DDE_CURRENT_COMPOSITOR=TreeLand (for SingleCompositerServerType)
    Note over Daemon_Display,QProcessEnvironment: WAYLAND_DEBUG is no longer inserted in any build

    Daemon_Display->>TreeLand_Compositor: start with env

    TreeLand_Compositor->>SingleWaylandHelper: spawn helper process
    SingleWaylandHelper->>QProcessEnvironment: systemEnvironment()
    QProcessEnvironment-->>SingleWaylandHelper: base_env
    SingleWaylandHelper->>QProcessEnvironment: insert LIBSEAT_BACKEND=seatd
    SingleWaylandHelper->>QProcessEnvironment: insert DSG_APP_ID=org.deepin.dde.treeland
    Note over SingleWaylandHelper,QProcessEnvironment: WAYLAND_DEBUG is no longer conditionally inserted

    SingleWaylandHelper->>TreeLand_Compositor: run with env
    TreeLand_Compositor-->>Daemon_Display: compositor running without protocol debug logging
Loading

Flow diagram for environment setup without WAYLAND_DEBUG

flowchart TD
    A[Start display server setup] --> B[Check display server type]
    B -->|SingleCompositerServerType| C[Create env from systemEnvironment]
    B -->|Other types| D[Configure Xorg or other server]

    C --> E[Insert DDE_CURRENT_COMPOSITOR=TreeLand]
    E --> F[Start TreeLand compositor with env]

    F --> G[SingleWaylandHelper builds env]
    G --> H[Create env from systemEnvironment]
    H --> I[Insert LIBSEAT_BACKEND=seatd]
    I --> J[Insert DSG_APP_ID=org.deepin.dde.treeland]
    J --> K[Start single Wayland helper process]

    D --> L[Start selected display server]

    K --> M[Display server running]
    L --> M

    subgraph Removed_behavior
        R1[Previously: if debug build
        insert WAYLAND_DEBUG=1 in Daemon_Display]
        R2[Previously: if debug build
        insert WAYLAND_DEBUG=1 in SingleWaylandHelper]
    end
Loading

File-Level Changes

Change Details Files
Stop setting WAYLAND_DEBUG for the single-compositor display server path in the daemon
  • Remove QT_DEBUG-guarded insertion of WAYLAND_DEBUG=1 into the QProcessEnvironment when starting the SingleCompositerServerType display server
  • Keep all other environment variable configuration (e.g., DDE_CURRENT_COMPOSITOR) intact for this path
src/daemon/Display.cpp
Stop setting WAYLAND_DEBUG in the SingleWaylandHelper process
  • Remove DEBUG-guarded insertion of WAYLAND_DEBUG=1 into the helper’s QProcessEnvironment construction
  • Preserve other helper environment variables such as LIBSEAT_BACKEND and DSG_APP_ID
src/helper/singlewaylandhelper.cpp

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

@deepin-ci-robot
Copy link

deepin pr auto review

我来对这段代码的修改进行审查:

  1. 代码变更分析:
    这段代码主要移除了两处 WAYLAND_DEBUG 环境变量的设置。这个变量通常用于启用 Wayland 协议的调试输出。

  2. 审查意见:

语法逻辑:

  • 代码修改在语法上是正确的,只是简单地移除了条件编译的调试代码块。

代码质量:

  • 移除调试代码是合理的做法,因为这些调试信息不应该出现在生产环境中。
  • 建议在代码中添加注释说明移除这些调试代码的原因,这样有助于其他开发者理解这个决定。

代码性能:

  • 移除调试环境变量的设置可以略微提升性能,因为避免了不必要的调试输出。
  • 这个性能提升很小,但在生产环境中累积起来可能会有一定帮助。

代码安全:

  • 移除调试输出是好的安全实践,因为调试信息可能会暴露系统内部的工作细节。
  • 建议确保在需要调试时有其他方式可以启用调试模式,比如通过配置文件或命令行参数。
  1. 改进建议:
// 在 Display.cpp 中
if (m_displayServerType == DisplayServerType::SingleCompositerServerType) {
    // 注意:生产环境不应启用 WAYLAND_DEBUG
    // 如需调试,请通过其他方式(如配置文件)启用
    env.insert("DDE_CURRENT_COMPOSITOR", "TreeLand");
}

// 在 singlewaylandhelper.cpp 中
auto env = QProcessEnvironment::systemEnvironment();
env.insert("LIBSEAT_BACKEND", "seatd");
env.insert("DSG_APP_ID", "org.deepin.dde.treeland");
// 注意:生产环境不应启用 WAYLAND_DEBUG
// 如需调试,请通过其他方式(如配置文件)启用
return env;
  1. 其他建议:
  • 考虑添加一个专门的调试配置机制,可以通过配置文件或环境变量来控制是否启用调试模式。
  • 建议在文档中记录如何启用调试模式,以便开发者在需要时能够方便地进行调试。

总的来说,这个修改是合理的,移除了生产环境中不必要的调试代码。建议添加适当的注释说明,并考虑提供其他方式来启用调试模式。

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 there - I've reviewed your changes and they look great!


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.

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wineee, 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 6559fb9 into linuxdeepin:master Dec 3, 2025
10 checks passed
@wineee wineee deleted the dbg branch December 3, 2025 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants