cea-hpc / modules

Environment Modules: provides dynamic modification of a user's environment
http://modules.sourceforge.net/
GNU General Public License v2.0
668 stars 102 forks source link

`source-sh` and `sh-to-mod` fail with fish 3.5 #463

Closed xdelaruelle closed 2 years ago

xdelaruelle commented 2 years ago

Evaluation of fish shell script through the source-sh modulefile command fails with latest fish version (3.5).

$ fish --version
fish, version 3.5.0
$ module --version
Modules Release 5.1.1 (2022-05-31)
$ module use testsuite/modulefiles.2
$ cat testsuite/modulefiles.2/source-sh/7.2
#%Module
source-sh fish testsuite/example/sh-to-mod.fish
module-whatis [module-info name]
$ module load source-sh/7.2
Loading source-sh/7.2
  Module ERROR: Script 'testsuite/example/sh-to-mod.fish' exited abnormally
        while executing
    "source-sh fish testsuite/example/sh-to-mod.fish"
        (file "/path/to/modules/testsuite/modulefiles.2/source-sh/7.2" line 2)
    Please contact <root@localhost>

Issue also impacts sh-to-mod sub-command:

$ module sh-to-mod fish testsuite/example/sh-to-mod.fish
ERROR: Script 'testsuite/example/sh-to-mod.fish' exited abnormally
xdelaruelle commented 2 years ago

Issue is due to the regex-easyesc option which is now turned on by default: https://fishshell.com/docs/current/relnotes.html?highlight=fish_features#fish-3-5-0-released-june-16-2022