Skip to content

Commit 8b55360

Browse files
committed
feat: add reproducible build parameter
Added CMAKE_SKIP_BUILD_RPATH flag to enable reproducible builds This change ensures that builds are reproducible by preventing the inclusion of build-specific paths in the binary The flag is added to DEB_CMAKE_EXTRA_FLAGS and passed to dh_auto_configure command This is important for package verification and security auditing Influence: 1. Test building the package multiple times to verify reproducibility 2. Compare binary checksums from different builds 3. Verify that the package still installs and runs correctly 4. Check that no build paths are embedded in the final binaries 5. Test cross-compilation scenarios if applicable feat: 添加可重复编译参数 添加 CMAKE_SKIP_BUILD_RPATH 标志以启用可重复编译 此更改通过防止在二进制文件中包含特定于构建的路径来确保构建的可重复性 该标志被添加到 DEB_CMAKE_EXTRA_FLAGS 并传递给 dh_auto_configure 命令 这对于软件包验证和安全审计非常重要 Influence: 1. 多次测试构建软件包以验证可重复性 2. 比较不同构建的二进制文件校验和 3. 验证软件包仍能正确安装和运行 4. 检查最终二进制文件中是否嵌入了构建路径 5. 测试交叉编译场景(如果适用)
1 parent 240c41d commit 8b55360

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

debian/rules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export DEB_CFLAGS_MAINT_APPEND = -Wall
88
export DEB_CXXFLAGS_MAINT_APPEND = -Wall
99
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,-E
1010

11+
# reproducible编译参数
12+
DEB_CMAKE_EXTRA_FLAGS += -DCMAKE_SKIP_BUILD_RPATH=ON
13+
1114
# see ENVIRONMENT in dpkg-buildflags(1)
1215
# package maintainers to append CFLAGS
1316
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
@@ -19,5 +22,6 @@ export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z
1922

2023
override_dh_auto_configure:
2124
dh_auto_configure -- \
25+
$(DEB_CMAKE_EXTRA_FLAGS) \
2226
-DVERSION=$(DEB_VERSION_UPSTREAM) \
2327
-DPREFER_QT_5=OFF

0 commit comments

Comments
 (0)