Skip to content

Commit

Permalink
spack ci rebuild: Don't install in a login shell
Browse files Browse the repository at this point in the history
On some systems the shell in login mode wipes important parts of the
environment, such as PATH. This causes the build to fail since it can't
find `spack`.

For better robustness, don't use a login shell.
  • Loading branch information
blue42u committed Jul 30, 2022
1 parent ec87924 commit de3fc31
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/spack/spack/cmd/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,9 @@ def ci_rebuild(args):
install_copy_path = os.path.join(repro_dir, 'install.sh')
shutil.copyfile('install.sh', install_copy_path)

# Run the generated install.sh shell script as if it were being run in
# a login shell.
# Run the generated install.sh shell script
try:
install_process = subprocess.Popen(['bash', '-l', './install.sh'])
install_process = subprocess.Popen(['bash', './install.sh'])
install_process.wait()
install_exit_code = install_process.returncode
except (ValueError, subprocess.CalledProcessError, OSError) as inst:
Expand Down

0 comments on commit de3fc31

Please sign in to comment.