@@ -3325,26 +3325,31 @@ fn build_script_outside_pkg_root() {
33253325 let mut expect_msg = String :: from ( "\
33263326 warning: manifest has no documentation, homepage or repository.
33273327See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
3328- error: the source file of \" custom-build \" target `build- script-custom_build ` doesn't appear to exist.
3328+ error: the source file of `build script` doesn't appear to exist.
33293329This may cause issue during packaging, as modules resolution and resources included via macros are often relative to the path of source files.
33303330Please update the `build` setting in the manifest at `[CWD]/Cargo.toml` and point to a path inside the root of the package.
33313331" ) ;
33323332 // custom_build.rs does not exist
3333- p. cargo ( "package -l" ) . with_stderr ( & expect_msg) . run ( ) ;
3333+ p. cargo ( "package -l" )
3334+ . with_status ( 101 )
3335+ . with_stderr ( & expect_msg)
3336+ . run ( ) ;
33343337
33353338 // custom_build.rs outside the package root
3336- let custom_build_root = p . root ( ) . parent ( ) . unwrap ( ) . join ( "t_custom_build" ) ;
3339+ let custom_build_root = paths :: root ( ) . join ( "t_custom_build" ) ;
33373340 _ = fs:: create_dir ( & custom_build_root) . unwrap ( ) ;
33383341 _ = fs:: write ( & custom_build_root. join ( "custom_build.rs" ) , "fn main() {}" ) ;
33393342 expect_msg = format ! (
33403343 "\
33413344 warning: manifest has no documentation, homepage or repository.
33423345See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
3343- error: the source file of \" custom-build \" target `build- script-custom_build ` doesn't appear to be a path inside of the package.
3346+ error: the source file of `build script` doesn't appear to be a path inside of the package.
33443347It is at `{}/t_custom_build/custom_build.rs`, whereas the root the package is `[CWD]`.
33453348This may cause issue during packaging, as modules resolution and resources included via macros are often relative to the path of source files.
33463349Please update the `build` setting in the manifest at `[CWD]/Cargo.toml` and point to a path inside the root of the package.
3347- " , p. root( ) . parent( ) . unwrap( ) . display( ) ) ;
3348- p. cargo ( "package -l" ) . with_stderr ( & expect_msg) . run ( ) ;
3349- _ = fs:: remove_dir_all ( & custom_build_root) . unwrap ( ) ;
3350+ " , paths:: root( ) . display( ) ) ;
3351+ p. cargo ( "package -l" )
3352+ . with_status ( 101 )
3353+ . with_stderr ( & expect_msg)
3354+ . run ( ) ;
33503355}
0 commit comments