diff --git a/lib/spack/spack/modules/common.py b/lib/spack/spack/modules/common.py index 84aec55e8fb..501f76622d3 100644 --- a/lib/spack/spack/modules/common.py +++ b/lib/spack/spack/modules/common.py @@ -54,9 +54,9 @@ #: Root folders where the various module files should be written if spack.config.get('config:shared') and 'SPACK_PATH' in os.environ: - roots = {'tcl': os.environ['SPACK_PATH'] + '/share/spack/modules', - 'lmod': os.environ['SPACK_PATH'] + '/share/spack/lmod', - 'dotkit': os.environ['SPACK_PATH'] + '/share/spack/lmod'} + roots = {'tcl': os.path.join(spack.util.path.canonicalize_path("$home/.spack") ,'/share/spack/modules'), + 'lmod': os.path.join(spack.util.path.canonicalize_path("$home/.spack") ,'/share/spack/lmod'), + 'dotkit': os.path.join(spack.util.path.canonicalize_path("$home/.spack") ,'/share/spack/lmod')} elif spack.config.get('config:shared') and 'SPACK_PATH' not in os.environ: tty.info("""Shared mode enabled but, $SPACK_PATH environment variable is undefined.""")