Skip to content
Open
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
5 changes: 5 additions & 0 deletions asic/src/tofino_common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use std::collections::HashMap;
use std::ffi::OsStr;
use std::fs;
use std::path::PathBuf;

use serde::Deserialize;
Expand Down Expand Up @@ -240,6 +241,10 @@ fn infer_p4_dir() -> AsicResult<String> {
let mut exe_path = std::env::current_exe().map_err(|e| {
AsicError::P4Missing(format!("looking up dpd path: {e:?}"))
})?;
// Canonicalize the path in case we're using a symlinked exe.
exe_path = fs::canonicalize(exe_path).map_err(|e| {
AsicError::P4Missing(format!("canonicalizing dpd path: {e:?}"))
})?;

// Pop off the trailing "dpd":
exe_path = expect_name(exe_path, "dpd")?;
Expand Down