File tree 2 files changed +11
-19
lines changed
2 files changed +11
-19
lines changed Original file line number Diff line number Diff line change 1
- use dirs:: { CARGO_HOME , RUSTUP_HOME } ;
2
1
use errors:: * ;
3
2
use run;
4
3
use std:: env;
@@ -55,23 +54,7 @@ pub struct ContainerConfig<'a> {
55
54
}
56
55
57
56
58
- pub fn run ( source_path : & Path , target_path : & Path , args : & [ & str ] ) -> Result < ( ) > {
59
-
60
- info ! ( "running: {}" , args. join( " " ) ) ;
61
-
62
- let env = RustEnv {
63
- args : args,
64
- work_dir : ( source_path. into ( ) , Perm :: ReadOnly ) ,
65
- cargo_home : ( Path :: new ( CARGO_HOME ) . into ( ) , Perm :: ReadOnly ) ,
66
- rustup_home : ( Path :: new ( RUSTUP_HOME ) . into ( ) , Perm :: ReadOnly ) ,
67
- // This is configured as CARGO_TARGET_DIR by the docker container itself
68
- target_dir : ( target_path. into ( ) , Perm :: ReadWrite ) ,
69
- } ;
70
-
71
- run_container ( rust_container ( env) )
72
- }
73
-
74
- pub fn run_container ( config : ContainerConfig ) -> Result < ( ) > {
57
+ pub fn run ( config : ContainerConfig ) -> Result < ( ) > {
75
58
let c = Container :: create_container ( config) ?;
76
59
defer ! { {
77
60
if let Err ( e) = c. delete( ) {
Original file line number Diff line number Diff line change @@ -216,6 +216,15 @@ impl Toolchain {
216
216
let mut full_args = vec ! [ "cargo" , & * toolchain_arg] ;
217
217
full_args. extend_from_slice ( args) ;
218
218
219
- docker:: run ( source_dir, & ex_target_dir, & full_args)
219
+ info ! ( "running: {}" , full_args. join( " " ) ) ;
220
+ let rust_env = docker:: RustEnv {
221
+ args : & full_args,
222
+ work_dir : ( source_dir. into ( ) , docker:: Perm :: ReadOnly ) ,
223
+ cargo_home : ( Path :: new ( CARGO_HOME ) . into ( ) , docker:: Perm :: ReadOnly ) ,
224
+ rustup_home : ( Path :: new ( RUSTUP_HOME ) . into ( ) , docker:: Perm :: ReadOnly ) ,
225
+ // This is configured as CARGO_TARGET_DIR by the docker container itself
226
+ target_dir : ( ex_target_dir, docker:: Perm :: ReadWrite ) ,
227
+ } ;
228
+ docker:: run ( docker:: rust_container ( rust_env) )
220
229
}
221
230
}
You can’t perform that action at this time.
0 commit comments