File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,14 @@ else
199199 args=" $args --env SCCACHE_DIR=/sccache --volume $HOME /.cache/sccache:/sccache"
200200fi
201201
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+
202210# Run containers as privileged as it should give them access to some more
203211# syscalls such as ptrace and whatnot. In the upgrade to LLVM 5.0 it was
204212# discovered that the leak sanitizer apparently needs these syscalls nowadays so
@@ -233,7 +241,7 @@ if [ -f /.dockerenv ]; then
233241 docker cp . checkout:/checkout
234242 args=" $args --volumes-from checkout"
235243else
236- args=" $args --volume $root_dir :/checkout:ro "
244+ args=" $args --volume $root_dir :/checkout$SRC_MOUNT_OPTION "
237245 args=" $args --volume $objdir :/checkout/obj"
238246 args=" $args --volume $HOME /.cargo:/cargo"
239247 args=" $args --volume $HOME /rustsrc:$HOME /rustsrc"
You can’t perform that action at this time.
0 commit comments