MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / runCompiler

Method runCompiler

lib/compilers/pony.ts:92–112  ·  view source on GitHub ↗
(
        compiler: string,
        options: string[],
        inputFilename: string,
        execOptions: ExecutionOptionsWithEnv,
    )

Source from the content-addressed store, hash-verified

90 }
91
92 override async runCompiler(
93 compiler: string,
94 options: string[],
95 inputFilename: string,
96 execOptions: ExecutionOptionsWithEnv,
97 ): Promise<CompilationResult> {
98 if (!execOptions) {
99 execOptions = this.getDefaultExecOptions();
100 }
101
102 if (!execOptions.customCwd) {
103 execOptions.customCwd = path.dirname(inputFilename);
104 }
105
106 // Pony operates upon the directory as a whole, not files it seems
107 // So we must set the input to the directory rather than a file.
108 options = options.map(arg => (arg.includes(inputFilename) ? path.dirname(arg) : arg));
109
110 const compilerExecResult = await this.exec(compiler, options, execOptions);
111 return this.transformToCompilationResult(compilerExecResult, inputFilename);
112 }
113}

Callers 1

generateIRMethod · 0.95

Calls 3

getDefaultExecOptionsMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected