Skip to content

Update rpathing logic#30

Merged
scheibelp merged 7 commits intospack:mainfrom
johnwparent:update-rpathing-logic
Apr 28, 2026
Merged

Update rpathing logic#30
scheibelp merged 7 commits intospack:mainfrom
johnwparent:update-rpathing-logic

Conversation

@johnwparent
Copy link
Copy Markdown
Collaborator

RPathing Logic Overhaul

  • Makes all PE paths absolute
  • Removes rename logic that dealt with the spack sigil and BC pushes
  • Uses new relocation logic to avoid FS search and instead use Spack env variable and util support added in prior PR
  • Adds access rights scoping for read and write operations
  • General code cleanup

Based on #29

@johnwparent johnwparent force-pushed the update-rpathing-logic branch 2 times, most recently from 199ecd3 to d8db2d4 Compare April 23, 2026 23:17
Previously we were searching a set of prefixes for DLLs during relocation. If we found a dll that matched the dll we were looking for (based on file name) we performed relocation based on that path. This is both dangerous and extraneous.

This is dangerous as mutli config layouts may have the same binary with the same name in mutliple different paths for different configs or variations. Since we were previously only checking the filename, this could lead to a false positive detection and bad relocation not detected until runtime.

This is extraneous as we should never need to search. We have the dll locations before and after relocation, whether from the stage to install prefix or from buildcache to buildcache, so rather than a filesystem search, we can have a linear time operation where we search through a list of relocation old->new prefix mappings.

Spack core will set an environment variable of the structure:
old_prefix|new_prefix and the compiler wrapper now composes a map out of that list and then PE files looking to relocate their internal dll references get a constant time lookup.

Signed-off-by: John Parent <john.parent@kitware.com>
Signed-off-by: John Parent <john.parent@kitware.com>
* Makes all PE paths absolute
* Removes rename logic that dealt with the spack sigil and BC pushes
* Uses new relocation logic to avoid FS search and instead use Spack env variable and util support added in prior PR
* Adds access rights scoping for read and write operations
* General code cleanup

Signed-off-by: John Parent <john.parent@kitware.com>
Signed-off-by: John Parent <john.parent@kitware.com>
Signed-off-by: John Parent <john.parent@kitware.com>
Signed-off-by: John Parent <john.parent@kitware.com>
Signed-off-by: John Parent <john.parent@kitware.com>
@johnwparent johnwparent force-pushed the update-rpathing-logic branch from 9b4b12f to 45d9865 Compare April 27, 2026 22:21
@scheibelp scheibelp merged commit a31c5ad into spack:main Apr 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants