Skip to content

Enables list filtering

Eduardo Garcia Carvalho Dias Rothe requested to merge dev/skip-list into releases/syrah

This PR enables new syntax in the package list header to filter package lists. This is usefull to filter the installation of packages according some criteria, such as, the platform specs. As an example, this PR will allow the new filters: ['gpu'] key in the configuration area of the lst and the result is that the list will only be part of the stack if every filter defined in the platform yaml file do not contain the word 'none'

The following command was issued before and after this change:

spack write-spack-yaml -p jed -s syrah

No differences were shown between the two commands.

With this PR the following package list can be included in the stack file:

gpu_packages:
  metadata: {section: packages }
  pe: [gcc_stable]
  filters: ['gpu']
  packages:
    - cuda

This package list will not be present in the manifest file if the platform has no gpu:

platform:
  filters:
    gpu: none

More than one filter can exist in the filters list in the package list configuration header. The package list will be skipped if at least one filter if found with the property 'none' (in the platform file). Notice that this is the string 'none' and not the python built-in constant.

Merge request reports