Manifest parsing: avoid irrelevant files (#31144)

* Manifest directory may not contain manifest files: exclude non-manifest files
* Manifest files use different name for rocmcc: add translation for it
This commit is contained in:
Peter Scheibel 2022-06-16 13:16:48 -07:00 committed by GitHub
parent 8c3b82c140
commit 392b548312
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -177,7 +177,10 @@ def _collect_and_consume_cray_manifest_files(
for directory in manifest_dirs:
for fname in os.listdir(directory):
manifest_files.append(os.path.join(directory, fname))
if fname.endswith('.json'):
fpath = os.path.join(directory, fname)
tty.debug("Adding manifest file: {0}".format(fpath))
manifest_files.append(os.path.join(directory, fpath))
if not manifest_files:
raise NoManifestFileError(
@ -185,6 +188,7 @@ def _collect_and_consume_cray_manifest_files(
.format(cray_manifest.default_path))
for path in manifest_files:
tty.debug("Reading manifest file: " + path)
try:
cray_manifest.read(path, not dry_run)
except (spack.compilers.UnknownCompilerError, spack.error.SpackError) as e:

View file

@ -20,6 +20,7 @@
compiler_name_translation = {
'nvidia': 'nvhpc',
'rocm': 'rocmcc',
}