File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1857,6 +1857,32 @@ fn long_file_names() {
18571857 "012345678901234567890123456789012345678901234567890123456789" ,
18581858 "012345678901234567890123456789012345678901234567890123456789"
18591859 ) ;
1860+ if cfg ! ( windows) {
1861+ // Long paths on Windows require a special registry entry that is
1862+ // disabled by default (even on Windows 10).
1863+ // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
1864+ // If the directory where Cargo runs happens to be more than 80 characters
1865+ // long, then it will bump into this limit.
1866+ //
1867+ // First create a directory to account for various paths Cargo will
1868+ // be using in the target directory (such as "target/package/foo-0.1.0").
1869+ let test_path = paths:: root ( ) . join ( "test-dir-probe-long-path-support" ) ;
1870+ test_path. mkdir_p ( ) ;
1871+ let test_path = test_path. join ( long_name) ;
1872+ if let Err ( e) = File :: create ( & test_path) {
1873+ use std:: io:: Write ;
1874+ writeln ! (
1875+ std:: io:: stderr( ) ,
1876+ "\n Skipping long_file_names test, this OS or filesystem does not \
1877+ appear to support long file paths: {:?}\n {:?}",
1878+ e,
1879+ test_path
1880+ )
1881+ . unwrap ( ) ;
1882+ return ;
1883+ }
1884+ }
1885+
18601886 let p = project ( )
18611887 . file (
18621888 "Cargo.toml" ,
You can’t perform that action at this time.
0 commit comments