@@ -168,7 +168,11 @@ fn create_volume_dir(
168
168
// make our parent directory if needed
169
169
subcommand_or_exit ( engine, "exec" ) ?
170
170
. arg ( container)
171
- . args ( & [ "sh" , "-c" , & format ! ( "mkdir -p '{}'" , dir. as_posix( ) ?) ] )
171
+ . args ( & [
172
+ "sh" ,
173
+ "-c" ,
174
+ & format ! ( "mkdir -p '{}'" , dir. as_posix_absolute( ) ?) ,
175
+ ] )
172
176
. run_and_get_status ( msg_info, false )
173
177
}
174
178
@@ -183,7 +187,7 @@ fn copy_volume_files(
183
187
subcommand_or_exit ( engine, "cp" ) ?
184
188
. arg ( "-a" )
185
189
. arg ( src. to_utf8 ( ) ?)
186
- . arg ( format ! ( "{container}:{}" , dst. as_posix ( ) ?) )
190
+ . arg ( format ! ( "{container}:{}" , dst. as_posix_absolute ( ) ?) )
187
191
. run_and_get_status ( msg_info, false )
188
192
}
189
193
@@ -214,7 +218,11 @@ fn container_path_exists(
214
218
) -> Result < bool > {
215
219
Ok ( subcommand_or_exit ( engine, "exec" ) ?
216
220
. arg ( container)
217
- . args ( & [ "bash" , "-c" , & format ! ( "[[ -d '{}' ]]" , path. as_posix( ) ?) ] )
221
+ . args ( & [
222
+ "bash" ,
223
+ "-c" ,
224
+ & format ! ( "[[ -d '{}' ]]" , path. as_posix_absolute( ) ?) ,
225
+ ] )
218
226
. run_and_get_status ( msg_info, true ) ?
219
227
. success ( ) )
220
228
}
@@ -567,7 +575,7 @@ fn read_dir_fingerprint(
567
575
let modified = file. metadata ( ) ?. modified ( ) ?;
568
576
let millis = modified. duration_since ( epoch) ?. as_millis ( ) as u64 ;
569
577
let rounded = epoch + time:: Duration :: from_millis ( millis) ;
570
- let relpath = file. path ( ) . strip_prefix ( home) ?. as_posix ( ) ?;
578
+ let relpath = file. path ( ) . strip_prefix ( home) ?. as_posix_relative ( ) ?;
571
579
map. insert ( relpath, rounded) ;
572
580
}
573
581
}
@@ -647,7 +655,7 @@ rm \"{PATH}\"
647
655
// SAFETY: safe, single-threaded execution.
648
656
let mut tempfile = unsafe { temp:: TempFile :: new ( ) ? } ;
649
657
for file in files {
650
- writeln ! ( tempfile. file( ) , "{}" , dst. join( file) . as_posix ( ) ?) ?;
658
+ writeln ! ( tempfile. file( ) , "{}" , dst. join( file) . as_posix_relative ( ) ?) ?;
651
659
}
652
660
653
661
// need to avoid having hundreds of files on the command, so
@@ -845,11 +853,6 @@ pub fn unique_container_identifier(
845
853
Ok ( format ! ( "{toolchain_id}-{triple}-{name}-{project_hash}" ) )
846
854
}
847
855
848
- fn mount_path ( val : & Path ) -> Result < String > {
849
- let host_path = file:: canonicalize ( val) ?;
850
- canonicalize_mount_path ( & host_path)
851
- }
852
-
853
856
pub ( crate ) fn run (
854
857
options : DockerOptions ,
855
858
paths : DockerPaths ,
@@ -921,7 +924,7 @@ pub(crate) fn run(
921
924
& mut docker,
922
925
& options,
923
926
& paths,
924
- |_, val| mount_path ( val ) ,
927
+ |_, _ , _| Ok ( ( ) ) ,
925
928
|( src, dst) | volumes. push ( ( src, dst) ) ,
926
929
)
927
930
. wrap_err ( "could not determine mount points" ) ?;
@@ -1100,7 +1103,7 @@ pub(crate) fn run(
1100
1103
let mut final_args = vec ! [ ] ;
1101
1104
let mut iter = args. iter ( ) . cloned ( ) ;
1102
1105
let mut has_target_dir = false ;
1103
- let target_dir_string = target_dir. as_posix ( ) ?;
1106
+ let target_dir_string = target_dir. as_posix_absolute ( ) ?;
1104
1107
while let Some ( arg) = iter. next ( ) {
1105
1108
if arg == "--target-dir" {
1106
1109
has_target_dir = true ;
@@ -1156,7 +1159,11 @@ symlink_recurse \"${{prefix}}\"
1156
1159
"
1157
1160
) ) ;
1158
1161
for ( src, dst) in to_symlink {
1159
- symlink. push ( format ! ( "ln -s \" {}\" \" {}\" " , src. as_posix( ) ?, dst) ) ;
1162
+ symlink. push ( format ! (
1163
+ "ln -s \" {}\" \" {}\" " ,
1164
+ src. as_posix_absolute( ) ?,
1165
+ dst
1166
+ ) ) ;
1160
1167
}
1161
1168
subcommand_or_exit ( engine, "exec" ) ?
1162
1169
. arg ( & container)
@@ -1185,7 +1192,7 @@ symlink_recurse \"${{prefix}}\"
1185
1192
if !skip_artifacts && container_path_exists ( engine, & container, & target_dir, msg_info) ? {
1186
1193
subcommand_or_exit ( engine, "cp" ) ?
1187
1194
. arg ( "-a" )
1188
- . arg ( & format ! ( "{container}:{}" , target_dir. as_posix ( ) ?) )
1195
+ . arg ( & format ! ( "{container}:{}" , target_dir. as_posix_absolute ( ) ?) )
1189
1196
. arg (
1190
1197
& dirs
1191
1198
. target
0 commit comments