spack arch: --known-platforms and --known-operating-systems

Created on 2 Feb 2020  路  1Comment  路  Source: spack/spack

spack arch currently has a --known-targets flag that prints a list of targets it is capable of detecting. I would like to add --known-platforms and --known-operating-systems flags that do the same thing.

Rationale

Oftentimes, when writing a package, you need to add conflicts for all platforms/OSes other than a certain one. For example, py-matplotlib backend=macosx only works on darwin, so the package contains:

    msg = 'MacOSX backend requires the Cocoa headers included with XCode'       
    conflicts('platform=linux', when='backend=macosx', msg=msg)                 
    conflicts('platform=bgq',   when='backend=macosx', msg=msg)                 
    conflicts('platform=cray',  when='backend=macosx', msg=msg) 

However, I have no way of knowing if this is all the platforms that Spack knows of. Until we have a way of expressing "not" in the spec syntax, we should at least be able to list all platforms/OSes Spack is aware of.

commands feature platform-support

Most helpful comment

I completely agree with adding the two flags, but the use case would probably be better solved by allowing logical operators in constraints:

conflicts('backend=macosx', 'NOT platform=darwin', msg=msg)

>All comments

I completely agree with adding the two flags, but the use case would probably be better solved by allowing logical operators in constraints:

conflicts('backend=macosx', 'NOT platform=darwin', msg=msg)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

JavierCVilla picture JavierCVilla  路  3Comments

nazavode picture nazavode  路  3Comments

gweodoo picture gweodoo  路  3Comments

eschnett picture eschnett  路  3Comments

citibeth picture citibeth  路  3Comments