Skip to content

Commit e24566e

Browse files
committed
C#/C++: Use CODEQL_EXTRACTOR_CPP_ROOT in autobuild
Left this out earlier because I thought it needed to point to the C# extractor root even in C++ mode, but it looks like it isn't yet used in C++ mode.
1 parent c37c282 commit e24566e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

csharp/autobuilder/Semmle.Autobuild.Tests/BuildScripts.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ Autobuilder CreateAutoBuilder(string lgtmLanguage, bool isWindows,
344344
Actions.GetEnvironmentVariable[$"CODEQL_AUTOBUILDER_{codeqlUpperLanguage}_NO_INDEXING"] = "false";
345345
Actions.GetEnvironmentVariable[$"CODEQL_EXTRACTOR_{codeqlUpperLanguage}_TRAP_DIR"] = "";
346346
Actions.GetEnvironmentVariable[$"CODEQL_EXTRACTOR_{codeqlUpperLanguage}_SOURCE_ARCHIVE_DIR"] = "";
347-
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_ROOT"] = @"C:\codeql\csharp";
347+
Actions.GetEnvironmentVariable[$"CODEQL_EXTRACTOR_{codeqlUpperLanguage}_ROOT"] = $@"C:\codeql\{lgtmLanguage}";
348348
Actions.GetEnvironmentVariable["CODEQL_JAVA_HOME"] = @"C:\codeql\tools\java";
349349
Actions.GetEnvironmentVariable["SEMMLE_DIST"] = @"C:\odasa";
350350
Actions.GetEnvironmentVariable["SEMMLE_JAVA_HOME"] = @"C:\odasa\tools\java";

csharp/autobuilder/Semmle.Autobuild/Autobuilder.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public Autobuilder(IBuildActions actions, AutobuildOptions options)
184184
return ret ?? new List<IProjectOrSolution>();
185185
});
186186

187-
CodeQLExtractorCSharpRoot = Actions.GetEnvironmentVariable("CODEQL_EXTRACTOR_CSHARP_ROOT");
187+
CodeQLExtractorLangRoot = Actions.GetEnvironmentVariable($"CODEQL_EXTRACTOR_{this.Options.Language.UpperCaseName}_ROOT");
188188
SemmleDist = Actions.GetEnvironmentVariable("SEMMLE_DIST");
189189
SemmlePlatformTools = Actions.GetEnvironmentVariable("SEMMLE_PLATFORM_TOOLS");
190190

@@ -194,9 +194,9 @@ public Autobuilder(IBuildActions actions, AutobuildOptions options)
194194
throw new InvalidEnvironmentException("The environment variable CODEQL_JAVA_HOME or SEMMLE_JAVA_HOME has not been set.");
195195

196196
Distribution =
197-
CodeQLExtractorCSharpRoot ??
197+
CodeQLExtractorLangRoot ??
198198
SemmleDist ??
199-
throw new InvalidEnvironmentException("The environment variable CODEQL_EXTRACTOR_CSHARP_ROOT or SEMMLE_DIST has not been set.");
199+
throw new InvalidEnvironmentException($"The environment variable CODEQL_EXTRACTOR_{this.Options.Language.UpperCaseName}_ROOT or SEMMLE_DIST has not been set.");
200200

201201
TrapDir =
202202
Actions.GetEnvironmentVariable($"CODEQL_EXTRACTOR_{this.Options.Language.UpperCaseName}_TRAP_DIR") ??
@@ -397,9 +397,9 @@ BuildScript AutobuildFailure() =>
397397
});
398398

399399
/// <summary>
400-
/// Value of CODEQL_EXTRACTOR_CSHARP_ROOT environment variable.
400+
/// Value of CODEQL_EXTRACTOR_<LANG>_ROOT environment variable.
401401
/// </summary>
402-
private string? CodeQLExtractorCSharpRoot { get; }
402+
private string? CodeQLExtractorLangRoot { get; }
403403

404404
/// <summary>
405405
/// Value of SEMMLE_DIST environment variable.

0 commit comments

Comments
 (0)