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

Method runCompiler

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

Source from the content-addressed store, hash-verified

115 }
116
117 override async runCompiler(
118 compiler: string,
119 options: string[],
120 inputFilename: string,
121 execOptions: ExecutionOptionsWithEnv,
122 ): Promise<CompilationResult> {
123 if (!execOptions) {
124 execOptions = this.getDefaultExecOptions();
125 }
126
127 if (!execOptions.customCwd) {
128 execOptions.customCwd = path.dirname(inputFilename);
129 }
130
131 // Compile to bytecode via `raco make`
132 options = [...options];
133 options.unshift('make');
134
135 // Replace input filename (which may be different than the default)
136 // as in pipeline mode below
137 options.pop();
138 options.push(inputFilename);
139
140 const makeResult = await this.exec(this.raco, options, execOptions);
141
142 return this.transformToCompilationResult(makeResult, inputFilename);
143 }
144
145 override getOutputFilename(dirPath: string, outputFilebase: string, key?: any): string {
146 return path.join(dirPath, 'compiled', `${this.compileFilename.replace('.', '_')}.zo`);

Callers 1

generateOptPipelineMethod · 0.95

Calls 5

pushMethod · 0.80
getDefaultExecOptionsMethod · 0.45
popMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected