From b696d36386b3ec0a57d1eda72449d4bcee2bd227 Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Thu, 22 Feb 2018 22:39:52 +0900 Subject: bst shell: Added --isolate option, disabled by default. 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 --- buildstream/_frontend/cli.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'buildstream/_frontend/cli.py') 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) -- cgit v1.2.1