File tree 1 file changed +26
-0
lines changed
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() {
1857
1857
"012345678901234567890123456789012345678901234567890123456789" ,
1858
1858
"012345678901234567890123456789012345678901234567890123456789"
1859
1859
) ;
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
+
1860
1886
let p = project ( )
1861
1887
. file (
1862
1888
"Cargo.toml" ,
You can’t perform that action at this time.
0 commit comments