File tree 2 files changed +29
-0
lines changed
2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 1
1
use std:: io;
2
+ use std:: path:: Path ;
2
3
use std:: process:: ExitStatus ;
3
4
4
5
use super :: shared:: * ;
6
+ use crate :: cross_toml:: CargoConfigBehavior ;
5
7
use crate :: errors:: Result ;
6
8
use crate :: extensions:: CommandExt ;
7
9
use crate :: file:: { PathExt , ToUtf8 } ;
@@ -66,6 +68,25 @@ pub(crate) fn run(
66
68
] ) ;
67
69
}
68
70
71
+ // If we're using all config settings, we need to mount all `.cargo` dirs.
72
+ // We've already mounted the CWD, so start at the parents.
73
+ let mut host_cwd = paths. cwd . parent ( ) ;
74
+ let mut mount_cwd = Path :: new ( & paths. directories . mount_cwd ) . parent ( ) ;
75
+ if let CargoConfigBehavior :: Complete = options. cargo_config_behavior {
76
+ while let ( Some ( host) , Some ( mount) ) = ( host_cwd, mount_cwd) {
77
+ let host_cargo = host. join ( ".cargo" ) ;
78
+ let mount_cargo = mount. join ( ".cargo" ) ;
79
+ if host_cargo. exists ( ) {
80
+ docker. args ( & [
81
+ "-v" ,
82
+ & format ! ( "{}:{}:Z" , host_cargo. to_utf8( ) ?, mount_cargo. as_posix( ) ?) ,
83
+ ] ) ;
84
+ }
85
+ host_cwd = host. parent ( ) ;
86
+ mount_cwd = mount. parent ( ) ;
87
+ }
88
+ }
89
+
69
90
if io:: Stdin :: is_atty ( ) {
70
91
docker. arg ( "-i" ) ;
71
92
if io:: Stdout :: is_atty ( ) && io:: Stderr :: is_atty ( ) {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ use super::engine::Engine;
11
11
use super :: shared:: * ;
12
12
use crate :: cargo:: CargoMetadata ;
13
13
use crate :: config:: bool_from_envvar;
14
+ use crate :: cross_toml:: CargoConfigBehavior ;
14
15
use crate :: errors:: Result ;
15
16
use crate :: extensions:: CommandExt ;
16
17
use crate :: file:: { self , PathExt , ToUtf8 } ;
@@ -1046,6 +1047,13 @@ pub(crate) fn run(
1046
1047
)
1047
1048
. wrap_err ( "when copying project" ) ?;
1048
1049
1050
+ // If we're using all config settings, write the combined
1051
+ // config file to a fixed location (to avoid it becoming stale).
1052
+ if let CargoConfigBehavior :: Complete = options. cargo_config_behavior {
1053
+ // TODO(ahuszagh) Need to write the file out.
1054
+ todo ! ( ) ;
1055
+ }
1056
+
1049
1057
let mut copied = vec ! [
1050
1058
( & dirs. xargo, mount_prefix_path. join( "xargo" ) ) ,
1051
1059
( & dirs. cargo, mount_prefix_path. join( "cargo" ) ) ,
You can’t perform that action at this time.
0 commit comments