File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -2086,3 +2086,43 @@ Caused by:
20862086"# ] ] )
20872087 . run ( ) ;
20882088}
2089+
2090+ #[ cargo_test( ignore_windows = "annoying to create a repro on Windows; see rust-lang/cargo#16214" ) ]
2091+ fn vendor_rename_fallback ( ) {
2092+ let p = project ( )
2093+ . file (
2094+ "Cargo.toml" ,
2095+ r#"
2096+ [package]
2097+ name = "foo"
2098+ version = "0.1.0"
2099+
2100+ [dependencies]
2101+ log = "0.3.5"
2102+ "# ,
2103+ )
2104+ . file ( "src/lib.rs" , "" )
2105+ . build ( ) ;
2106+
2107+ Package :: new ( "log" , "0.3.5" ) . publish ( ) ;
2108+
2109+ // Create vendor/log as a file to force rename failure
2110+ let vendor_dir = p. root ( ) . join ( "vendor" ) ;
2111+ fs:: create_dir_all ( & vendor_dir) . unwrap ( ) ;
2112+ fs:: write ( vendor_dir. join ( "log" ) , "blocking file" ) . unwrap ( ) ;
2113+
2114+ p. cargo ( "vendor --respect-source-config --no-delete" )
2115+ . env ( "CARGO_LOG" , "cargo::ops::vendor=warn" )
2116+ . with_status ( 101 )
2117+ . with_stderr_data ( str![ [ r#"
2118+ ...
2119+ [..]failed to `mv "[..]vendor[..].vendor-staging[..]log-0.3.5" "[..]vendor[..]log"`: [..]
2120+ ...
2121+ [..]StripPrefixError[..]
2122+ ...
2123+ "# ] ] )
2124+ . run ( ) ;
2125+
2126+ // The cp_sources fallback always didn't work because of the StripPrefixError
2127+ assert ! ( !p. root( ) . join( "vendor/log/Cargo.toml" ) . exists( ) ) ;
2128+ }
You can’t perform that action at this time.
0 commit comments