Skip to content

Commit 31f18a1

Browse files
committed
feat: add reproducible build flags
Added CMAKE_SKIP_BUILD_RPATH=ON flag to DEB_CMAKE_EXTRA_FLAGS for reproducible builds This change ensures that build paths are not embedded in binaries, making builds more deterministic The flag is passed to dh_auto_configure command to apply during CMake configuration This improves package reproducibility across different build environments Influence: 1. Verify that builds produce identical binaries when built in different directories 2. Test that RPATH is not embedded in compiled binaries 3. Check that package functionality remains unchanged 4. Validate build process completes successfully with the new flag feat: 添加可重复编译参数 在DEB_CMAKE_EXTRA_FLAGS中添加CMAKE_SKIP_BUILD_RPATH=ON标志以实现可重复 编译 此更改确保构建路径不会嵌入到二进制文件中,使构建更加确定性 该标志通过dh_auto_configure命令传递给CMake配置过程 这提高了在不同构建环境中软件包的可重复性 Influence: 1. 验证在不同目录中构建时是否产生相同的二进制文件 2. 测试编译后的二进制文件中是否未嵌入RPATH 3. 检查软件包功能是否保持不变 4. 验证构建过程在使用新标志后能否成功完成
1 parent 62ed432 commit 31f18a1

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,7 +23,7 @@ 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)
2427

2528
override_dh_makeshlibs:
2629
dh_makeshlibs -V "libdtk6declarative (>= $(shell echo $(VERSION) | cut -d '.' -f 1,2,3))"

0 commit comments

Comments
 (0)