Skip to content

Commit

Permalink
Merge pull request #817 from edoardopirovano/respect-ld-preload
Browse files Browse the repository at this point in the history
Respect value of `LD_PRELOAD` given by the CLI
  • Loading branch information
Edoardo Pirovano authored and GitHub committed Nov 16, 2021
2 parents 2803f4a + 9b506fe commit 2ecc17d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
18 changes: 9 additions & 9 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.

36 changes: 18 additions & 18 deletions src/tracer-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,25 +212,25 @@ export async function getCombinedTracerConfig(
);
}
mainTracerConfig = concatTracerConfigs(tracedLanguageConfigs, config);
}

// Add a couple more variables
mainTracerConfig.env["ODASA_TRACER_CONFIGURATION"] = mainTracerConfig.spec;
const codeQLDir = path.dirname(codeql.getPath());
if (process.platform === "darwin") {
mainTracerConfig.env["DYLD_INSERT_LIBRARIES"] = path.join(
codeQLDir,
"tools",
"osx64",
"libtrace.dylib"
);
} else if (process.platform !== "win32") {
mainTracerConfig.env["LD_PRELOAD"] = path.join(
codeQLDir,
"tools",
"linux64",
"${LIB}trace.so"
);
// Add a couple more variables
mainTracerConfig.env["ODASA_TRACER_CONFIGURATION"] = mainTracerConfig.spec;
const codeQLDir = path.dirname(codeql.getPath());
if (process.platform === "darwin") {
mainTracerConfig.env["DYLD_INSERT_LIBRARIES"] = path.join(
codeQLDir,
"tools",
"osx64",
"libtrace.dylib"
);
} 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 executable
Expand Down

0 comments on commit 2ecc17d

Please sign in to comment.