Hylo fixes; specify PATH, and fix name (#5625)

-  Add a general extraPaths for compilers and use it to let Hylo find clang++

Co-authored-by: Nick DeMarco <nickpdemarco@gmail.com>
This commit is contained in:
Matt Godbolt
2023-10-18 21:59:42 -05:00
committed by GitHub
parent c115a45ecb
commit 458fa247f8
4 changed files with 13 additions and 1 deletions

View File

@@ -11,5 +11,8 @@ group.hylo.versionFlag=help
group.hylo.licenseLink=https://github.com/hylo-lang/hylo/blob/main/LICENSE
group.hylo.licenseName=Apache License 2.0
group.hylo.licensePreamble=Copyright (c) 2020-2023, Hylo contributors
# hylo needs to be able to find clang++ for linking
group.hylo.extraPath=/opt/compiler-explorer/clang-15.0.0/bin
compiler.hylotrunk.exe=/opt/compiler-explorer/hylo-trunk/hc
compiler.hylotrunk.name=Hylo (trunk)

View File

@@ -431,10 +431,14 @@ export class BaseCompiler implements ICompiler {
}
getDefaultExecOptions(): ExecutionOptions & {env: Record<string, string>} {
const env = this.env.getEnv(this.compiler.needsMulti);
if (this.compiler.extraPath) {
env.PATH = this.compiler.extraPath.join(':') + ':' + env.PATH;
}
return {
timeoutMs: this.env.ceProps('compileTimeoutMs', 7500),
maxErrorOutput: this.env.ceProps('max-error-output', 5000),
env: this.env.getEnv(this.compiler.needsMulti),
env,
wrapper: this.compilerWrapper,
};
}

View File

@@ -316,6 +316,10 @@ export class CompilerFinder {
ldPath: props('ldPath', '')
.split('|')
.map(x => path.normalize(x.replace('${exePath}', exePath))),
extraPath: props('extraPath', '')
.split(path.delimiter)
.filter(p => p !== '')
.map(x => path.normalize(x.replace('${exePath}', exePath))),
envVars: envVars,
notification: props('notification', ''),
isSemVer: isSemVer,

View File

@@ -99,6 +99,7 @@ export type CompilerInfo = {
libpathFlag: string;
libPath: string[];
ldPath: string[];
extraPath: string[];
// [env, setting][]
envVars: [string, string][];
notification: string;