Skip to content

fix(compat): support Qt 5.11 and GCC 8 toolchain - #813

Merged
re2zero merged 1 commit into
masterfrom
fix/qt511-gcc8-compat
Oct 24, 2026
Merged

re2zero merged 1 commit into
masterfrom
fix/qt511-gcc8-compat

Conversation

@re2zero

@re2zero re2zero commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Cherry-picked from 6f39dc937da on the original tunnel work branch; the patch applies cleanly to current master and is identical to the original commit.

Guard the two new errorOccurred connects so Qt < 5.15 keeps using
error(QAbstractSocket::SocketError), matching the existing pattern in
singleapplication.cpp. Link stdc++fs when compiling with GCC < 9, where
std::filesystem symbols live in a separate archive (UOS 20 toolchain);
GCC >= 9 folds them into libstdc++.

Log: support Qt 5.11 and GCC 8 toolchain
Influence: no behavior change on Qt >= 5.15 and GCC >= 9; makes the tunnel branch build on Qt 5.11.3 (UOS 20).

Summary by Sourcery

Support building the project with Qt 5.11 and GCC 8 toolchains while preserving existing behavior on newer versions.

Bug Fixes:

  • Restore compatibility with Qt versions before 5.15 by using the legacy socket error signal where needed.
  • Enable builds with GCC versions before 9 by linking the separate filesystem support library.

Build:

  • Add conditional linking for the GCC filesystem library required by older toolchains.

Guard the two new errorOccurred connects so Qt < 5.15 keeps using
error(QAbstractSocket::SocketError), matching the existing pattern in
singleapplication.cpp. Link stdc++fs when compiling with GCC < 9, where
std::filesystem symbols live in a separate archive (UOS 20 toolchain);
GCC >= 9 folds them into libstdc++.

Log: support Qt 5.11 and GCC 8 toolchain
Influence: no behavior change on Qt >= 5.15 and GCC >= 9; makes the
tunnel branch build on Qt 5.11.3 (UOS 20).
@sourcery-ai

sourcery-ai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Sorry @re2zero, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 5 days by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Oct 23, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The patch makes the tunnel branch build with Qt 5.11 and GCC 8 by selecting the legacy socket error signal on older Qt releases and linking stdc++fs for pre-GCC 9 toolchains, without changing behavior on newer environments.

File-Level Changes

Change Details Files
Added compiler-version-specific linking for GCC toolchains that keep the filesystem implementation in a separate archive.
  • Detect GNU compilers older than version 9.
  • Append the stdc++fs archive to the standard C++ libraries for those toolchains.
CMakeLists.txt
Added Qt-version-compatible socket error signal connections while preserving existing error handling.
  • Use errorOccurred on Qt 5.15 and newer.
  • Use the overloaded error signal on older Qt versions, including Qt 5.11.
  • Apply the compatibility branching to tunnel and barrier-server sockets.
src/lib/common/manager/tunnelmanager.cpp
src/lib/cooperation/core/net/helper/sharehelper.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
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 100 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次提交为 Qt 5.11 / GCC 8 兼容性修复,通过预处理器条件编译和 CMake 链接配置解决旧版工具链兼容问题。四维度均无问题,无安全漏洞,代码逻辑正确,注释清晰,OCR 审查亦无发现。

🔍 详细分析

1. 语法逻辑 ✅

评价: 语法正确,逻辑清晰 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: ['无需修改,语法逻辑完全正确。']


2. 代码质量 ✅

评价: 代码结构清晰,注释完整 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: ["sharehelper.cpp 中 '// Error handling function' 注释可更具体,如 '// Qt 5.15 以下使用 error 重载信号,5.15+ 使用 errorOccurred',但属于轻微建议。"]


3. 代码性能 ✅

评价: 性能良好,资源使用合理 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: ['无需优化,本次变更不涉及性能相关改动。']


4. 代码安全 🔒

评价: 存在0个安全漏洞 ✅ 通过

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

建议: ['无需安全加固,本次变更不涉及安全敏感操作。']


💡 改进建议代码示例


本报告由 AI 代码审查工具自动生成

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lzwind, re2zero

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

@re2zero
re2zero merged commit 68847f2 into master Oct 24, 2026
27 of 28 checks passed
@re2zero
re2zero deleted the fix/qt511-gcc8-compat branch October 24, 2026 05:10
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