File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,14 @@ else
199
199
args=" $args --env SCCACHE_DIR=/sccache --volume $HOME /.cache/sccache:/sccache"
200
200
fi
201
201
202
+ # By default, container volumes are bound as read-only; therefore doing experimental work
203
+ # or debugging within the container environment (such as fetching submodules and
204
+ # building them) is not possible. Setting READ_ONLY_SRC to 0 enables this capability by
205
+ # binding the volumes in read-write mode.
206
+ if [ " $READ_ONLY_SRC " != " 0" ]; then
207
+ SRC_MOUNT_OPTION=" :ro"
208
+ fi
209
+
202
210
# Run containers as privileged as it should give them access to some more
203
211
# syscalls such as ptrace and whatnot. In the upgrade to LLVM 5.0 it was
204
212
# discovered that the leak sanitizer apparently needs these syscalls nowadays so
@@ -233,7 +241,7 @@ if [ -f /.dockerenv ]; then
233
241
docker cp . checkout:/checkout
234
242
args=" $args --volumes-from checkout"
235
243
else
236
- args=" $args --volume $root_dir :/checkout:ro "
244
+ args=" $args --volume $root_dir :/checkout$SRC_MOUNT_OPTION "
237
245
args=" $args --volume $objdir :/checkout/obj"
238
246
args=" $args --volume $HOME /.cargo:/cargo"
239
247
args=" $args --volume $HOME /rustsrc:$HOME /rustsrc"
You can’t perform that action at this time.
0 commit comments