Skip to content

Commit

Permalink
Test only unsetting DYLD_INSERT_BINARIES
Browse files Browse the repository at this point in the history
  • Loading branch information
angelapwen committed Aug 14, 2024
1 parent 4e34dbb commit 360bbc2
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 16 deletions.
1 change: 1 addition & 0 deletions lib/environment.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/environment.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions lib/tracer-config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/tracer-config.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export enum EnvVar {
*/
DISABLE_DUPLICATE_LOCATION_FIX = "CODEQL_ACTION_DISABLE_DUPLICATE_LOCATION_FIX",

DYLD_INSERT_BINARIES = "DYLD_INSERT_BINARIES",

/**
* Whether the CodeQL Action is using its own deprecated and non-standard way of scanning for
* multiple languages.
Expand Down
19 changes: 11 additions & 8 deletions src/tracer-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { isTracedLanguage } from "./languages";
import { Logger } from "./logging";
import { ToolsFeature } from "./tools-features";
import { BuildMode } from "./util";
import { EnvVar } from "./environment";

export type TracerConfig = {
env: { [key: string]: string };
Expand Down Expand Up @@ -136,12 +137,14 @@ export async function getCombinedTracerConfig(
* other system calls in this process.
*/
export function unsetTracerEnvVarsForCurrentProcess(): void {
const tracerEnvVarNames: string[] = JSON.parse(
process.env["CODEQL_ACTION_TRACER_ENV_VAR_NAMES"] ?? "null",
);
if (tracerEnvVarNames !== null) {
for (const envVar of tracerEnvVarNames) {
delete process.env[envVar];
}
}
// const tracerEnvVarNames: string[] = JSON.parse(
// process.env["CODEQL_ACTION_TRACER_ENV_VAR_NAMES"] ?? "null",
// );
// if (tracerEnvVarNames !== null) {
// for (const envVar of tracerEnvVarNames) {
// delete process.env[envVar];
// }
// }

delete process.env[EnvVar.DYLD_INSERT_BINARIES];
}

0 comments on commit 360bbc2

Please sign in to comment.