File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
crates/guest-rust/macro/src Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,14 @@ fn parse_source(
155155 let mut files = Vec :: new ( ) ;
156156 let root = PathBuf :: from ( std:: env:: var ( "CARGO_MANIFEST_DIR" ) . unwrap ( ) ) ;
157157 let mut parse = |path : & Path | -> anyhow:: Result < _ > {
158- let ( pkg, sources) = resolve. push_path ( path) ?;
158+ // Try to normalize the path to make the error message more understandable when
159+ // the path is not correct. Fallback to the original path if normalization fails
160+ // (probably return an error somewhere else).
161+ let normalized_path = match std:: fs:: canonicalize ( path) {
162+ Ok ( p) => p,
163+ Err ( _) => path. to_path_buf ( ) ,
164+ } ;
165+ let ( pkg, sources) = resolve. push_path ( normalized_path) ?;
159166 files. extend ( sources) ;
160167 Ok ( pkg)
161168 } ;
You can’t perform that action at this time.
0 commit comments