Skip to content

Commit 413823d

Browse files
committed
feat: add reproducible build parameters
1. Added CMAKE_SKIP_BUILD_RPATH=ON flag to enable reproducible builds 2. This flag prevents embedding build machine specific paths in binaries 3. Modified dh_auto_configure to include DEB_CMAKE_EXTRA_FLAGS 4. Ensures consistent binary output across different build environments Influence: 1. Test building the package on different machines to verify reproducibility 2. Compare binary checksums from different build environments 3. Verify that RPATH is not embedded in the compiled binaries 4. Test package installation and functionality after the change 5. Ensure build process completes successfully with the new flag feat: 添加可重复编译参数 1. 添加 CMAKE_SKIP_BUILD_RPATH=ON 标志以启用可重复构建 2. 该标志防止在二进制文件中嵌入特定于构建机器的路径 3. 修改 dh_auto_configure 以包含 DEB_CMAKE_EXTRA_FLAGS 4. 确保在不同构建环境中获得一致的二进制输出 Influence: 1. 在不同机器上测试软件包构建以验证可重复性 2. 比较来自不同构建环境的二进制校验和 3. 验证编译后的二进制文件中未嵌入 RPATH 4. 测试更改后的软件包安装和功能 5. 确保构建过程使用新标志后能成功完成
1 parent e6fcc84 commit 413823d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

debian/rules

Lines changed: 4 additions & 1 deletion
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
VERSION = $(DEB_VERSION_UPSTREAM)
1215
PACK_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$1}')
1316
# Fix: invalid digit "8" in octal constant. e.g. u008 ==> 008 ==> 8
@@ -17,4 +20,4 @@ BUILD_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$2}' | sed 's/[^0-
1720
dh $@
1821

1922
override_dh_auto_configure:
20-
dh_auto_configure -- -DDS_VERSION=${PACK_VER}
23+
dh_auto_configure -- $(DEB_CMAKE_EXTRA_FLAGS) -DDS_VERSION=${PACK_VER}

0 commit comments

Comments
 (0)