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

Method runCompiler

lib/compilers/lua.ts:80–106  ·  view source on GitHub ↗
(
        compiler: string,
        options: string[],
        inputFilename: string,
        execOptions: ExecutionOptionsWithEnv,
        filters?: ParseFiltersAndOutputOptions,
    )

Source from the content-addressed store, hash-verified

78 }
79
80 override async runCompiler(
81 compiler: string,
82 options: string[],
83 inputFilename: string,
84 execOptions: ExecutionOptionsWithEnv,
85 filters?: ParseFiltersAndOutputOptions,
86 ): Promise<CompilationResult> {
87 if (!execOptions) {
88 execOptions = this.getDefaultExecOptions();
89 }
90 if (!execOptions.customCwd) {
91 execOptions.customCwd = path.dirname(inputFilename);
92 }
93
94 const luacArgs = this.getDisassemblyArgs(options, inputFilename);
95 const result = await this.exec(compiler, luacArgs, execOptions);
96
97 const outputFilename = this.getOutputFilename(path.dirname(inputFilename), this.outputFilebase);
98 await fs.writeFile(outputFilename, result.stdout);
99 result.stdout = '';
100
101 return {
102 ...this.transformToCompilationResult(result, inputFilename),
103 languageId: this.getCompilerResultLanguageId(filters),
104 instructionSet: this.getInstructionSetFromCompilerArgs(luacArgs),
105 };
106 }
107
108 override async handleInterpreting(
109 key: CacheKey,

Callers

nothing calls this directly

Calls 7

getDisassemblyArgsMethod · 0.95
getOutputFilenameMethod · 0.65
getDefaultExecOptionsMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected