Run autobuild script via direct tracing when feature enabled

This commit is contained in:
Henry Mercer 2024-04-11 21:05:55 +01:00
parent 8f057a3d8e
commit cbe29f55df
15 changed files with 68 additions and 25 deletions

17
lib/codeql.js generated
View file

@ -295,11 +295,22 @@ async function getCodeQLForCmd(cmd, checkVersion) {
...getExtraOptionsFromEnv(["database", "init"]),
], { stdin: externalRepositoryToken });
},
async runAutobuild(language, enableDebugLogging) {
const autobuildCmd = path.join(await this.resolveExtractor(language), "tools", process.platform === "win32" ? "autobuild.cmd" : "autobuild.sh");
async runAutobuild(config, language, features) {
applyAutobuildAzurePipelinesTimeoutFix();
if (await features.getValue(feature_flags_1.Feature.AutobuildDirectTracingEnabled, this)) {
await runTool(cmd, [
"database",
"trace-command",
...(await getTrapCachingExtractorConfigArgsForLang(config, language)),
...getExtractionVerbosityArguments(config.debugMode),
...getExtraOptionsFromEnv(["database", "trace-command"]),
util.getCodeQLDatabasePath(config, language),
]);
return;
}
const autobuildCmd = path.join(await this.resolveExtractor(language), "tools", process.platform === "win32" ? "autobuild.cmd" : "autobuild.sh");
// Bump the verbosity of the autobuild command if we're in debug mode
if (enableDebugLogging) {
if (config.debugMode) {
process.env[environment_1.EnvVar.CLI_VERBOSITY] =
process.env[environment_1.EnvVar.CLI_VERBOSITY] || EXTRACTION_DEBUG_MODE_VERBOSITY;
}