catchorg/Catch2

add substitute-path to gdbinit for prefix-map (reproducible build), and pick a unique prefix

開放

#3,042 建立於 2025年10月19日

 (2 則留言) (0 個反應) (0 位負責人)C++ (3,228 個分叉)batch import
ExtrasHelp wanted

倉庫指標

星標
 (20,381 顆星)
PR 合併指標
 (平均合併 1天 8小時) (30 天內合併 1 個 PR)

描述

CATCH_ENABLE_REPRODUCIBLE_BUILD adds a -ffile-prefix-map=${CATCH_DIR}/= compile option. It would be nice for the bundled gdbinit file to add a corresponding set substitute-path line for this. A potential issue is that set substitute-path works like this:

Define a source path substitution rule, and add it at the end of the current list of existing substitution rules. If a rule with the same from was already defined, then the old rule is also deleted.

If I'm reading the compile option correctly, Catch2 appears to be mapping to an empty path, so I presume that adding a substitute-path for it would mean no other substitute-path's from can be for the empty path. If that's the case, a potential mitigation would be to pick something more unique, like /Catch2. That would mean changing the -ffile-prefix-map destination to /Catch2 as well.

貢獻者指南