Skip to content

Commit

Permalink
WIP: std::path::absolute to std::fs::canonicalize
Browse files Browse the repository at this point in the history
  • Loading branch information
bkontur committed Sep 2, 2024
1 parent 11ea8d0 commit caf2442
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion substrate/utils/frame/benchmarking-cli/src/pallet/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,8 @@ impl PalletCmd {
state: &'a BenchmarkingState<H>,
) -> Result<FetchedCode<'a, BenchmarkingState<H>, H>> {
if let Some(runtime) = &self.runtime {
let runtime = std::path::absolute(runtime)
// let runtime = std::path::absolute(runtime) - FAIL-CI
let runtime = std::fs::canonicalize(runtime)
.map_err(|e| format!("Could not get absolute path for runtime file: {e}"))?;
log::info!("Loading WASM from {}", runtime.display());

Expand Down
3 changes: 2 additions & 1 deletion substrate/utils/frame/benchmarking-cli/src/pallet/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,8 @@ pub(crate) fn write_results(
benchmarks: results.clone(),
};

let file_path = std::path::absolute(&file_path).map_err(|e| {
// let file_path = std::path::absolute(&file_path).map_err(|e| { - FAIL-CI
let file_path = std::fs::canonicalize(&file_path).map_err(|e| {
format!("Could not get absolute path for: {:?}. Error: {:?}", &file_path, e)
})?;
let mut output_file = fs::File::create(&file_path).map_err(|e| {
Expand Down

0 comments on commit caf2442

Please sign in to comment.