File tree 2 files changed +10
-8
lines changed
2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -1232,8 +1232,7 @@ impl<'a> Builder<'a> {
1232
1232
}
1233
1233
1234
1234
// Try to use a sysroot-relative bindir, in case it was configured absolutely.
1235
- let bindir = self . config . bindir_relative ( ) . unwrap_or ( & self . config . bindir ) ;
1236
- cargo. env ( "RUSTC_INSTALL_BINDIR" , bindir) ;
1235
+ cargo. env ( "RUSTC_INSTALL_BINDIR" , self . config . bindir_relative ( ) ) ;
1237
1236
1238
1237
self . ci_env . force_coloring_in_ci ( & mut cargo) ;
1239
1238
Original file line number Diff line number Diff line change @@ -647,15 +647,18 @@ impl Config {
647
647
config
648
648
}
649
649
650
- /// Try to find the relative path of `bindir`.
651
- pub fn bindir_relative ( & self ) -> Option < & Path > {
650
+ /// Try to find the relative path of `bindir`, otherwise return it in full .
651
+ pub fn bindir_relative ( & self ) -> & Path {
652
652
let bindir = & self . bindir ;
653
- if bindir. is_relative ( ) {
654
- Some ( bindir)
655
- } else {
653
+ if bindir. is_absolute ( ) {
656
654
// Try to make it relative to the prefix.
657
- bindir. strip_prefix ( self . prefix . as_ref ( ) ?) . ok ( )
655
+ if let Some ( prefix) = & self . prefix {
656
+ if let Ok ( stripped) = bindir. strip_prefix ( prefix) {
657
+ return stripped;
658
+ }
659
+ }
658
660
}
661
+ bindir
659
662
}
660
663
661
664
/// Try to find the relative path of `libdir`.
You can’t perform that action at this time.
0 commit comments