File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -67,8 +67,13 @@ impl LanguageMethods for Go {
6767 . with_context ( || format ! ( "unable to read `{}`" , path. display( ) ) ) ?;
6868 let package_name = package_name ( & test) ;
6969 let package_dir = compile. bindings_dir . join ( package_name) ;
70- let package_dir = fs:: canonicalize ( & package_dir)
71- . with_context ( || format ! ( "unable to canonicalize `{}`" , package_dir. display( ) ) ) ?;
70+ // Windows gets upset if the path contains mixed separators
71+ let package_dir = PathBuf :: from (
72+ package_dir
73+ . to_str ( )
74+ . ok_or_else ( || anyhow:: anyhow!( "non-utf8 path: `{}`" , package_dir. display( ) ) ) ?
75+ . replace ( [ '\\' , '/' ] , & std:: path:: MAIN_SEPARATOR . to_string ( ) ) ,
76+ ) ;
7277 fs:: create_dir_all ( & package_dir)
7378 . with_context ( || format ! ( "unable to create `{}`" , package_dir. display( ) ) ) ?;
7479 let output = & package_dir. join ( path. file_name ( ) . unwrap ( ) ) ;
You can’t perform that action at this time.
0 commit comments