Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions usdt-impl/src/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ use quote::{format_ident, quote};
use std::{
collections::BTreeMap,
convert::TryFrom,
env,
io::Write,
process::{Command, Stdio},
};
Expand Down Expand Up @@ -315,7 +316,17 @@ fn contains_needle2<'a>(line: &'a str, needle: &str) -> Option<(&'a str, &'a str
}

fn build_header_from_provider(source: &str) -> Result<String, crate::Error> {
// Ensure that `/usr/sbin` is on the PATH, since that is the typical
// location for `dtrace`, but some build systems (such as Bazel) reset
// the environment variables.
let mut path = env::var_os("PATH").unwrap_or_default();
if !path.is_empty() {
path.push(":");
}
path.push("/usr/sbin");

let mut child = Command::new("dtrace")
.env("PATH", path)
.arg("-h")
.arg("-s")
.arg("/dev/stdin")
Expand Down