Open ghost opened 9 years ago
@olavks: hmm, I'm missing the point here. What do you want achieve exactly here?
Why not simply set $EASYBUILD_SUFFIX_MODULES_PATH
to an empty string? That matches with your intention of using an empty suffix?
yes, not been able to have Lmod set empty variables... Could be something im missing. But right now I'm forced to stick with "all". or rename it. I cannot have it empty.
@rtmclay: how would you define an env var as empty in a Lua module?
You can't
Well, that's... unfortunate. @rtmclay: Are you aware of what the particular reason is for not having this supported?
There hasn't be much call for setting an env. var. be an empty string. In the shell it is not straightforward to tell the difference between a variable not being set and being set to "". Internally Lmod has always used an empty string as meaning to unset the variable.
From a program, I can see that one might want to store strings set to be an empty string. So I have modified Lmod to support this. You can now do:
setenv("EMPTY_STRING","")
to set a variable to have an empty string as a value.
This version is 5.7.3 at the git repo. Feel free to give this new version a test drive. This change passes all my regressions tests. But using an empty string to mark when a variable is to be unset has been part of the original design of Lmod. I may have missed a case or two. Please let me know if you find any that I've missed.
@olavks: any luck with trying Lmod 5.7.3 for setting env vars empty?
Yes, all the changes worked.
On 17 August 2014 20:40, Kenneth Hoste notifications@github.com wrote:
@olavks https://github.com/olavks: any luck with trying Lmod 5.7.3 for setting env vars empty?
— Reply to this email directly or view it on GitHub https://github.com/hpcugent/easybuild-framework/issues/997#issuecomment-52432368 .
@olavks: so, this can be closed then? (I prefer not closing issues opened by someone else)
That depends on if you think that there doesn't need to be False, None or Empty support for all options or not(not sure if its a good idea or not)?
On 18 August 2014 13:54, Kenneth Hoste notifications@github.com wrote:
@olavks https://github.com/olavks: so, this can be closed then (I prefer not closing issues opened by someone else)
— Reply to this email directly or view it on GitHub https://github.com/hpcugent/easybuild-framework/issues/997#issuecomment-52487684 .
@olavks: Picking up an old issue... I'm not sure what you mean by your last comment...
For most options, an empty matching environment variable $EASYBUILD_X
has a meaning (e.g. equivalent to False
or []
or None
) , but maybe not for all. It basically depends on the "action" assigned to the option (see easybuild/tools/options.py
), i.e. store
, store_true
, store_or_None
, extend
, etc. For options for which choice
is specified an empty env var doesn't make sense (unless an empty value is a possible choice, of course).
Does that answer the question you had?
configuration options supporting empty strings must alse be able to support either False, None or Empty such that these can be configured using e.g. Lmod modules. setenv('EASYBUILD_SUFFIX_MODULES_PATH', nil ) -- doesnt work.
Of course, could be a Lua trick im not aware. But for simplicity it should be supported.