File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -663,7 +663,15 @@ pub fn install(
663663 lockfile_path : Option < & Path > ,
664664) -> CargoResult < ( ) > {
665665 let root = resolve_root ( root, gctx) ?;
666+ // Normalize to absolute path for consistency throughout.
667+ // See: https://github.com/rust-lang/cargo/issues/16023
666668 let dst = root. join ( "bin" ) . into_path_unlocked ( ) ;
669+ let cwd = gctx. cwd ( ) ;
670+ let dst = if dst. is_absolute ( ) {
671+ paths:: normalize_path ( dst. as_path ( ) )
672+ } else {
673+ paths:: normalize_path ( & cwd. join ( & dst) )
674+ } ;
667675 let map = SourceConfigMap :: new ( gctx) ?;
668676
669677 let current_rust_version = if opts. honor_rust_version . unwrap_or ( true ) {
Original file line number Diff line number Diff line change @@ -527,7 +527,7 @@ fn relative_install_location_without_trailing_slash() {
527527[FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s
528528[INSTALLING] [ROOT]/foo/t1/bin/foo[EXE]
529529[INSTALLED] package `foo v0.0.1 ([ROOT]/foo)` (executable `foo[EXE]`)
530- [WARNING] be sure to add `t1/bin` to your PATH to be able to run the installed binaries
530+ [WARNING] be sure to add `[ROOT]/foo/ t1/bin` to your PATH to be able to run the installed binaries
531531
532532"# ] ] )
533533 . run ( ) ;
@@ -607,7 +607,6 @@ fn relative_install_location_with_path_set() {
607607[FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s
608608[INSTALLING] [ROOT]/foo/t1/bin/foo[EXE]
609609[INSTALLED] package `foo v0.0.1 ([ROOT]/foo)` (executable `foo[EXE]`)
610- [WARNING] be sure to add `t1/bin` to your PATH to be able to run the installed binaries
611610
612611"# ] ] )
613612 . run ( ) ;
You can’t perform that action at this time.
0 commit comments