build_environment: fix ccache error handling (#44740)
This commit is contained in:
		@@ -72,6 +72,7 @@
 | 
				
			|||||||
import spack.store
 | 
					import spack.store
 | 
				
			||||||
import spack.subprocess_context
 | 
					import spack.subprocess_context
 | 
				
			||||||
import spack.user_environment
 | 
					import spack.user_environment
 | 
				
			||||||
 | 
					import spack.util.executable
 | 
				
			||||||
import spack.util.path
 | 
					import spack.util.path
 | 
				
			||||||
import spack.util.pattern
 | 
					import spack.util.pattern
 | 
				
			||||||
from spack import traverse
 | 
					from spack import traverse
 | 
				
			||||||
@@ -458,10 +459,7 @@ def set_wrapper_variables(pkg, env):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    # Find ccache binary and hand it to build environment
 | 
					    # Find ccache binary and hand it to build environment
 | 
				
			||||||
    if spack.config.get("config:ccache"):
 | 
					    if spack.config.get("config:ccache"):
 | 
				
			||||||
        ccache = Executable("ccache")
 | 
					        env.set(SPACK_CCACHE_BINARY, spack.util.executable.which_string("ccache", required=True))
 | 
				
			||||||
        if not ccache:
 | 
					 | 
				
			||||||
            raise RuntimeError("No ccache binary found in PATH")
 | 
					 | 
				
			||||||
        env.set(SPACK_CCACHE_BINARY, ccache)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Gather information about various types of dependencies
 | 
					    # Gather information about various types of dependencies
 | 
				
			||||||
    link_deps = set(pkg.spec.traverse(root=False, deptype=("link")))
 | 
					    link_deps = set(pkg.spec.traverse(root=False, deptype=("link")))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user