add substitute-path to gdbinit for prefix-map (reproducible build), and pick a unique prefix
- Dominant language
- C++
- Stars
- 21.5k
- Forks
- 3.5k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 2
Description
`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.
Contributor guide
Research direction
Start by locating the bundled gdbinit file and the definition of CATCH_ENABLE_REPRODUCIBLE_BUILD, then verify how the current -ffile-prefix-map destination interacts with GDB's substitute-path rules. Decide on a unique prefix consistently for both settings, and confirm that the generated configuration preserves reproducible builds while allowing source lookup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system, devtools
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100