Skip to content

Commit c37db5d

Browse files
committed
feat: add reproducible build parameters
Added CMAKE_SKIP_BUILD_RPATH flag to enable reproducible builds This change ensures consistent binary output across different build environments by preventing the inclusion of build-specific paths in the compiled binaries The flag is added to DEB_CMAKE_EXTRA_FLAGS which is then passed to the configure command Influence: 1. Verify that builds produce identical binaries when built in different environments 2. Test that the application still functions correctly with the new build flag 3. Check that RPATH is not embedded in the resulting binaries 4. Validate that the build process completes successfully with the new parameter feat: 添加可重复编译参数 添加 CMAKE_SKIP_BUILD_RPATH 标志以启用可重复构建 此更改通过防止在编译的二进制文件中包含特定于构建的路径 确保在不同构建环境中产生一致的二进制输出 该标志被添加到 DEB_CMAKE_EXTRA_FLAGS 中,然后传递给配置命令 Influence: 1. 验证在不同环境中构建时是否产生相同的二进制文件 2. 测试应用程序在使用新构建标志后是否仍能正常运行 3. 检查生成的二进制文件中是否未嵌入 RPATH 4. 验证构建过程在使用新参数后是否成功完成
1 parent 4fb8325 commit c37db5d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

debian/rules

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

12+
# reproducible编译参数
13+
DEB_CMAKE_EXTRA_FLAGS += -DCMAKE_SKIP_BUILD_RPATH=ON
14+
1215
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
1316

1417
VERSION = $(DEB_VERSION_UPSTREAM)
@@ -20,4 +23,4 @@ BUILD_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$2}' | sed 's/[^0-
2023
dh $@
2124

2225
override_dh_auto_configure:
23-
dh_auto_configure -- -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=ON -DBUILD_VERSION=$(BUILD_VER) -DDTK_VERSION=$(PACK_VER)
26+
dh_auto_configure -- $(DEB_CMAKE_EXTRA_FLAGS) -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=ON -DBUILD_VERSION=$(BUILD_VER) -DDTK_VERSION=$(PACK_VER)

0 commit comments

Comments
 (0)