Skip to content

set SPACK_DEBUG_PREFIX_MAP for -ffile-prefix-map=<stage>=. injection at compiler-wrapper level (companion to spack/compiler-wrapper#19)#5353

Open
SebastianPaucar wants to merge 2 commits into
spack:developfrom
SebastianPaucar:feature/compiler-wrapper-debug-prefix-map
Open

set SPACK_DEBUG_PREFIX_MAP for -ffile-prefix-map=<stage>=. injection at compiler-wrapper level (companion to spack/compiler-wrapper#19)#5353
SebastianPaucar wants to merge 2 commits into
spack:developfrom
SebastianPaucar:feature/compiler-wrapper-debug-prefix-map

Conversation

@SebastianPaucar

@SebastianPaucar SebastianPaucar commented Jun 27, 2026

Copy link
Copy Markdown

This PR sets SPACK_DEBUG_PREFIX_MAP in setup_dependent_build_environment (in repos/spack_repo/builtin/packages/compiler_wrapper/package.py) to the staging source path of the package being compiled. cc.sh in compiler-wrapper repo reads this variable and injects -ffile-prefix-map=<staging>=., normalizing DWARF paths for build reproducibility. develop-based packages are excluded.

This PR is a companion to spack/compiler-wrapper#19

@spackbot-triage spackbot-triage Bot requested a review from haampie June 27, 2026 20:16
@SebastianPaucar SebastianPaucar changed the title set SPACK_DEBUG_PREFIX_MAP -ffile-prefix-map=<stage>=. injection at compiler-wrapper level (companion to https://github.com/spack/compiler-wrapper/pull/19) set SPACK_DEBUG_PREFIX_MAP -ffile-prefix-map=<stage>=. injection at compiler-wrapper level (companion to spack/compiler-wrapper#19) Jun 27, 2026
@SebastianPaucar SebastianPaucar changed the title set SPACK_DEBUG_PREFIX_MAP -ffile-prefix-map=<stage>=. injection at compiler-wrapper level (companion to spack/compiler-wrapper#19) set SPACK_DEBUG_PREFIX_MAP for -ffile-prefix-map=<stage>=. injection at compiler-wrapper level (companion to spack/compiler-wrapper#19) Jun 27, 2026
@haampie

haampie commented Jun 29, 2026

Copy link
Copy Markdown
Member

Can this be done without changing cc.sh?

Comment thread repos/spack_repo/builtin/packages/compiler_wrapper/package.py Outdated
@SebastianPaucar

Copy link
Copy Markdown
Author

Can this be done without changing cc.sh?

It can, but I added the -ffile-prefix-map injection into cc.sh to hide the flag from the build system. Maybe injecting via SPACK_*FLAGS from package.py and avoiding touching cc.sh could leak the stage info in logs. Could you clarify what you have in mind? I am happy to work on it immediately

Signed-off-by: SebastianPaucar <paucar.sebastian@hotmail.com>
@spackbot-triage spackbot-triage Bot requested a review from haampie July 2, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants