filter __spack_path_placeholder__ in generated module files after buildcache install (#36611)

* filter __spack_path_placeholder__ in generated module files after buildcache install

* fix windows
This commit is contained in:
Harmen Stoppels 2023-04-04 09:45:43 +02:00 committed by GitHub
parent 5560017ebe
commit e9a1d0a157
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -703,7 +703,7 @@ def configure_options(self):
if os.path.exists(pkg.install_configure_args_path):
with open(pkg.install_configure_args_path, "r") as args_file:
return args_file.read()
return spack.util.path.padding_filter(args_file.read())
# Returning a false-like value makes the default templates skip
# the configure option section

View File

@ -444,7 +444,7 @@ def padding_filter(string):
r"(/{pad})+" # the padding string repeated one or more times
r"(/{longest_prefix})?(?=/)" # trailing prefix of padding as path component
)
regex = regex.replace("/", os.sep)
regex = regex.replace("/", re.escape(os.sep))
regex = regex.format(pad=pad, longest_prefix=longest_prefix)
_filter_re = re.compile(regex)