The error occurs because the path of modified file is /Volumes/Macintosh HD/Users/XXX/Downloads/hello_cargo/src/main.rs but the the src_dir (see here) is something like /XXX/Downloads/hello_cargo/src/, so they don't have the same prefix. But actually, /Volumes/Macintosh HD is just a symlink to /.
Possible solution: canonicalize the path of the modified file first, and then compare the path with the src_dir. Maybe someone can fix it ? (I'm not familiar with the codebase, otherwise I can make a pull request)
I encountered this error when implement a rust extension:
The error comes from here.
The error occurs because the path of modified file is
/Volumes/Macintosh HD/Users/XXX/Downloads/hello_cargo/src/main.rs
but the thesrc_dir
(see here) is something like/XXX/Downloads/hello_cargo/src/
, so they don't have the same prefix. But actually,/Volumes/Macintosh HD
is just a symlink to/
.Possible solution:
canonicalize
the path of the modified file first, and then compare the path with thesrc_dir
. Maybe someone can fix it ? (I'm not familiar with the codebase, otherwise I can make a pull request)