Skip to content
Commit a3f1a8ef authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

_sandboxbwrap.py: Force cleanup when in interactive mode

When running a sandbox in interactive mode (implies `bst shell` was launched
or an interactive shell for debugging), dont bail out when cleaning up
directories which are not empty.

We treat this as a bug, if any of the base sandbox directories (/dev,
/tmp or /proc) are not empty when tearing down the sandbox, because
it would indicate something is wrong with bwrap.

When in interactive mode however, the user/project may have mounted
additional directories inside these base directories; for which we
need to create intermediate directories for the mount.

Instead of keeping track of every intermediate directory, just force
remove in interactive mode, as this is safe.

Ideally, we should fix upstream bwrap to cleanup the debris it creates
when exiting.
parent 85912562
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment