From caf2442d6bb69c12e7235fe14b6cba2c211b990b Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Fri, 16 Aug 2024 01:00:57 +0200 Subject: [PATCH] WIP: `std::path::absolute` to `std::fs::canonicalize` --- substrate/utils/frame/benchmarking-cli/src/pallet/command.rs | 3 ++- substrate/utils/frame/benchmarking-cli/src/pallet/writer.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/substrate/utils/frame/benchmarking-cli/src/pallet/command.rs b/substrate/utils/frame/benchmarking-cli/src/pallet/command.rs index 3f716f6bc5745..b273da8ba184e 100644 --- a/substrate/utils/frame/benchmarking-cli/src/pallet/command.rs +++ b/substrate/utils/frame/benchmarking-cli/src/pallet/command.rs @@ -750,7 +750,8 @@ impl PalletCmd { state: &'a BenchmarkingState, ) -> Result, 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()); diff --git a/substrate/utils/frame/benchmarking-cli/src/pallet/writer.rs b/substrate/utils/frame/benchmarking-cli/src/pallet/writer.rs index d4742361e9e2d..fb972ff9e85f2 100644 --- a/substrate/utils/frame/benchmarking-cli/src/pallet/writer.rs +++ b/substrate/utils/frame/benchmarking-cli/src/pallet/writer.rs @@ -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| {