Skip to content

Commit

Permalink
Generate a proxy script for spack with last environment used
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienbernede committed Sep 2, 2020
1 parent 2331521 commit 5b804cd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions uberenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@

import os
import sys
import stat
import subprocess
import shutil
import socket
Expand Down Expand Up @@ -421,6 +422,16 @@ def load(self):

self.spack_cmd = "{} -e {}".format(self.spack_cmd,self.config_dir())

# A simple proxy script for spack
uber_spack='#!/bin/bash\n$(dirname ${{0}})/{} "$@"\n'.format(self.spack_cmd)

with open('uber-spack','w+') as script:
script.write(uber_spack)

# Making the script executable
st = os.stat('uber-spack')
os.chmod('uber-spack', st.st_mode | stat.S_IEXEC)

# hot-copy our packages into spack
if self.pkgs:
dest_spack_pkgs = pjoin(self.dest_spack,"var","spack","repos","builtin","packages")
Expand Down

0 comments on commit 5b804cd

Please sign in to comment.