fix: resolve non-reproducible DBUS code generation issue#497
Merged
18202781743 merged 1 commit intolinuxdeepin:masterfrom Aug 19, 2025
Merged
fix: resolve non-reproducible DBUS code generation issue#49718202781743 merged 1 commit intolinuxdeepin:masterfrom
18202781743 merged 1 commit intolinuxdeepin:masterfrom
Conversation
deepin-ci-robot
added a commit
to linuxdeepin/dtk6core
that referenced
this pull request
Aug 12, 2025
Synchronize source files from linuxdeepin/dtkcore. Source-pull-request: linuxdeepin/dtkcore#497
Contributor
|
TAG Bot New tag: 5.7.21 |
deepin-ci-robot
added a commit
to linuxdeepin/dtk6core
that referenced
this pull request
Aug 19, 2025
Synchronize source files from linuxdeepin/dtkcore. Source-pull-request: linuxdeepin/dtkcore#497
deepin-ci-robot
added a commit
to linuxdeepin/dtk6core
that referenced
this pull request
Aug 19, 2025
Synchronize source files from linuxdeepin/dtkcore. Source-pull-request: linuxdeepin/dtkcore#497
Changed QSet to QStringList for annotations collection to ensure deterministic output order Added removeDuplicates() call to maintain uniqueness while preserving order This fixes non-reproducible builds caused by QSet's unpredictable iteration order Log: Fixed DBUS code generation reproducibility issue Influence: 1. Verify DBUS interface code generation produces identical output for same inputs 2. Test with multiple interface definitions containing annotations 3. Check build reproducibility across different systems fix: 修复DBUS代码生成不可重复的问题 将注解集合从QSet改为QStringList以确保输出顺序确定性 添加removeDuplicates()调用在保持顺序的同时确保唯一性 修复了由于QSet迭代顺序不可预测导致的构建不可重复问题 Log: 修复了DBUS代码生成不可重复的问题 Influence: 1. 验证相同输入下DBUS接口代码生成是否产生相同输出 2. 测试包含多个注解的接口定义 3. 检查不同系统间的构建可重复性
deepin-ci-robot
added a commit
to linuxdeepin/dtk6core
that referenced
this pull request
Aug 19, 2025
Synchronize source files from linuxdeepin/dtkcore. Source-pull-request: linuxdeepin/dtkcore#497
Contributor
deepin pr auto review我对这段代码的审查意见如下:
改进建议: // 保持使用 QSet,自动去重且性能更好
QSet<QString> collectedAnnotations;
for (const QDBusIntrospection::Interface *interface : interfaces) {
for (const auto &method : interface->methods) {
for (int i(0); i != method.outputArgs.size(); ++i) {
const QDBusIntrospection::Argument &arg = method.outputArgs[i];
if (!arg.annotations.isEmpty()) {
for (const QString &annotation : arg.annotations) {
// 可以添加注解的预处理或验证
collectedAnnotations.insert(annotation);
}
}
}
// 处理方法的注解
if (!method.annotations.isEmpty()) {
for (const QString &annotation : method.annotations) {
collectedAnnotations.insert(annotation);
}
}
}
// 处理接口的注解
if (!interface->annotations.isEmpty()) {
for (const QString &annotation : interface->annotations) {
collectedAnnotations.insert(annotation);
}
}
}
if (!skipIncludeAnnotations) {
for (const QString &annotation : collectedAnnotations) {
// 添加边界检查
if (!annotation.isEmpty() && annotation.indexOf('<') == -1) {
// 处理注解
}
}
}这些改进可以提高代码的性能、可读性和安全性,同时保持原有功能不变。 |
robertkill
approved these changes
Aug 19, 2025
mhduiy
approved these changes
Aug 19, 2025
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, mhduiy, robertkill The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
18202781743
pushed a commit
to linuxdeepin/dtk6core
that referenced
this pull request
Aug 19, 2025
Synchronize source files from linuxdeepin/dtkcore. Source-pull-request: linuxdeepin/dtkcore#497
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed QSet to QStringList for annotations collection to ensure
deterministic output order
Added removeDuplicates() call to maintain uniqueness while preserving
order
This fixes non-reproducible builds caused by QSet's unpredictable
iteration order
Log: Fixed DBUS code generation reproducibility issue
Influence:
same inputs
fix: 修复DBUS代码生成不可重复的问题
将注解集合从QSet改为QStringList以确保输出顺序确定性
添加removeDuplicates()调用在保持顺序的同时确保唯一性
修复了由于QSet迭代顺序不可预测导致的构建不可重复问题
Log: 修复了DBUS代码生成不可重复的问题
Influence: