From 3b4d04dcc47b6b558d448283631722d5c534fe15 Mon Sep 17 00:00:00 2001 From: Cornelius Riemenschneider Date: Tue, 17 May 2022 09:25:46 +0000 Subject: [PATCH] Update Lua tracing config. --- codeql-tools/tracing-config.lua | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/codeql-tools/tracing-config.lua b/codeql-tools/tracing-config.lua index ef9dd68b..8554d545 100644 --- a/codeql-tools/tracing-config.lua +++ b/codeql-tools/tracing-config.lua @@ -1,14 +1,27 @@ function RegisterExtractorPack() local goExtractor = GetPlatformToolsDirectory() .. 'go-extractor' - if OperatingSystem == 'windows' then - goExtractor = GetPlatformToolsDirectory() .. 'go-extractor.exe' - end - return { - CreatePatternMatcher({'^go-autobuilder$', '^go-autobuilder%.exe$'}, - MatchCompilerName, nil, {trace = false}), - CreatePatternMatcher({'^go$', '^go%.exe$'}, MatchCompilerName, - goExtractor, {prepend = {'--mimic', '${compiler}'}}) + local patterns = { + CreatePatternMatcher({'^go-autobuilder$'}, MatchCompilerName, nil, + {trace = false}), + CreatePatternMatcher({'^go$'}, MatchCompilerName, goExtractor, { + prepend = {'--mimic', '${compiler}'}, + order = ORDER_BEFORE + }) + } + if OperatingSystem == 'windows' then + goExtractor = goExtractor .. 'go-extractor.exe' + patterns = { + CreatePatternMatcher({'^go-autobuilder%.exe$'}, MatchCompilerName, + nil, {trace = false}), + CreatePatternMatcher({'^go%.exe$'}, MatchCompilerName, goExtractor, + { + prepend = {'--mimic', '"${compiler}"'}, + order = ORDER_BEFORE + }) + } + end + return patterns end -- Return a list of minimum supported versions of the configuration file format