summaryrefslogtreecommitdiff
path: root/buildstream/sandbox/sandbox.py
Commit message (Collapse)AuthorAgeFilesLines
* sandbox/sandbox.py: Display failed commands in the detail stringtristan/error-message-regressionTristan Van Berkom2019-01-161-4/+5
| | | | | | | | | | | We should only display commands in detail strings, not in the message texts. This also updates tests/integration/sandbox-bwrap.py to expect the new message string which only contains the command exit status and not the whole command itself, this does not alter the validity of the text case which is checking that we can obtain the expected return value.
* sandbox/sandbox.py: Use assertions for programming errors instead of BstErrors.tristan/sandbox-programming-errorTristan Van Berkom2019-01-081-4/+4
| | | | | When code is faulty, in a plugin or in the core, we should get a stack trace and a BUG message.
* sandbox/sandbox.py: Fix regression of command loggingTristan Van Berkom2019-01-071-1/+1
| | | | | | | | | | Since we added batch commands, the batch commands print the text of the commands directly in the message text, but this is wrong. The detail string is the appropriate place for text of unknown lengths (the user can actually configure how many max lines of commands they want to see in their log), the message text itself should be controlled and brief enough to avoid text wrapping.
* Basic options for shell --build to use buildtreesWilliam Salmon2018-12-191-0/+1
| | | | Fixes issue #740
* sandbox/sandbox.py: Add command batching APIJürg Billeter2018-11-271-4/+249
| | | | This adds the batch() context manager.
* sandbox/sandbox.py: Add SandboxFlags.NONEJürg Billeter2018-11-271-0/+4
| | | | This improves readability.
* sandbox: Deduplicate code to process cwd, env, and command argumentsJürg Billeter2018-11-271-1/+34
|
* CasBasedDirectory: Change constructor to take a CASCache instead of a ContextRichard Maw2018-11-191-1/+1
| | | | | The Context was only used to obtain a reference to the CASCache and set the unused cas_directory field.
* element: Make "--sysroot" take a bare directoryJonathan Maw2018-10-301-4/+13
| | | | | | | | | | | | | | | | | | i.e. instead of taking a directory that must contain "root" and "scratch", and treating "root" as the root, use the directory directly. In element.py: * __sandbox takes the `bare_sandbox` arg, to pass into the sandbox's constructor In sandbox.py: * If bare_sandbox, `_root` is the passed-in directory, and `__scratch` is None. * Trying to use `__scratch` when bare_sandbox is True is a bug. In _mount.py: * Don't get the value of `__scratch` if it's not needed. This is part of #539
* sandbox.py: Remove redundant Sandbox.__directoryJonathan Maw2018-10-301-2/+1
|
* Sandbox: CWD was not being created for workspacesWilliam Salmon2018-10-161-1/+3
| | | | | | | | | | | | The code was creating the cwd folder but when the workspace was mounted in to the buildroot it was hiding the folder created in it behind the bind mounted workspace. However by using the bubblewarp `--dir` directive to ensure that cwd exists we can cover both workspace and non workspace situations with the same method. For issue #512 in Gitlab.
* sandbox.py: Stop caching get_virtual_directory if get_directory is usedJim MacArthur2018-09-251-7/+15
| | | | | Also update the documentation for get_virtual_directory to make the implications of using both methods clearer.
* sandbox: deduplicate default environment logicRichard Maw2018-09-161-4/+22
|
* sandbox.py: Allow setting the virtual directoryJim MacArthur2018-09-071-3/+20
| | | | | | | | This is for use after remote execution has finished, since remote execution produces a new output directory rather than modifying the initial directory. https://gitlab.com/BuildStream/buildstream/issues/454
* Sandbox: Return a CasBasedDirectory when an environment variable is setJim MacArthur2018-08-151-2/+10
|
* sandbox.py: Use _root in _has_commandjmac/virtual_directoriesJim MacArthur2018-08-011-2/+2
| | | | | | | This will need more attention when we bring in another virtual directory backend, however, we've said it is acceptable for the sandbox itself to access the underlying directory, and this is the best fix in the meantime.
* sandbox.py: Add function to get virtual directory.Jim MacArthur2018-08-011-0/+15
|
* Sandbox.py: Rename __root to _root.Jim MacArthur2018-08-011-4/+5
| | | | | | | | This is to allow to allow its use by subclasses. Since access to get_directories is now blocked for some plugins, and the subclasses of Sandbox do not have configuration defined by YAML files, they need another way to get at the root directory.
* Add BST_VIRTUAL_DIRECTORY flag for element pluginsJim MacArthur2018-08-011-3/+10
|
* Provide better error message on missing commandsTiago Gomes2018-07-021-0/+22
| | | | | | | Before running a command in the sandbox, check its existence and fail early if it does not. This fixes issue #289.
* Remove shebangs from python filesGökçen Nurlu2018-06-191-1/+0
| | | | Fixes #424
* doc/source/core_framework.rst: Use a toctree instead of linksTristan Van Berkom2018-06-091-3/+2
|
* Add 'sandbox' configuration key and build-uid/build-gid elementsJim MacArthur2018-03-231-2/+14
| | | | | | | | | | | | | | | | | | | | This only affects SandboxBWrap at the moment. buildstream/_loader.py: Add Symbol.SANDBOX and allow it in validation buildstream/_metaelement.py: Add 'sandbox' variable and store it in the object buildstream/_project.py: Add 'sandbox' configuration key and load it from project.conf. buildstream/data/projectconfig.yaml: Default build-uid/build-gid values of 0 for 'sandbox'. buildstream/element.py: Add __extract_sandbox_config to find the final sandbox configuration. Pass this to the sandbox constructor. buildstream/sandbox/_sandboxbwrap.py: If sandbox configuration was supplied, use it for uid and gid instead of the default 0. buildstream/sandbox/_sandboxchroot.py: Throw exception if non-0 uid/gid were supplied. buildstream/sandbox/__init__.py: Import SandboxConfig. buildstream/sandbox/_private.py: New file, containing SandboxConfig. Made private to avoid documentation for this class.
* pylint - dealt with redefined-argument-from-local warningJames Ennis2018-03-141-2/+2
|
* Inherit user id and group id for bst shellJürg Billeter2018-02-221-0/+9
| | | | | | This allows D-Bus access. Fixes #227
* doc: Add 'sandboxing' sectionSam Thursfield2018-02-201-0/+2
| | | | | This attempts to document and specify our current sandboxing functionality.
* Add support for doing incremental buildsChandan Singh2018-01-251-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | This functionality is only supported for sources which have an open workspace. When such sources are present, the workspace directory will be mounted directly inside the sandbox. As opposed to the default behavior, which is to copy files inside the sandbox. This will save time when building large projects as only those files will need be re-compiled that have been modified during two consecutive builds (assuming the underlying build system supports such behavior). A few things to note regarding this behavior: - If there are any `configure-commands` present, they will run only once for each open workspace. If an element has multiple workspaces and any one of them is opened/closed, they will be executed again on the next run. But, modifying the contents of a workspace will not trigger the `configure-commands` to be executed on the next run. - Workspaced builds still leverage the cache. So, if no changes are made to the workspace, i.e. no files are modified, then it will not force a rebuild. Fixes #192.
* sandbox.py: Make mark_directory use keyword args97-apply-pep-3102-to-all-public-api-surfacesJonathan Maw2017-11-141-1/+1
|
* sandbox: Make sandbox.run use keyword argsJonathan Maw2017-11-141-1/+1
|
* sandbox: Refactoring, moving accidentally public MountMap into it's own fileTristan Van Berkom2017-11-061-106/+0
|
* Refactoring: Move exceptions module to be privateTristan Van Berkom2017-11-061-1/+1
| | | | Hide all of buildstream's internal exceptions from the API surface.
* sandbox.py: Fixup placement of main Sandbox docstringTristan Van Berkom2017-10-021-4/+4
|
* Add platform factoriesTristan Maat2017-09-281-4/+3
|
* Move sandboxes to separate directoryTristan Maat2017-09-281-0/+347