mache.spack.activation.capture_activation

mache.spack.activation.capture_activation(*, spack_path, env_name, prologue_path, work_dir)[source]

Run spack env activate --sh for an environment in a fresh login shell and rewrite its output relative to that shell’s environment.

Parameters:
  • spack_path (str) – The Spack checkout ($SPACK_ROOT)

  • env_name (str) – The managed environment to capture

  • prologue_path (str) – The shell script with the module loads and variables the environment was built with

  • work_dir (str) – Where <env_name>.env_before and <env_name>.raw_activate.sh are written

Returns:

modifications (list of tuple) – The rewritten modifications, see rewrite_modifications()