@@ -126,14 +126,16 @@ if plugin_read_list_into_result BUILDKITE_PLUGIN_DOCKER_TMPFS ; then
126
126
fi
127
127
128
128
workdir=' '
129
+ workdir_mnt=' '
129
130
130
131
if [[ -n " ${BUILDKITE_PLUGIN_DOCKER_WORKDIR:- } " ]] || [[ " ${BUILDKITE_PLUGIN_DOCKER_MOUNT_CHECKOUT:- on} " =~ ^(true| on| 1)$ ]] ; then
131
132
workdir=" ${BUILDKITE_PLUGIN_DOCKER_WORKDIR:- $workdir_default } "
133
+ workdir_mnt=${workdir} _mnt
132
134
fi
133
135
134
136
# By default, mount $PWD onto $WORKDIR
135
137
if [[ " ${BUILDKITE_PLUGIN_DOCKER_MOUNT_CHECKOUT:- on} " =~ ^(true| on| 1)$ ]] ; then
136
- args+=( " --volume" " ${pwd_default} :${workdir } " )
138
+ args+=( " --volume" " ${pwd_default} :${workdir_mnt } " )
137
139
fi
138
140
139
141
# Parse volumes (and deprecated mounts) and add them to the docker args
@@ -143,10 +145,10 @@ if plugin_read_list_into_result BUILDKITE_PLUGIN_DOCKER_VOLUMES BUILDKITE_PLUGIN
143
145
done
144
146
fi
145
147
146
- # Set workdir if one is provided or if the checkout is mounted
147
- if [[ -n " ${workdir:- } " ]] || [[ " ${BUILDKITE_PLUGIN_DOCKER_MOUNT_CHECKOUT:- on} " =~ ^(true| on| 1)$ ]]; then
148
- args+=(" --workdir" " ${workdir} " )
149
- fi
148
+ # # Set workdir if one is provided or if the checkout is mounted
149
+ # if [[ -n "${workdir:-}" ]] || [[ "${BUILDKITE_PLUGIN_DOCKER_MOUNT_CHECKOUT:-on}" =~ ^(true|on|1)$ ]]; then
150
+ # args+=("--workdir" "${workdir}")
151
+ # fi
150
152
151
153
# Support docker run --user
152
154
if [[ -n " ${BUILDKITE_PLUGIN_DOCKER_USER:- } " ]] && [[ -n " ${BUILDKITE_PLUGIN_DOCKER_PROPAGATE_UID_GID:- } " ]]; then
@@ -339,6 +341,13 @@ if [[ -n "${BUILDKITE_COMMAND}" ]] ; then
339
341
if is_windows ; then
340
342
# The windows CMD shell only supports multiple commands with &&.
341
343
windows_multi_command=${BUILDKITE_COMMAND// $' \n ' / && }
344
+
345
+ # As a quick workaround for a rustc bug [1], we'll copy the project dir,
346
+ # avoiding using the mounted dir directly (which rustc cannot handle).
347
+ # I'm doing this at the buildkite plugin level to avoid polluting the
348
+ # CI pipeline.
349
+ # [1] https://github.com/rust-lang/rust/issues/59117
350
+ windows_multi_command=" xcopy $workdir_mnt $workdir /E /H /I && cd $workdir && $windows_multi_command "
342
351
args+=(" ${windows_multi_command} " )
343
352
display_command+=(" '${windows_multi_command} '" )
344
353
else
@@ -353,6 +362,7 @@ elif [[ ${#command[@]} -gt 0 ]] ; then
353
362
fi
354
363
355
364
echo " --- :docker: Running ${display_command[*]} in ${BUILDKITE_PLUGIN_DOCKER_IMAGE} "
365
+ echo " --- :docker: docker run ${args[*]} "
356
366
357
367
if [[ " ${debug_mode:- off} " =~ (on) ]] ; then
358
368
echo " $ docker run ${args[*]} " >&2
0 commit comments