Move EESSI initialisation to module file

Right now we are sourcing a script to do the initialisation of EESSI, but this could done in a reversible way via a module file (which would also allow us to support all the shells that Lmod supports).

Lmod can already tell you what a modulefile could look like based on the environment changes a script brings:

/cvmfs/software.eessi.io/versions/2023.06/compat/linux/x86_64/usr/share/Lmod/libexec/sh_to_modulefile /cvmfs/software.eessi.io/versions/2023.06/init/bash > check.lua

After cleaning out all the stuff related to Lmod itself (and some reordering and comments), the changes are not so large:

-- this would be the version of the module
setenv("EESSI_VERSION","2023.06")
-- I think we can assume these two:
-- * everything is built on top of software.eessi.io
-- * MacOS support is via lima (so still reports linux)
setenv("EESSI_CVMFS_REPO","/cvmfs/software.eessi.io")
setenv("EESSI_OS_TYPE","linux")
-- what we need to know from archdetect
-- * need to cycle over options
-- * need to allow overriding via EESSI_SOFTWARE_SUBDIR_OVERRIDE
setenv("EESSI_SOFTWARE_SUBDIR","x86_64/intel/skylake_avx512")
-- EESSI starting point (from here on is derived settings)
setenv("EESSI_PREFIX","/cvmfs/software.eessi.io/versions/2023.06")
-- setting up the compat layer
setenv("EESSI_CPU_FAMILY","x86_64")
setenv("EESSI_EPREFIX","/cvmfs/software.eessi.io/versions/2023.06/compat/linux/x86_64")
setenv("EPREFIX","/cvmfs/software.eessi.io/versions/2023.06/compat/linux/x86_64")
prepend_path("PATH","/cvmfs/software.eessi.io/versions/2023.06/compat/linux/x86_64/bin")
prepend_path("PATH","/cvmfs/software.eessi.io/versions/2023.06/compat/linux/x86_64/usr/bin")
-- setting up EESSI
setenv("EESSI_SOFTWARE_PATH","/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/skylake_avx512")
setenv("EESSI_MODULEPATH","/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/skylake_avx512/modules/all")
setenv("EESSI_SITE_MODULEPATH","/cvmfs/software.eessi.io/host_injections/2023.06/software/linux/x86_64/intel/skylake_avx512/modules/all")
setenv("MODULEPATH","/cvmfs/software.eessi.io/host_injections/2023.06/software/linux/x86_64/intel/skylake_avx512/modules/all:/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/skylake_avx512/modules/all")
-- setting up Lmod for this EESSI version
setenv("LMOD_CONFIG_DIR","/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/skylake_avx512/.lmod")
setenv("LMOD_PACKAGE_PATH","/cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/intel/skylake_avx512/.lmod")
-- can drop these two
setenv("EESSI_USE_ARCHDETECT","1")
setenv("EESSI_USE_ARCHSPEC","0")

Or course we can't just set the variables, we'll need logic around a few of them and also the override capabilities that exist in the current initialisation scripts, but things are not that complicated.

Edited by ocaisa