Since updating to F28, a number of locally-written zsh scripts output the following at startup: /usr/share/Modules/init/sh:36: no such file or directory: eval LD_LIBRARY_PATH='' /usr/bin/tclsh This did not happen with F27, probably because /usr/share/Modules/init/sh was only 15 lines there, and now it's 115 lines. I'm honestly not entirely sure why all of that code needs to be executed for every shell startup, but it is. And since I don't have tcl installed, that code spews an error. Maybe something like this? --- sh.orig 2018-06-01 14:15:47.479638526 -0500 +++ sh 2018-06-01 14:16:59.927397641 -0500 @@ -33,7 +33,9 @@ # define module command and surrounding initial environment (default value # for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init/.modulespath) -eval "`${_mlre:-}/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl sh autoinit`" +if [ -x "${_mlre:-}/usr/bin/tclsh" ]; then + eval "`${_mlre:-}/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl sh autoinit`" +fi # clean temp variables used to setup quarantine if [ -n "${_mlIFS+x}" ]; then Though I don't know how portable -x is; this code doesn't use [[...]] so I assume it's trying to be broadly portable. If not, -f works too. Or perhaps just redirecting stderr in there?
tcl is the main requirement of environment-modules. tcl package should be installed to use environment-modules. Elsewhere there is no interest to go through the environment-modules initialization script at all. To solve this issue I believe you should either install tcl or remove environment-modules if it is not useful for you.
Hmm, then I'm a bit confused. I swear I didn't have /usr/bin/tclsh (because in general I have no use for tcl) but.... there it is. I personally don't need environment-modules, either, but it's in the dependency chain for Macaulay2, which I do need. In any case, the error is real, and the patch does make it go away. When I just run eval "`${_mlre:-}/usr/bin/tclsh /usr/share/Modules/libexec/modulecmd.tcl sh autoinit`" In a shell (zsh) it doesn't return any output. The error message suggests that "${_mlre:-}" is simply empty. Looking more closely, it really looks like it's trying to actually execute "eval LD_LIBRARY_PATH='' /usr/bin/tclsh" as a single command. I can duplicate the error message, at least, by just entering this (with the quotes): "eval LD_LIBRARY_PATH='' /usr/bin/tclsh" So... something is definitely wrong. Maybe there's a zsh incompatibility here?
After investigating further, I was wrong again. The fundamental problem here is that if your shell sources /etc/profile on script invocation, the environment-modules code misdetects the shell and will then always call the bash/sh init code. /etc/profile.d/modules.sh contains the following: shell=$(/usr/bin/basename $(/usr/bin/ps -p $$ -ocomm=)) if [ -f /usr/share/Modules/init/$shell ]; then . /usr/share/Modules/init/$shell else . /usr/share/Modules/init/sh fi And that ps line will get the name of the script, not of the shell. It's been like that for a while, but it only really started to matter in F28. In any case, I redid my personal configuration to avoid sourcing /etc/profile on script invocation so I guess I won't be seeing this any longer. I filed https://github.com/cea-hpc/modules/issues/173 upstream.
Fixed in upstream bugfix release v4.1.3
environment-modules-4.1.3-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-082f52eeac
environment-modules-4.1.3-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-082f52eeac
environment-modules-4.1.3-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.