binary distribution: relocate text files properly in relative binaries#13578
Merged
tgamblin merged 4 commits intoreleases/v0.13from Nov 5, 2019
Merged
binary distribution: relocate text files properly in relative binaries#13578tgamblin merged 4 commits intoreleases/v0.13from
tgamblin merged 4 commits intoreleases/v0.13from
Conversation
tgamblin
requested changes
Nov 4, 2019
lib/spack/spack/relocate.py
Outdated
| if not pat.search(data): | ||
| return | ||
| ndata = pat.sub(replace, data) | ||
| pat = re.compile(rb'(?<![\w\-_/])[\w\-_]*?%s([\w\-_/]*)' % old_dir.encode('utf-8')) |
Member
There was a problem hiding this comment.
I don't believe that rb works in python 2. Does it have to be rb? Won't r work?
Member
There was a problem hiding this comment.
Can you document this to explain what the negative lookbehind does? If I understand this correctly, it's saying to only replace old_dir at the beginning of the path by ensuring that the string is not preceded by words, dashes, underscores, or a slash. Is that basically right?
Member
Author
There was a problem hiding this comment.
r won't work in this context because we're operating on byte objects, so everything in re needs to be byte objects as well.
Member
Author
There was a problem hiding this comment.
I'll need to use b and just escape my backslashes.
tgamblin
approved these changes
Nov 5, 2019
tgamblin
pushed a commit
that referenced
this pull request
Nov 18, 2019
#13578) * Make relative binaries relocate text files properly * rb strings aren't valid in python 2 * move perl to new interface for setup_environment family methods
nazavode
reviewed
Nov 28, 2019
| perl_bin_path = ':'.join(perl_bin_dirs) | ||
| spack_env.prepend_path('PATH', perl_bin_path) | ||
| run_env.prepend_path('PATH', perl_bin_path) | ||
| env.prepend_path('PATH', perl_bin_path) |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@tgamblin I think we need this for tomorrow.