Skip to content

Commit 426ccd5

Browse files
committed
Test only unsetting DYLD_INSERT_BINARIES
1 parent 4e34dbb commit 426ccd5

9 files changed

Lines changed: 30 additions & 21 deletions

lib/environment.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/environment.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/tracer-config.js

Lines changed: 10 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/tracer-config.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/environment.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export enum EnvVar {
2626
*/
2727
DISABLE_DUPLICATE_LOCATION_FIX = "CODEQL_ACTION_DISABLE_DUPLICATE_LOCATION_FIX",
2828

29+
DYLD_INSERT_BINARIES = "DYLD_INSERT_BINARIES",
30+
2931
/**
3032
* Whether the CodeQL Action is using its own deprecated and non-standard way of scanning for
3133
* multiple languages.

src/init-action.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,9 +622,9 @@ async function run() {
622622
JSON.stringify(Object.keys(tracerConfig.env)),
623623
);
624624
// core.exportVariable() sets the environment variables for the current step as well as
625-
// future steps, so we unset the tracer environment variables just for the current process
625+
// future steps, so we unset the tracer environment variables just for the current process
626626
// because we do not need to trace in the rest of the init step.
627-
unsetTracerEnvVarsForCurrentProcess();
627+
unsetTracerEnvVarsForCurrentProcess();
628628
}
629629

630630
// Write diagnostics to the database that we previously stored in memory because the database

src/tracer-config.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as path from "path";
33

44
import { type CodeQL } from "./codeql";
55
import { type Config } from "./config-utils";
6+
import { EnvVar } from "./environment";
67
import { isTracedLanguage } from "./languages";
78
import { Logger } from "./logging";
89
import { ToolsFeature } from "./tools-features";
@@ -129,19 +130,20 @@ export async function getCombinedTracerConfig(
129130
return mainTracerConfig;
130131
}
131132

132-
133133
/**
134134
* Unsets environment variables needed for tracing for the current process.
135135
* This method is called to prevent the environment variables from interfering with
136136
* other system calls in this process.
137137
*/
138138
export function unsetTracerEnvVarsForCurrentProcess(): void {
139-
const tracerEnvVarNames: string[] = JSON.parse(
140-
process.env["CODEQL_ACTION_TRACER_ENV_VAR_NAMES"] ?? "null",
141-
);
142-
if (tracerEnvVarNames !== null) {
143-
for (const envVar of tracerEnvVarNames) {
144-
delete process.env[envVar];
145-
}
146-
}
139+
// const tracerEnvVarNames: string[] = JSON.parse(
140+
// process.env["CODEQL_ACTION_TRACER_ENV_VAR_NAMES"] ?? "null",
141+
// );
142+
// if (tracerEnvVarNames !== null) {
143+
// for (const envVar of tracerEnvVarNames) {
144+
// delete process.env[envVar];
145+
// }
146+
// }
147+
148+
delete process.env[EnvVar.DYLD_INSERT_BINARIES];
147149
}

0 commit comments

Comments
 (0)