diff --git a/codeql-tools/tracing-config.lua b/codeql-tools/tracing-config.lua index ef9dd68bd71..8554d545ce0 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