Conversation
Closes: spack#13754
lib/spack/spack/relocate.py
Outdated
|
|
||
| def file_is_relocatable( | ||
| file, paths_to_relocate=[spack.store.layout.root, spack.paths.prefix]): | ||
| def file_is_relocatable(file): |
There was a problem hiding this comment.
This change will break binary relocation.
If the issue is lists as default arguments, we should change this to def file_is_relocatable(file, paths_to_relocate=None) and insert the defaults below if we see paths_to_relocate is None
|
@scheibelp I'm trying to understand what's going on. Tuples are immutable so it should be fine to use them as defaults. |
|
The fact that these changes make a difference at all is strange to me since this code path does not seem to be even exercised in the example shown in #13754. |
|
Yeah I'm quite confused by this as well. I've confirmed the bug and that my version of the fix resolves the bug without losing the functionality, but I have no idea why this is happening. |
|
Okay, this is tricky. The issue seems to be due to |
|
Perfect sense... All the more reason to adopt: def file_is_relocatable(file, paths_to_relocate=None):
if paths_to_relocate is None:
paths_to_relocate = ... |
|
@tjfulle Or the more idiomatic equivalent: def file_is_relocatable(file, paths_to_relocate=None):
paths_to_relocate = paths_to_relocate or default_value |
v0.13.2 This release contains major performance improvements for Spack environments, as well as some bugfixes and minor changes. * allow missing modules if they are blacklisted (#13540) * speed up environment activation (#13557) * mirror path works for unknown versions (#13626) * environments: don't try to modify run-env if a spec is not installed (#13589) * use semicolons instead of newlines in module/python command (#13904) * verify.py: os.path.exists exception handling (#13656) * Document use of the maintainers field (#13479) * bugfix with config caching (#13755) * hwloc: added 'master' version pointing at the HEAD of the master branch (#13734) * config option to allow gpg warning suppression (#13744) * fix for relative symlinks when relocating binary packages (#13727) * allow binary relocation of strings in relative binaries (#13724)
v0.13.2 This release contains major performance improvements for Spack environments, as well as some bugfixes and minor changes. * allow missing modules if they are blacklisted (#13540) * speed up environment activation (#13557) * mirror path works for unknown versions (#13626) * environments: don't try to modify run-env if a spec is not installed (#13589) * use semicolons instead of newlines in module/python command (#13904) * verify.py: os.path.exists exception handling (#13656) * Document use of the maintainers field (#13479) * bugfix with config caching (#13755) * hwloc: added 'master' version pointing at the HEAD of the master branch (#13734) * config option to allow gpg warning suppression (#13744) * fix for relative symlinks when relocating binary packages (#13727) * allow binary relocation of strings in relative binaries (#13724)
fixes #13754