move CODEQL_RUNNER population to tracer-config.ts

This commit is contained in:
Robert 2021-01-12 10:49:08 +00:00
parent cd2eafc8e3
commit c796788c33
6 changed files with 18 additions and 18 deletions

5
lib/runner.js generated
View file

@ -126,11 +126,6 @@ program
if (process.platform === "win32") {
await init_1.injectWindowsTracer(parseTraceProcessName(), parseTraceProcessLevel(), config, codeql, tracerConfig);
}
// On macos it's necessary to prefix the build command with the runner exectuable
// on order to trace when System Integrity Protection is enabled.
// The exectuable also exists and works for other platforms so we output this env
// var with a path to the runner regardless so it's always available.
tracerConfig.env["CODEQL_RUNNER"] = path.join(tracerConfig.env["CODEQL_DIST"], "tools", tracerConfig.env["CODEQL_PLATFORM"], "runner");
// Always output a json file of the env that can be consumed programmatically
const jsonEnvFile = path.join(config.tempDir, codeqlEnvJsonFilename);
fs.writeFileSync(jsonEnvFile, JSON.stringify(tracerConfig.env));

File diff suppressed because one or more lines are too long

5
lib/tracer-config.js generated
View file

@ -141,6 +141,11 @@ async function getCombinedTracerConfig(config, codeql) {
else if (process.platform !== "win32") {
mainTracerConfig.env["LD_PRELOAD"] = path.join(codeQLDir, "tools", "linux64", "${LIB}trace.so");
}
// On macos it's necessary to prefix the build command with the runner exectuable
// on order to trace when System Integrity Protection is enabled.
// The exectuable also exists and works for other platforms so we output this env
// var with a path to the runner regardless so it's always available.
mainTracerConfig.env["CODEQL_RUNNER"] = path.join(mainTracerConfig.env["CODEQL_DIST"], "tools", mainTracerConfig.env["CODEQL_PLATFORM"], "runner");
return mainTracerConfig;
}
exports.getCombinedTracerConfig = getCombinedTracerConfig;

File diff suppressed because one or more lines are too long

View file

@ -203,17 +203,6 @@ program
);
}
// On macos it's necessary to prefix the build command with the runner exectuable
// on order to trace when System Integrity Protection is enabled.
// The exectuable also exists and works for other platforms so we output this env
// var with a path to the runner regardless so it's always available.
tracerConfig.env["CODEQL_RUNNER"] = path.join(
tracerConfig.env["CODEQL_DIST"],
"tools",
tracerConfig.env["CODEQL_PLATFORM"],
"runner"
);
// Always output a json file of the env that can be consumed programmatically
const jsonEnvFile = path.join(config.tempDir, codeqlEnvJsonFilename);
fs.writeFileSync(jsonEnvFile, JSON.stringify(tracerConfig.env));

View file

@ -185,5 +185,16 @@ export async function getCombinedTracerConfig(
);
}
// On macos it's necessary to prefix the build command with the runner exectuable
// on order to trace when System Integrity Protection is enabled.
// The exectuable also exists and works for other platforms so we output this env
// var with a path to the runner regardless so it's always available.
mainTracerConfig.env["CODEQL_RUNNER"] = path.join(
mainTracerConfig.env["CODEQL_DIST"],
"tools",
mainTracerConfig.env["CODEQL_PLATFORM"],
"runner"
);
return mainTracerConfig;
}