diff options
author | nickpdemarco <nickpdemarco@gmail.com> | 2023-10-11 14:43:05 -0400 |
---|---|---|
committer | nickpdemarco <nickpdemarco@gmail.com> | 2023-10-11 14:43:05 -0400 |
commit | 9cda199e40c920fcc9c53082b0dabb17d31a8b7f (patch) | |
tree | a4e9a03a9feea17376f5990e19c12818d32ec95e /lib/compilers/golang.ts | |
parent | 55a2b1455f823026c78b9219f93799af00ef60ae (diff) | |
parent | 10796b3696cf1eef928de8c750b4d3350ee0c2db (diff) | |
download | compiler-explorer-9cda199e40c920fcc9c53082b0dabb17d31a8b7f.tar.gz compiler-explorer-9cda199e40c920fcc9c53082b0dabb17d31a8b7f.zip |
Merge main, resolve conflicts with vala
Diffstat (limited to 'lib/compilers/golang.ts')
-rw-r--r-- | lib/compilers/golang.ts | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/lib/compilers/golang.ts b/lib/compilers/golang.ts index 1914b3806..903278461 100644 --- a/lib/compilers/golang.ts +++ b/lib/compilers/golang.ts @@ -31,7 +31,7 @@ import {unwrap} from '../assert.js'; import {BaseCompiler} from '../base-compiler.js'; import * as utils from '../utils.js'; -import {ClangParser} from './argument-parsers.js'; +import {GolangParser} from './argument-parsers.js'; // Each arch has a list of jump instructions in // Go source src/cmd/asm/internal/arch. @@ -60,9 +60,20 @@ export class GolangCompiler extends BaseCompiler { constructor(compilerInfo: PreliminaryCompilerInfo, env) { super(compilerInfo, env); - const goroot = this.compilerProps<string | undefined>(`compiler.${this.compiler.id}.goroot`); - const goarch = this.compilerProps<string | undefined>(`compiler.${this.compiler.id}.goarch`); - const goos = this.compilerProps<string | undefined>(`compiler.${this.compiler.id}.goos`); + const group = this.compiler.group; + + const goroot = this.compilerProps<string | undefined>( + 'goroot', + this.compilerProps<string | undefined>(`group.${group}.goroot`), + ); + const goarch = this.compilerProps<string | undefined>( + 'goarch', + this.compilerProps<string | undefined>(`group.${group}.goarch`), + ); + const goos = this.compilerProps<string | undefined>( + 'goos', + this.compilerProps<string | undefined>(`group.${group}.goos`), + ); this.GOENV = {}; if (goroot) { @@ -215,7 +226,7 @@ export class GolangCompiler extends BaseCompiler { result.asm = this.convertNewGoL(out); result.stderr = []; result.stdout = utils.parseOutput(logging, result.inputFilename); - return Promise.all([result, '']); + return Promise.all([result, '', '']); } override getSharedLibraryPathsAsArguments() { @@ -245,13 +256,19 @@ export class GolangCompiler extends BaseCompiler { } override getDefaultExecOptions() { - return { + const options = { ...super.getDefaultExecOptions(), + }; + + options.env = { + ...options.env, ...this.GOENV, }; + + return options; } - override getArgumentParser() { - return ClangParser; + override getArgumentParser(): any { + return GolangParser; } } |