Bump verbosity when running autobuild script directly in debug mode

This commit is contained in:
Henry Mercer 2024-03-13 17:51:08 +00:00
parent 362c407426
commit 649f3e87e1
9 changed files with 30 additions and 8 deletions

View file

@ -82,7 +82,7 @@ export interface CodeQL {
/**
* Runs the autobuilder for the given language.
*/
runAutobuild(language: Language): Promise<void>;
runAutobuild(language: Language, enableDebugLogging: boolean): Promise<void>;
/**
* Extract code for a scanned language using 'codeql database trace-command'
* and running the language extractor.
@ -637,7 +637,7 @@ export async function getCodeQLForCmd(
throw e;
}
},
async runAutobuild(language: Language) {
async runAutobuild(language: Language, enableDebugLogging: boolean) {
const autobuildCmd = path.join(
await this.resolveExtractor(language),
"tools",
@ -656,6 +656,12 @@ export async function getCodeQLForCmd(
"-Dmaven.wagon.http.pool=false",
].join(" ");
// Bump the verbosity of the autobuild command if we're in debug mode
if (enableDebugLogging) {
process.env[EnvVar.CLI_VERBOSITY] =
process.env[EnvVar.CLI_VERBOSITY] || EXTRACTION_DEBUG_MODE_VERBOSITY;
}
// On macOS, System Integrity Protection (SIP) typically interferes with
// CodeQL build tracing of protected binaries.
// The usual workaround is to prefix `$CODEQL_RUNNER` to build commands: