I'm working on a SConsPackage base class and started debugging some SCons builds. I discovered that SCons ignores the CC environment variable. If I add 'CC={0}'.format(spack_cc) to the serf build line, it actually uses Spack's compiler wrappers, but I end up seeing the following error message:
Spack compiler must be run from Spack! Input 'SPACK_PREFIX' is missing.
Maybe SCons purifies the build environment for some reason? We might need a way to work around this. For now I'll tell it to use the actual compilers and manually set -L and -I.