summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorGeoffrey Oxberry <goxberry@gmail.com>2018-02-13 23:41:50 -0800
committerMassimiliano Culpo <massimiliano.culpo@gmail.com>2018-02-14 08:41:50 +0100
commitc7274eb1f51f2f95695a1efc5b3cd9ac9afafdf6 (patch)
tree38333f8c1f47acb2d1f77dac76778dc0e73350f7 /var
parent8766daf9de5b9879fca32aedac849d446fe1000e (diff)
downloadspack-c7274eb1f51f2f95695a1efc5b3cd9ac9afafdf6.tar.gz
spack-c7274eb1f51f2f95695a1efc5b3cd9ac9afafdf6.tar.bz2
spack-c7274eb1f51f2f95695a1efc5b3cd9ac9afafdf6.tar.xz
spack-c7274eb1f51f2f95695a1efc5b3cd9ac9afafdf6.zip
gdbm: fix lmod global name 'spack_cc' undefined (#7225)
Prior to this commit, running `spack module refresh` with `gdbm` installed throws the warning: ```console ==> Warning: Could not write module file [/Users/oxberry1/spack/share/spack/lmod/darwin-sierra-x86_64/Core/gdbm/1.14.1.lua] ==> Warning: --> global name 'spack_cc' is not defined <-- ``` This warning is repeated for every `gdbm` installation in Spack. The cause of the issue seems to be the same as in spack/spack (#6089): using `spack_cc`, `spack_cxx`, or similar inside `configure_args` causes the warnings to throw when module files are generated. Moving the use of `spack_cc` into `setup_environment` seems to fix the problem, even though it's a bit of a kludge.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/gdbm/package.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/gdbm/package.py b/var/spack/repos/builtin/packages/gdbm/package.py
index a1529855c3..9a5f1bd12e 100644
--- a/var/spack/repos/builtin/packages/gdbm/package.py
+++ b/var/spack/repos/builtin/packages/gdbm/package.py
@@ -45,10 +45,12 @@ class Gdbm(AutotoolsPackage):
depends_on("readline")
+ def setup_environment(self, spack_env, run_env):
+ spack_env.set('CC', spack_cc)
+
def configure_args(self):
config_args = [
'--enable-libgdbm-compat',
- 'CC=%s' % spack_cc
]
return config_args