diff --git a/lib/spack/spack/mixins.py b/lib/spack/spack/mixins.py index 189c3947ef..ef1d2b7916 100644 --- a/lib/spack/spack/mixins.py +++ b/lib/spack/spack/mixins.py @@ -93,7 +93,7 @@ def _filter_compiler_wrappers_impl(pkg_or_builder): replacements = [] for idx, (env_var, compiler_path) in enumerate(compiler_vars): - if env_var in os.environ: + if env_var in os.environ and compiler_path is not None: # filter spack wrapper and links to spack wrapper in case # build system runs realpath wrapper = os.environ[env_var]