diff options
author | Patrick Quist <partouf@gmail.com> | 2023-04-19 22:01:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-19 22:01:31 +0200 |
commit | b889cd6bc300ee9a3d195b1994671c54be5c4811 (patch) | |
tree | 3807e5eb97ab18808a879e9daa922b90f76adab1 | |
parent | e57ba99ce7c3e417c90ad6638727a0c3544292b9 (diff) | |
download | compiler-explorer-gh-7112.tar.gz compiler-explorer-gh-7112.zip |
fix golang env vars (#4975)gh-7112
-rw-r--r-- | lib/compilers/golang.ts | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/lib/compilers/golang.ts b/lib/compilers/golang.ts index 1914b3806..5c0574de1 100644 --- a/lib/compilers/golang.ts +++ b/lib/compilers/golang.ts @@ -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) { @@ -245,10 +256,16 @@ export class GolangCompiler extends BaseCompiler { } override getDefaultExecOptions() { - return { + const options = { ...super.getDefaultExecOptions(), + }; + + options.env = { + ...options.env, ...this.GOENV, }; + + return options; } override getArgumentParser() { |