build: add diagnostic logging to debian/rules for package debugging#287
Conversation
Added diagnostic output to override_dh_auto_configure in debian/rules Prints version detection results (MAJOR_VERSION, USE_QT6, QT_SUFFIX) Displays control package names and matching .install file status Lists build artifacts in debian/tmp (.so files, headers, pkg-config) Helps diagnose dh_install warnings caused by QT_SUFFIX mismatch Previously libdfm6-io.install referenced libdfm6-io*.so* but build produces libdfm-io.so* without the version suffix, causing warnings Influence: 1. Build output will now include diagnostic info at configure stage 2. No functional change to package build process 3. Helps identify .install file and build artifact name mismatches 4. Useful for debugging future packaging issues related to QT_SUFFIX build: 在 debian/rules 中添加打包诊断日志 在 debian/rules 的 override_dh_auto_configure 中添加了诊断输出 打印版本检测结果 (MAJOR_VERSION、USE_QT6、QT_SUFFIX) 显示 control 包名以及匹配的 .install 文件状态 列出 debian/tmp 中的构建产物 (.so 文件、头文件、pkg-config) 帮助诊断由 QT_SUFFIX 不匹配导致的 dh_install 警告 此前 libdfm6-io.install 引用了 libdfm6-io*.so* 但构建产物为 libdfm-io.so*(无版本后缀),导致打包警告 Influence: 1. 构建输出将在 configure 阶段包含诊断信息 2. 不影响包构建过程的功能 3. 有助于识别 .install 文件与构建产物名称不匹配的问题 4. 方便排查未来与 QT_SUFFIX 相关的打包问题
|
Warning
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Johnson-zs, liyigang1 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 |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
ce8469e
into
linuxdeepin:develop/tmp
deepin pr auto review这段代码是一个 以下是针对这段代码的详细审查意见,包括语法逻辑、代码质量、代码性能和代码安全方面的改进建议: 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
5. 改进建议与重构代码为了提高代码的健壮性和可维护性,建议对代码进行以下优化:
优化后的代码示例: # 可以在文件开头定义一个开关,或者依赖 dh 的 verbose 选项
# 如果 DEB_BUILD_OPTIONS 包含 verbose,则打印详细信息
ifeq ($(filter verbose,$(DEB_BUILD_OPTIONS)),)
DIAGNOSE = @true
else
DIAGNOSE = @echo
endif
override_dh_auto_configure:
@echo "======= [debian/rules] 打包诊断信息 ======="
@echo " MAJOR_VERSION = $(MAJOR_VERSION)"
@echo " USE_QT6 = $(USE_QT6)"
@echo " QT_SUFFIX = $(QT_SUFFIX)"
@echo " QT_SELECT = $$QT_SELECT"
@echo " DEB_HOST_MULTIARCH = $(DEB_HOST_MULTIARCH)"
@echo ""
@echo "--- control 中的包名 (QT_SUFFIX=$(QT_SUFFIX)) ---"
@grep "^Package:" debian/control | sed 's/^/ /'
@echo ""
@echo "--- 匹配到的 .install 文件 ---"
@for f in debian/libdfm*$(QT_SUFFIX)*.install; do \
[ -f "$$f" ] && echo " [匹配] $$f" || true; \
done
@for f in debian/libdfm*.install; do \
case "$$f" in \
*$(QT_SUFFIX)*) ;; \
*) echo " [残留] $$f (QT_SUFFIX=$(QT_SUFFIX) 时不会被 dh_install 使用)";; \
esac; \
done
@echo ""
@echo "--- 构建产物 (debian/tmp 中的库文件) ---"
@find debian/tmp/usr/lib -name 'libdfm*.so*' 2>/dev/null | sed 's/^/ /' || echo " (debian/tmp 尚未生成,将在 build 阶段出现)"
@echo ""
@echo "--- 构建产物 (debian/tmp 中的头文件目录) ---"
@find debian/tmp/usr/include -maxdepth 1 -type d 2>/dev/null | sed 's|debian/tmp/usr/include/| /usr/include/|' || echo " (debian/tmp 尚未生成)"
@echo ""
@echo "--- 构建产物 (debian/tmp 中的 pkg-config) ---"
@find debian/tmp/usr/lib -name 'dfm*.pc' 2>/dev/null | sed 's/^/ /' || echo " (debian/tmp 尚未生成)"
@echo "==========================================="
dh_auto_configure -- \
-DHOST_MULTIARCH="$(DEB_HOST_MULTIARCH)"或者,如果这段代码只是为了调试而不应进入生产环境,建议添加注释明确说明: # TODO: 下面的诊断代码仅用于调试多版本构建问题,问题解决后请移除
override_dh_auto_configure:
...总结这段代码在逻辑上是正确的,对于调试 Debian 打包过程中的文件匹配问题非常有效。主要的问题在于它增加了构建日志的冗长度。建议根据实际需求,决定是保留它作为长期辅助工具,还是作为临时调试代码在问题解决后移除。如果保留,建议增加条件开关控制其输出。 |
Added diagnostic output to override_dh_auto_configure in debian/rules Prints version detection results (MAJOR_VERSION, USE_QT6, QT_SUFFIX) Displays control package names and matching .install file status Lists build artifacts in debian/tmp (.so files, headers, pkg-config) Helps diagnose dh_install warnings caused by QT_SUFFIX mismatch Previously libdfm6-io.install referenced libdfm6-io*.so* but build produces libdfm-io.so* without the version suffix, causing warnings
Influence:
build: 在 debian/rules 中添加打包诊断日志
在 debian/rules 的 override_dh_auto_configure 中添加了诊断输出 打印版本检测结果 (MAJOR_VERSION、USE_QT6、QT_SUFFIX)
显示 control 包名以及匹配的 .install 文件状态
列出 debian/tmp 中的构建产物 (.so 文件、头文件、pkg-config)
帮助诊断由 QT_SUFFIX 不匹配导致的 dh_install 警告
此前 libdfm6-io.install 引用了 libdfm6-io*.so* 但构建产物为
libdfm-io.so*(无版本后缀),导致打包警告
Influence: