From 4d3dc0dbeeba38309b6470b1a8914343436783dc Mon Sep 17 00:00:00 2001 From: Davide Baldo Date: Tue, 17 Jan 2023 11:44:08 +0100 Subject: [PATCH] The generator fails to compute the destination path since std won't normalize "file.rs/../directory". This patch only removes the "file.rs" before normalization. --- protocol_codegen/src/generate_messages.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol_codegen/src/generate_messages.rs b/protocol_codegen/src/generate_messages.rs index cf310c5..76a216a 100644 --- a/protocol_codegen/src/generate_messages.rs +++ b/protocol_codegen/src/generate_messages.rs @@ -16,8 +16,8 @@ use tempfile::tempdir; pub fn run() -> Result<(), Error> { let input_tmpdir = tempdir()?.into_path(); - let mut dir = std::fs::canonicalize(std::file!())?; - dir.push("../../../src/messages"); + let mut dir = std::fs::canonicalize(std::file!().rsplit_once("/").unwrap().0)?; + dir.push("../../src/messages"); let output_path = std::fs::canonicalize(dir)?; let output_path = output_path.to_str().unwrap();