         return lookupExecutablePath(filename: getenv(variable), searchPaths: searchPaths)
     }
 
+    /// Environment to use when looking up tools.
+    private let processEnvironment: [String: String]
+
     public func getClangCompiler() throws -> AbsolutePath {
 
         if let clangCompiler = _clangCompiler {

        return clangCompiler
    }

    public init(destination: Destination, environment: [String:String] = Process.env) throws {
        self.destination = destination

        // Get the search paths from PATH.
        let searchPaths = getEnvSearchPaths(

            clangCompiler = value
        } else {
            // No value in env, so search for `clang`.
            let foundPath = try Process.checkNonZeroExit(arguments: whichClangArgs, environment: processEnvironment).chomp()
            guard !foundPath.isEmpty else {
                throw InvalidToolchainDiagnostic("could not find `clang`")
            }
