diff --git a/lib/base-compiler.ts b/lib/base-compiler.ts index 8fb7914178d..3ad4cd3f66e 100644 --- a/lib/base-compiler.ts +++ b/lib/base-compiler.ts @@ -1447,9 +1447,9 @@ export class BaseCompiler implements ICompiler { } async buildExecutableInFolder(key, dirPath): Promise { - const buildEnvironment = this.setupBuildEnvironment(key, dirPath, true); - const writeSummary = await this.writeAllFiles(dirPath, key.source, key.files, key.filters); + const downloads = await this.setupBuildEnvironment(key, dirPath, true); + const inputFilename = writeSummary.inputFilename; const outputFilename = this.getExecutableFilename(dirPath, this.outputFilebase, key); @@ -1472,7 +1472,6 @@ export class BaseCompiler implements ICompiler { const execOptions = this.getDefaultExecOptions(); execOptions.ldPath = this.getSharedLibraryPathsAsLdLibraryPaths(key.libraries); - const downloads = await buildEnvironment; const result = await this.buildExecutable(key.compiler.exe, compilerArguments, inputFilename, execOptions); return { @@ -1714,8 +1713,6 @@ export class BaseCompiler implements ICompiler { } async doCompilation(inputFilename, dirPath, key, options, filters, backendOptions, libraries, tools) { - const buildEnvironment = this.setupBuildEnvironment(key, dirPath, filters.binary); - const inputFilenameSafe = this.filename(inputFilename); const outputFilename = this.getOutputFilename(dirPath, this.outputFilebase, key); @@ -1742,7 +1739,7 @@ export class BaseCompiler implements ICompiler { const makeGccDump = backendOptions.produceGccDump && backendOptions.produceGccDump.opened && this.compiler.supportsGccDump; - const downloads = await buildEnvironment; + const downloads = await this.setupBuildEnvironment(key, dirPath, filters.binary); const [ asmResult, astResult,