summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/go/package.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/go/package.py b/var/spack/repos/builtin/packages/go/package.py
index 3ff9b2bf20..cfd03ec355 100644
--- a/var/spack/repos/builtin/packages/go/package.py
+++ b/var/spack/repos/builtin/packages/go/package.py
@@ -104,8 +104,14 @@ class Go(Package):
shutil.copy2(f, os.path.join(prefix, f))
def setup_environment(self, spack_env, run_env):
- spack_env.set('GOROOT_FINAL', self.spec.prefix)
- spack_env.set('GOROOT_BOOTSTRAP', self.spec['go-bootstrap'].prefix)
+ try:
+ spack_env.set('GOROOT_FINAL', self.spec.prefix)
+ spack_env.set('GOROOT_BOOTSTRAP', self.spec['go-bootstrap'].prefix)
+ except KeyError:
+ # Needed because we try to get a build-only
+ # dependency, and this may fail during module
+ # file creation
+ pass
def setup_dependent_package(self, module, ext_spec):
"""Called before go modules' install() methods.