-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhancement proposal : boolean support for when=<arg> #299
Conversation
This introduces a new function Another issue I see is that the value of Finally, I wonder what this means for "architecture": Why should the default value for "architecture" be something like "linux-i686" if architecture can be set to anything and is unrelated to the OS? I think you have the need for a certain Spack feature, and being able to freely change the architecture setting is working well for you. I don't think this is how the architecture was intended to be used -- look at the default values. Instead of defining a new entity that will, ultimately, be designed quite identically to the way "architecture" is currently designed, you could describe exactly what feature you need, and then have it added to Spack. Let's call it "features" instead of architecture for the moment. Here are some questions:
|
The OpenSSL part of this has already been fixed, but the rest looks useful. There are some dependencies which are platform specific (Qt shouldn't depend on D-Bus or GTK on OS X since neither is really there to integrate with anyways). |
enhancement proposal : boolean support for when=<arg>
merged #299. |
Add w3emc 2.10.0 and update variants, run env logic
Rationale
This PR extends the
when=<arg>
keyword to Boolean arguments in both multi-methods anddepends_on
directives. This opens the possibility to use predicates that can be evaluated at package definition time to conditionally enable a dependency.Modifications
depends_on
directive andwhen
type objects can now manage Boolean argumentsmultimethod.py
(class declaration repeated twice)Example of use : OS related dependencies
I started this PR as an alternative solution to what is proposed in #268 and similar PRs. You may refer there for the details of the discussion, but to make it short the idea is to usesys.platform
to discriminate among different operative systems and provide a less invasive way to build packages on OSX. The benefits of this approach are that:nobody will be forced to use a given name for his architectureinconsistencies among similar systems will be hopefully avoided (=linux
won't be satisfied by=chaos_5_x86_64_ib
or by=linux-x86_64
, etc.)the set of possible values to be used in the predicates is part of python documentation (and as such we don't have to agree on them)@tgamblin , @eschnett , @nrichart , @trws : any comment is appreciated.
Also, I don't have access to a MAC so I was not able to try an installation of OpenSSL ondarwin
. I tried though to switch the two install methods (having thedarwin
one as default and using@when(arch.os_is_in('linux2'))
on the other) and that worked for me.