Skip to content
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

Inconsistent result returned by zsh completion script when quarantine variables are defined #350

Closed
xdelaruelle opened this issue Jul 26, 2020 · 0 comments
Labels
Milestone

Comments

@xdelaruelle
Copy link
Member

When some environment variables are defined for Modules quarantine mechanism:

$ module config run_quarantine 
Modules Release 4.5.1 (2020-06-01)

- Config. name ---------.- Value (set by if default overridden) ---------------
run_quarantine            LD_LIBRARY_PATH LD_PRELOAD (env-var)

Completion script on Zsh shell returns inconsistent results:

$ zsh
% autoload compinit
% compinit
% module -V
Modules Release 4.5.1 (2020-06-01)
% module avail<tab>
be                    load
\(cannot              module-git
cannot                module-info
dot                   modules
dynamically           mpi/
ERROR:                null
executable\):         object
from                  position-independent
ignored.              preloaded
LD_PRELOAD            use.own
ld.so:                \'/usr/bin/tclsh\'

It seems related to the evaluation of following line in _module_raw shell function:

$ /usr/share/Modules/libexec/modulecmd.tcl zsh autoinit
_module_raw() {
...
      eval `eval ${=_mlre}/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl zsh '"$@"'`;
...

Quarantine variables set in _mlre variable are expanded to the /usr/bin/tclsh value rather being set empty.

@xdelaruelle xdelaruelle added this to the 4.6 milestone Jul 26, 2020
xdelaruelle added a commit to xdelaruelle/modules that referenced this issue Jul 28, 2020
Clearly separate quarantine variable definition from tclsh binary on
modulecmd.tcl evaluated command call in _module_raw function for sh,
bash, ksh and zsh shells.

When _module_raw is evaluted in zsh completion process, the command call
was not correctly generated and location of tclsh binary was the value
set to all quarantine variable declared. Which in case of LD_PRELOAD,
led to error messages.

Fixes cea-hpc#350.
@xdelaruelle xdelaruelle modified the milestones: 4.6, 4.5.2 Jul 29, 2020
xdelaruelle added a commit to xdelaruelle/modules that referenced this issue Jul 29, 2020
Clearly separate quarantine variable definition from tclsh binary on
modulecmd.tcl evaluated command call in _module_raw function for sh,
bash, ksh and zsh shells.

When _module_raw is evaluted in zsh completion process, the command call
was not correctly generated and location of tclsh binary was the value
set to all quarantine variable declared. Which in case of LD_PRELOAD,
led to error messages.

Fixes cea-hpc#350.
xdelaruelle added a commit to xdelaruelle/modules that referenced this issue Jul 30, 2020
Clearly separate quarantine variable definition from tclsh binary on
modulecmd.tcl evaluated command call in _module_raw function for sh,
bash, ksh and zsh shells.

When _module_raw is evaluted in zsh completion process, the command call
was not correctly generated and location of tclsh binary was the value
set to all quarantine variable declared. Which in case of LD_PRELOAD,
led to error messages.

Fixes cea-hpc#350.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant