Skip to content

Commit 2ecc17d

Browse files
Merge pull request #817 from edoardopirovano/respect-ld-preload
Respect value of `LD_PRELOAD` given by the CLI
2 parents 2803f4a + 9b506fe commit 2ecc17d

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

lib/tracer-config.js

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/tracer-config.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tracer-config.ts

+18-18
Original file line numberDiff line numberDiff line change
@@ -212,25 +212,25 @@ export async function getCombinedTracerConfig(
212212
);
213213
}
214214
mainTracerConfig = concatTracerConfigs(tracedLanguageConfigs, config);
215-
}
216215

217-
// Add a couple more variables
218-
mainTracerConfig.env["ODASA_TRACER_CONFIGURATION"] = mainTracerConfig.spec;
219-
const codeQLDir = path.dirname(codeql.getPath());
220-
if (process.platform === "darwin") {
221-
mainTracerConfig.env["DYLD_INSERT_LIBRARIES"] = path.join(
222-
codeQLDir,
223-
"tools",
224-
"osx64",
225-
"libtrace.dylib"
226-
);
227-
} else if (process.platform !== "win32") {
228-
mainTracerConfig.env["LD_PRELOAD"] = path.join(
229-
codeQLDir,
230-
"tools",
231-
"linux64",
232-
"${LIB}trace.so"
233-
);
216+
// Add a couple more variables
217+
mainTracerConfig.env["ODASA_TRACER_CONFIGURATION"] = mainTracerConfig.spec;
218+
const codeQLDir = path.dirname(codeql.getPath());
219+
if (process.platform === "darwin") {
220+
mainTracerConfig.env["DYLD_INSERT_LIBRARIES"] = path.join(
221+
codeQLDir,
222+
"tools",
223+
"osx64",
224+
"libtrace.dylib"
225+
);
226+
} else if (process.platform !== "win32") {
227+
mainTracerConfig.env["LD_PRELOAD"] = path.join(
228+
codeQLDir,
229+
"tools",
230+
"linux64",
231+
"${LIB}trace.so"
232+
);
233+
}
234234
}
235235

236236
// On macos it's necessary to prefix the build command with the runner executable

0 commit comments

Comments
 (0)