aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpartouf <partouf@gmail.com>2023-04-19 17:46:21 +0200
committerpartouf <partouf@gmail.com>2023-04-19 17:46:21 +0200
commit958c05f4ac0413edd71632354bf76599a8c74aa0 (patch)
tree0b91797df98bd2b348ca6ad59be18bd0c413376c
parenta0e42db40092ee3526c66d5898ae46dc04e48560 (diff)
downloadcompiler-explorer-gh-7107.tar.gz
compiler-explorer-gh-7107.zip
fix golang env varsgh-7107
-rw-r--r--lib/compilers/golang.ts25
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() {