From 9b2fdffc79f8e36da89503ac444367830cb8ca13 Mon Sep 17 00:00:00 2001 From: yeshanshan Date: Tue, 11 Nov 2025 12:42:34 +0800 Subject: [PATCH] feat: add reproducible build configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Added CMAKE_SKIP_BUILD_RPATH=ON flag to DEB_CMAKE_EXTRA_FLAGS 2. Modified dh_auto_configure to include DEB_CMAKE_EXTRA_FLAGS 3. This ensures reproducible builds by skipping build-time RPATH 4. Improves package consistency across different build environments Influence: 1. Verify that builds are reproducible across different systems 2. Test package installation and runtime behavior remains unchanged 3. Confirm that RPATH is not embedded in binaries during build 4. Validate that the build process completes successfully with new flags feat: 添加可重复编译配置 1. 向 DEB_CMAKE_EXTRA_FLAGS 添加 CMAKE_SKIP_BUILD_RPATH=ON 标志 2. 修改 dh_auto_configure 以包含 DEB_CMAKE_EXTRA_FLAGS 3. 通过跳过构建时 RPATH 确保可重复编译 4. 提高不同构建环境下软件包的一致性 Influence: 1. 验证在不同系统上的构建是否可重复 2. 测试软件包安装和运行时行为保持不变 3. 确认构建过程中二进制文件未嵌入 RPATH 4. 验证使用新标志后构建过程成功完成 --- debian/rules | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 105935ec..7c307cde 100755 --- a/debian/rules +++ b/debian/rules @@ -9,6 +9,9 @@ export DEB_CFLAGS_MAINT_APPEND = -Wall export DEB_CXXFLAGS_MAINT_APPEND = -Wall export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,-E +# reproducible编译参数 +DEB_CMAKE_EXTRA_FLAGS += -DCMAKE_SKIP_BUILD_RPATH=ON + DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) VERSION = $(DEB_VERSION_UPSTREAM) @@ -24,7 +27,7 @@ endif dh $@ override_dh_auto_configure: - dh_auto_configure -- -DBUILD_TESTING=OFF -DBUILD_DOCS=ON -DDTK_VERSION=$(_PACK_VER) + dh_auto_configure -- $(DEB_CMAKE_EXTRA_FLAGS) -DBUILD_TESTING=OFF -DBUILD_DOCS=ON -DDTK_VERSION=$(_PACK_VER) #override_dh_auto_test: # echo "skip auto test"