summaryrefslogtreecommitdiff
path: root/buildstream/_frontend/cli.py
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-02-22 22:39:52 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-02-23 01:52:50 +0900
commitb696d36386b3ec0a57d1eda72449d4bcee2bd227 (patch)
tree67a345f00630b50a524fd0bfa16817469d683293 /buildstream/_frontend/cli.py
parent11f2de77287ff06d60b88452aa125a37de375030 (diff)
downloadbuildstream-b696d36386b3ec0a57d1eda72449d4bcee2bd227.tar.gz
bst shell: Added --isolate option, disabled by default.tristan/isolate-shell
This changes a few things: o How the shell environment and sandbox modes are setup is not decided by whether a `--build` sandbox was staged or not o In interactive build debugging mode, an isolated build sandbox is used o The bst shell command now has the option to control it o All invocations of bst shell now use a read-only rootfs, avoiding FUSE layer and file descriptor limits (this can be made optional later if needed) This is a part of issue #223
Diffstat (limited to 'buildstream/_frontend/cli.py')
-rw-r--r--buildstream/_frontend/cli.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py
index 9d203427f..c5fc87bab 100644
--- a/buildstream/_frontend/cli.py
+++ b/buildstream/_frontend/cli.py
@@ -458,20 +458,22 @@ def show(app, elements, deps, except_, order, format, downloadable):
##################################################################
@cli.command(short_help="Shell into an element's sandbox environment")
@click.option('--build', '-b', is_flag=True, default=False,
- help='Create a build sandbox')
+ help='Stage dependencies and sources to build')
@click.option('--sysroot', '-s', default=None,
type=click.Path(exists=True, file_okay=False, readable=True),
help="An existing sysroot")
+@click.option('--isolate', is_flag=True, default=False,
+ help='Create an isolated build sandbox')
@click.argument('element',
type=click.Path(dir_okay=False, readable=True))
@click.argument('command', type=click.STRING, nargs=-1)
@click.pass_obj
-def shell(app, element, sysroot, build, command):
+def shell(app, element, sysroot, isolate, build, command):
"""Run a command in the target element's sandbox environment
- This will first stage a temporary sysroot for running
- the target element, assuming it has already been built
- and all required artifacts are in the local cache.
+ This will stage a temporary sysroot for running the target
+ element, assuming it has already been built and all required
+ artifacts are in the local cache.
Use the --build option to create a temporary sysroot for
building the element instead.
@@ -508,7 +510,7 @@ def shell(app, element, sysroot, build, command):
sys.exit(-1)
try:
- exitcode = app.pipeline.targets[0]._shell(scope, sysroot, command=command)
+ exitcode = app.pipeline.targets[0]._shell(scope, sysroot, isolate=isolate, command=command)
sys.exit(exitcode)
except BstError as e:
click.echo("", err=True)