From 17a9dbfb6203af0b51661ce8feaded936909fa27 Mon Sep 17 00:00:00 2001 From: Cornelius Riemenschneider Date: Mon, 8 Nov 2021 11:26:48 +0100 Subject: [PATCH] Add port of the existing compiler-tracing.spec files to the new Lua tracing infrastructure. --- Makefile | 2 +- codeql-tools/tracing-config.lua | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 codeql-tools/tracing-config.lua diff --git a/Makefile b/Makefile index cae912bfba0..d3f39fc5519 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ CODEQL_PLATFORM = osx64 endif endif -CODEQL_TOOLS = $(addprefix codeql-tools/,autobuild.cmd autobuild.sh pre-finalize.cmd pre-finalize.sh index.cmd index.sh linux64 osx64 win64) +CODEQL_TOOLS = $(addprefix codeql-tools/,autobuild.cmd autobuild.sh pre-finalize.cmd pre-finalize.sh index.cmd index.sh linux64 osx64 win64 tracing-config.lua) EXTRACTOR_PACK_OUT = build/codeql-extractor-go diff --git a/codeql-tools/tracing-config.lua b/codeql-tools/tracing-config.lua new file mode 100644 index 00000000000..05b864218ab --- /dev/null +++ b/codeql-tools/tracing-config.lua @@ -0,0 +1,20 @@ +function RegisterExtractorPack() + local goExtractor = GetPlatformToolsDirectory() .. 'go-extractor' + if OperatingSystem == 'windows' then + local goExtractor = GetPlatformToolsDirectory() .. 'go-extractor.exe' + end + local matchers = { + CreatePatternMatcher('go', + {'^go-autobuilder$', '^go-autobuilder%.exe$'}, + MatchCompilerName, nil, {trace = false}), + + CreatePatternMatcher('go', {'^go$', '^go%.exe$'}, MatchCompilerName, + goExtractor, {prepend = {'--mimic', '${compiler}'}}) + } + + RegisterLanguage('go', matchers) +end + +-- Return a list of minimum supported versions of the configuration file format +-- return one entry per supported major version. +function GetCompatibleVersions() return {'1.0.0'} end