summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* make unsed loop control variables underscoresfrazer/flake8Frazer Leslie Clews2019-11-1214-30/+43
|
* remove unused importsFrazer Leslie Clews2019-11-121-1/+0
|
* doc/source/hacking: Remove pycodestyle, add BlackChandan Singh2019-11-122-16/+26
| | | | | | | | | | | Now that code formatting is managed by Black, and we don't need to run `pycodestyle` separately, remove corresponding mentions from hacking documentation. Add documentation on how to run Black. Move out linting and formatting into a separate section for better readability.
* Reformat code using BlackChandan Singh2019-11-12275-13931/+12098
| | | | | | | As discussed over the mailing list, reformat code using Black. This is a one-off change to reformat all our codebase. Moving forward, we shouldn't expect such blanket reformats. Rather, we expect each change to already comply with the Black formatting style.
* .gitlab-ci.yml: Check code formatting as part of CIChandan Singh2019-11-121-1/+4
| | | | As part of the `lint` CI job, also check code formatting.
* Remove pycodestyleChandan Singh2019-11-124-8/+0
| | | | | | Now that PEP8 style is enforced by Black, we don't need another tool checking the same. So, remove all configuration related to `pycodestyle`.
* .pylintrc: Disable formatting messagesChandan Singh2019-11-121-1/+13
| | | | | | | Since we use Black to format our code, disable code-formatting messages from Pylint as they are already taken care of by Black. This ensures that we don't get double warnings for the same problem, and that Pylint and Black don't fight with each other over style.
* Add configuration to run BlackChandan Singh2019-11-122-0/+38
| | | | | | | | | | Introduce two new tox environments - `format` and `format-check`. The `format` environment will reformat the code using `black` whereas the `format-check` envrionment will simply print the diff without modifying any files. Configure Black to use the same line lengths that we use currently, i.e. 119.
* Merge branch 'bschubert/fix-capa-check' into 'master'bst-marge-bot2019-11-126-71/+225
|\ | | | | | | | | | | | | Fix capabilities check of remotes Closes #1178 See merge request BuildStream/buildstream!1705
| * _sourcecache.py: Fix reporting of capabilities for the source cacheBenjamin Schubert2019-11-122-12/+63
| | | | | | | | This also adds a test to ensure we are correctly setting the cache up
| * _remote: Ensure checks done in the subclasses are propagatedBenjamin Schubert2019-11-124-59/+162
|/ | | | | | | | | | | Currently, the `BaseRemote` would call `_check()` on the children, which states that errors should be sent back as a string. However, `BaseRemote` doesn't check the return of `_check()`. This changes the contract so that subclasses throw `RemoteError` themselves. This also fixes the `ArtifactShare` and add a test.
* Merge branch 'chandan/fix-no-color' into 'master'bst-marge-bot2019-11-123-13/+12
|\ | | | | | | | | | | | | _frontend: Simplify color handling Closes #1200 See merge request BuildStream/buildstream!1704
| * _frontend: Simplify color handlingChandan Singh2019-11-123-13/+12
|/ | | | | | | | | | | | Currently we store color configuration in our App object, and have to remember to pass it around to `click.echo()` when printing things on the screen. This is error-prone as we can forget to do so. This leads to bugs like #1200, where `bst init` was not respecting `--no-colors` flag. Instead of doing that, this patch controls colors in output by configuring the `click.Context` object. Fixes #1200.
* Merge branch 'chandan/fix-implicit-string-concat' into 'master'bst-marge-bot2019-11-121-2/+2
|\ | | | | | | | | tests/frontend/completions: Fix implicit string concatenation See merge request BuildStream/buildstream!1702
| * tests/frontend/completions: Fix implicit string concatenationChandan Singh2019-11-121-2/+2
|/ | | | | | | | | | We expect `INVALID_ELEMENTS` to be a list of element names. However we are missing a comma in between the names, so they end up being concatenated into a single strings. The test passes either way (which is not ideal) because it just checks that the suggested completion is _different_ than the expected in case of errors.
* Merge branch 'juerg/sandbox-reapi' into 'master'bst-marge-bot2019-11-112-178/+226
|\ | | | | | | | | Add SandboxREAPI class See merge request BuildStream/buildstream!1699
| * sandbox: Move SandboxRemoteBatch to SandboxREAPIJürg Billeter2019-11-112-69/+68
| |
| * sandbox: Move _run() from SandboxRemote to SandboxREAPIJürg Billeter2019-11-112-102/+111
| |
| * sandbox: Add abstract SandboxREAPI classJürg Billeter2019-11-112-6/+32
| | | | | | | | | | This provides a skeleton for sandbox implementations based on the Remote Execution API.
| * _sandboxremote.py: Fetch outputs in _execute_action()Jürg Billeter2019-11-111-8/+17
| | | | | | | | This makes process_job_output() reusable for local execution.
| * _sandboxremote.py: Extract _execute_action() method from _run()Jürg Billeter2019-11-111-22/+32
| | | | | | | | This will allow making _run() reusable for local execution.
| * _sandboxremote.py: Simplify exit code returnJürg Billeter2019-11-111-6/+3
| |
| * _sandboxremote.py: Send command and action together with the other blobsJürg Billeter2019-11-111-14/+7
| | | | | | | | This reduces the number of round trips.
| * _sandboxremote.py: Ensure working directory existsJürg Billeter2019-11-111-0/+5
|/
* Merge branch 'bschubert/fix-children-termination' into 'master'bst-marge-bot2019-11-113-16/+85
|\ | | | | | | | | scheduler.py: Prevent the asyncio loop from leaking into subprocesses See merge request BuildStream/buildstream!1691
| * scheduler.py: Remove FIXME message and add explanation insteadBenjamin Schubert2019-11-111-5/+3
| |
| * scheduler.py: Prevent the asyncio loop from leaking into subprocessesBenjamin Schubert2019-11-112-11/+82
|/ | | | | | | | | | | Having a running asyncio loop while forking a program is not supported in python and doesn't work as expected. This leads to file descriptors leaking and the subprocesses sharing the same loop as the parents. This also leads to the parent receiving all signals the children receive. This ensures we don't leek our asyncio loop in the workers we fork.
* Merge branch 'chandan/no-command-general-elements' into 'master'bst-marge-bot2019-11-112-0/+6
|\ | | | | | | | | Indicate that compose & stack plugins do not run commands See merge request BuildStream/buildstream!1697
| * Indicate that compose & stack plugins do not run commandsChandan Singh2019-11-112-0/+6
|/ | | | | | Both compose and stack elements do not run commands in the build sandbox. Indicate so by setting the `BST_RUN_COMMANDS` attribute accordingly.
* Merge branch 'coldtom/allow-dev-shm' into 'master'bst-marge-bot2019-11-114-2/+61
|\ | | | | | | | | | | | | _sandboxbwrap.py: Create /dev/shm in the sandbox Closes #1197 See merge request BuildStream/buildstream!1694
| * _sandboxbwrap.py: Create /dev/shm in the sandboxThomas Coldrick2019-11-114-2/+61
|/ | | | | | | | | | | | Creates /dev/shm as a tmpfs in the sandbox. Before now access to /dev/shm was only available by a plugin using `Sandbox.mark_directory()` or adding to `Sandbox.DEVICES`, either of which would _mount_ /dev/shm into the sandbox, allowing pollution from the host. This adds it as a tmpfs by default, which seems sensible as it is required for POSIX support. Also adds a test which makes sure that we can open a shared memory object inside the build sandbox with some (probably poor) C code.
* Merge branch 'traveltissues/1186-3' into 'master'bst-marge-bot2019-11-113-16/+30
|\ | | | | | | | | | | | | skip tracking elements without trackable sources Closes #1186 See merge request BuildStream/buildstream!1689
| * _stream: Remove exception case for removed optionDarius Makovsky2019-11-111-10/+0
| |
| * Add _is_trackable() method to Source()Darius Makovsky2019-11-113-6/+30
|/ | | | | | | | | | | | | | | | This method reports whether the source can be tracked. This would be false for sources advertising BST_KEY_REQUIRES_STAGE. Element tracking can be skipped if none of the held sources can be tracked. This is determined by the value of the `Element.__tracking_scheduled` attribute which is set in `Element._schedule_tracking()`. This is set to `True` if at least one source can be tracked. Also remove some of the tracking handling from `_stream._load` to `_stream.track` where it is more relevant. closes #1186
* Merge branch 'bschubert/expand-path-configs' into 'master'bst-marge-bot2019-11-112-2/+82
|\ | | | | | | | | | | | | _remote.py: Expand user in certificates paths Closes #741 See merge request BuildStream/buildstream!1696
| * _remote.py: Expand user in certificates pathsBenjamin Schubert2019-11-112-2/+82
|/ | | | This ensures we correctly expand "~" in paths to certificates
* Merge branch 'chandan/stack-no-sources' into 'master'bst-marge-bot2019-11-081-0/+3
|\ | | | | | | | | plugins/elements/stack: Disallow sources See merge request BuildStream/buildstream!1695
| * plugins/elements/stack: Disallow sourceschandan/stack-no-sourcesChandan Singh2019-11-081-0/+3
|/ | | | | | Stack elements represent a logical grouping of dependencies. As such, sources for stack elements do not make any sense. So, explicitly disallow them to prevent any confusion.
* Merge branch 'bschubert/fix-children-termination' into 'master'bst-marge-bot2019-11-081-2/+8
|\ | | | | | | | | app.py: Also catch SystemError with click.Abort See merge request BuildStream/buildstream!1690
| * app.py: Also catch SystemError with click.AbortBenjamin Schubert2019-11-081-2/+8
|/ | | | | | | | | This is to catch an error when sometimes the readline buffer of stdin gets corrupted during the second CTRL-C we send, and leads to having BuildStream hand and throw a SystemError. Catching the SystemError and treating as a click.Abort doesn't seem to have adverse effects.
* Merge branch 'traveltissues/closeworkspaces' into 'master'bst-marge-bot2019-11-065-26/+31
|\ | | | | | | | | | | | | Remove ignore_workspaces kwarg Closes #1190 See merge request BuildStream/buildstream!1688
| * _stream: correct typo in error messagetraveltissues/closeworkspacesDarius Makovsky2019-11-061-1/+1
| |
| * Remove unnecessary ignore_workspaces kwargDarius Makovsky2019-11-065-25/+30
|/ | | | | | Attempting to open a workspace for the same element without closing it now raises. This makes this kwarg unnecessary and tests should close workspaces between attempts to open.
* Merge branch 'traveltissues/1182' into 'master'bst-marge-bot2019-11-054-6/+11
|\ | | | | | | | | | | | | Remove `commit`ting sources inside `Source()._generate_key` Closes #1182 See merge request BuildStream/buildstream!1686
| * Remove `commit`ting sources inside `Source()._generate_key`Darius Makovsky2019-11-054-6/+11
|/ | | | | | | | `Stream.shell()` should check that the element's sources are cached before calling the shell. If the sources are not cached raise a StreamError and recommend a fetch. closes #1182
* Merge branch 'bschubert/better-reporting-on-userconfig' into 'master'bst-marge-bot2019-11-052-1/+27
|\ | | | | | | | | _context.py: Improve reporting of incorrect user config See merge request BuildStream/buildstream!1687
| * _context.py: Improve reporting of incorrect user configbschubert/better-reporting-on-userconfigBenjamin Schubert2019-11-052-1/+27
|/ | | | | | This fixes a case where, in project overrides, if a user specified a scalar/sequence instead of a mapping for a given project, the user would receive an ugly stacktrace instead of an invalid format.
* Merge branch 'aevri/testutils_artifactshare' into 'master'bst-marge-bot2019-11-051-28/+33
|\ | | | | | | | | tests/artifactshare: safer cleanup_on_sigterm use See merge request BuildStream/buildstream!1673
| * tests/artifactshare: safer cleanup_on_sigterm useaevri/testutils_artifactshareAngelos Evripiotis2019-11-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Use the documented path [1] to `pytest_cov.embed.cleanup_on_sigterm()`, to avoid crashing on some versions. It turns out that pytest_cov v2.6.1 on my machine doesn't like the way that we were accessing cleanup_on_sigterm(). Access it in such a way that we will either get the function or an ImportError, as per the documentation. [1]: https://pytest-cov.readthedocs.io/en/latest/subprocess-support.html
| * testutils/artifactshare: don't hang on errorAngelos Evripiotis2019-11-051-28/+33
|/ | | | | | | | Remove a couple of cases where it's possible to make the main test process hang, waiting for something to appear on a queue. Raise a friendlier exception, earlier, if there was a problem starting the server process.