         return clangCompiler
     }
 
-    public init(destination: Destination, environment: [String:String] = Process.env) throws {
+    public init(destination: Destination, environment: [String: String] = Process.env) throws {
         self.destination = destination
+        self.processEnvironment = environment
 
         // Get the search paths from PATH.
         let searchPaths = getEnvSearchPaths(

        return lookupExecutablePath(filename: getenv(variable), searchPaths: searchPaths)
    }

    public func getClangCompiler() throws -> AbsolutePath {

        if let clangCompiler = _clangCompiler {

            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`")
            }
