summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* _yaml: Remove useless calls to '_yaml.node_sanitize'bschubert/remove-useless-sanitizeBenjamin Schubert2019-06-2112-24/+23
| | | | | | Calling '_yaml.dump' will itself call '_yaml.node_sanitize', therefore we can remove all calls to it in places where we directly after call dump.
* .gitlab-ci.yml: Use up-to-date bst-plugins-experimentalJavier Jardón2019-06-201-1/+1
| | | | Fixes #1046
* Merge branch 'tpollard/shellbuildtree' into 'master'bst-marge-bot2019-06-193-17/+29
|\ | | | | | | | | _frontend/cli.py: Tweak 'try' & 'always' bst shell buildtree handling See merge request BuildStream/buildstream!1392
| * _frontend/cli.py: Tweak 'try' & 'always' bst shell buildtree handlingTom Pollard2019-06-193-17/+29
|/ | | | | | | | | | | If the cached Artifact wasn't originally generated with a buildtree, then there's no need to attempt to find it in remotes by entering Stream(). In interactive mode we only present the user the option to attempt the pull with the above assumption on buildtree_exists, so apply the same to applicable non interactive choices. This also includes some tweaks in integration/shellbuildtrees.py to reflect changes and cover cases that were missing.
* Merge branch 'juerg/grpc' into 'master'Jürg Billeter2019-06-192-0/+6
|\ | | | | | | | | Guard against gRPC channels in the main process See merge request BuildStream/buildstream!1405
| * _sandboxremote.py: Guard against gRPC channels in the main processjuerg/grpcJürg Billeter2019-06-191-0/+3
| |
| * casremote.py: Guard against gRPC channels in the main processJürg Billeter2019-06-191-0/+3
|/
* Merge branch 'aevri/smallerjobs' into 'master'bst-marge-bot2019-06-191-6/+6
|\ | | | | | | | | jobs/job: send ChildJob the context, not scheduler See merge request BuildStream/buildstream!1407
| * jobs/job: send ChildJob the context, not schedulerAngelos Evripiotis2019-06-191-6/+6
|/ | | | | | | Instead of passing the whole scheduler to the ChildJob, only pass the part that is used - the context. Reducing the amount of shared state makes it easier to follow what's going on, and will make it more economical to move to away from the 'fork' model later.
* Merge branch 'aevri/pylint_argsdiff' into 'master'bst-marge-bot2019-06-1822-87/+132
|\ | | | | | | | | enable PyLint "arguments-differ" error, and fixup complaints See merge request BuildStream/buildstream!1390
| * _fuse/hardlinks: don't return result of os.unlinkAngelos Evripiotis2019-06-181-1/+1
| | | | | | | | | | | | Don't return, instead of returning 'the result' of os.unlink - it also doesn't return anything (and neither does the semantically identical os.remove).
| * pylint: enable arguments-differAngelos Evripiotis2019-06-181-3/+0
| |
| * tests/frontend: fix or ignore pylint args-differAngelos Evripiotis2019-06-183-3/+3
| | | | | | | | | | Ignore the warning for `_init_project_interactive`, as we really don't care what the arguments are.
| * _options: match methods to base classAngelos Evripiotis2019-06-185-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update OptionEnum and OptionFlags to match the Option base-class. Introduce 'load_special' to allow explicit usage of extended functionality, which wouldn't necessarily be supported by different subclasses. By making the signatures of overridden methods deliberately match, we can use PyLint to ensure the signatures don't accidentally differ. Also replace `super(cls, self)` with the equivalent and less error-prone `super()`, wherever we've touched it. In separate work we may want to replace this across the project. We must introduce __init__() functions for OptionEnum and OptionFlags to get a clean pass from PyLint. It seems that it's unable to see that load_special() is also transitively called from __init__().
| * testing/_utils: match git methods to base classAngelos Evripiotis2019-06-184-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | Update 'source_config' of Git and _SimpleGit to match the Repo base class. This ensures that they are fully substitutable Repos. Introduce 'source_config_extra' to allow explicit usage of extended functionality, which wouldn't necessarily be supported by a different subclass. By making the signatures deliberately match, we can use PyLint to ensure the signatures don't accidentally differ.
| * CliIntegration: match methods to base classAngelos Evripiotis2019-06-183-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update 'run' to match the base class. This ensures that it is a fully substitutable sub-class. Introduce 'run_project_config' to allow explicit usage of extended functionality, which wouldn't necessarily be supported by a different subclass. By making the signatures deliberately match, we can use PyLint to ensure the signatures don't accidentally differ. Since we're already relying on `kwargs['project']` succeeding, enforce that run_project_config() only takes keyword arguments.
| * _filebaseddirectory: match methods to base classAngelos Evripiotis2019-06-181-10/+10
| | | | | | | | | | | | | | | | | | Update import_single_file and export_to_tar to match the Directory base class. This ensures that FileBasedDirectory is a fully substitutable Directory. By making the signatures deliberately match, we can use PyLint to ensure the signatures don't accidentally differ.
| * _casbaseddirectory: match methods to base classAngelos Evripiotis2019-06-181-13/+28
| | | | | | | | | | | | | | | | | | Update import_single_file and list_relative_paths to match the Directory base class. This ensures that CasBasedDirectory is a fully substitutable Directory. By making the signatures deliberately match, we can use PyLint to ensure the signatures don't accidentally differ.
| * _fuse: match SafeHardlinkOps to base classAngelos Evripiotis2019-06-181-7/+7
| | | | | | | | | | | | | | Update signatures of SafeHardlinkOps methods to match the fuse.Operations base class. This helps ensure there's no confusion about what the arguments are for, and that SafeHardlinkOps can actually be substituted for any other Operations subclass.
| * _fuse/fuse: make create() match SafeHardlinkOpsAngelos Evripiotis2019-06-181-17/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the base-class fuse.Operations class match the subclass SafeHardlinkOps. Remove the complication of worrying about raw_fi mode - we already rely on it being inactive. Remove ambiguity from FUSE.create() - we only support the non-raw_fi case. In separate work, we may want to remove raw_fi completely. Update Operations.create() to use a 'flags' param explicitly, rather than the more confusing dual-meaning of the 'fi' param.
| * _fuse: converge args for link() and symlink()Angelos Evripiotis2019-06-181-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Get consistency between the Operations base class and the SafeHardlinkOps subclass. Use the 'target, source' convention as it appears in Operations. This avoids the confusion of 'target' changing meaning in the 'name, target' convention introduced by SafeHardlinkOps. The naming is also consistent with 'man ln', and more consistent with Python's equivalent functions. Unfortunately FUSE.link() and Operations.link() swap the order of 'target' and 'source', but the meaning is the same.
| * _gitsourcebase: ignore or fix arguments-differ errAngelos Evripiotis2019-06-181-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | PyLint helpfully points out that _GitMirror.fetch() does not match SourceFetcher.fetch() - it is missing the *kwargs argument. The same for _GitSourceBase.track(). Move towards being able to enable the 'arguments-differ' error faster by side-stepping the class design debate and ignoring the error for now. Change _GitSourceBase.set_ref() argument names to match Source.set_ref().
| * _frontend/widget: match LogFile.render to base clsAngelos Evripiotis2019-06-181-3/+5
|/ | | | | | | | | Make the signature of LogFile.render() match Widget.render() by making a new LogFile.render_abbrev() method with the extra functionality. Fix up the single call site to use that instead. This means that we won't get linter warnings that helpful inform us that Widgets are not really substitutable.
* Merge branch 'aevri/psutil_affinity' into 'master'bst-marge-bot2019-06-181-1/+3
|\ | | | | | | | | _platform.get_cpu_count: use psutil instead of os See merge request BuildStream/buildstream!1394
| * _platform.get_cpu_count: use psutil instead of osaevri/psutil_affinityAngelos Evripiotis2019-06-181-1/+3
|/ | | | | | | | Be Windows-friendly by using the portable `psutil.Process().cpu_affinity()` instead of `os.sched_getaffinity`. Note that unfortunately this still doesn't work on Mac, so we keep that platform-specific override.
* Merge branch 'jennis/fix_typo' into 'master'bst-marge-bot2019-06-171-1/+1
|\ | | | | | | | | tests/frontend/pull.py: Fix typo See merge request BuildStream/buildstream!1404
| * tests/frontend/pull.py: Fix typojennis/fix_typoJames Ennis2019-06-171-1/+1
|/
* Merge branch 'raoul/unique-error-domains' into 'master'bst-marge-bot2019-06-142-3/+4
|\ | | | | | | | | Make ErrorDomain a unique enumeration See merge request BuildStream/buildstream!1399
| * _exceptions.py: Make ErrorDomain uniqueraoul/unique-error-domainsRaoul Hidalgo Charman2019-06-132-3/+4
|/ | | | | | | | For some reason PROG_NOT_FOUND and APP were both under 12 which could be confusing. Changed PROG_NOT_FOUND to 16 and added a unique decorator to prevent this from happening again. Updated shellbuildtrees test to check correct error domain.
* Merge branch 'tpollard/elapsedtime' into 'master'bst-marge-bot2019-06-133-7/+4
|\ | | | | | | | | _scheduler/scheduler.py: Remove unused elapsed_time() calls See merge request BuildStream/buildstream!1398
| * _scheduler/scheduler.py: Remove unused elapsed_time() callstpollard/elapsedtimeTom Pollard2019-06-133-7/+4
|/ | | | | | Both run() and the App callback _ticker_callback() call & return elapsed_time(), which is the unused by the respective callers and as such is unnecessary.
* Merge branch 'juerg/cas-dead-code' into 'master'bst-marge-bot2019-06-121-56/+0
|\ | | | | | | | | cascache.py: Remove unused methods commit() and _commit_directory() See merge request BuildStream/buildstream!1395
| * cascache.py: Remove unused methods commit() and _commit_directory()Jürg Billeter2019-06-121-56/+0
|/
* Merge branch 'aevri/psutil_volume' into 'master'bst-marge-bot2019-06-121-3/+2
|\ | | | | | | | | utils._get_volume_size: use shutil.disk_usage See merge request BuildStream/buildstream!1393
| * utils._get_volume_size: use shutil.disk_usageaevri/psutil_volumeAngelos Evripiotis2019-06-121-3/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | This is win32-friendly, less to read, and fixes a latent bug. Avoid dealing with low-level platform specifics by using the higher-level shutil.disk_usage() function to calc total and available bytes for us. shutil is also more correct - it uses f_frsize to convert from blocks to bytes, instead of f_bsize. I verified that the numbers match with the output from `df -k`, whereas the old implementation did not. Here are the meanings from `man statvfs`: f_frsize The size in bytes of the minimum unit of allocation on this file system. (This corresponds to the f_bsize member of struct statfs.) f_bsize The preferred length of I/O requests for files on this file system. (Corresponds to the f_iosize member of struct statfs.) Link to shutil.disk_usage() implementation: https://github.com/python/cpython/blob/3.5/Lib/shutil.py#L980
* Merge branch 'aevri/supersuper' into 'master'bst-marge-bot2019-06-1211-17/+17
|\ | | | | | | | | Refactor 'super(cls, self)' -> 'super()' See merge request BuildStream/buildstream!1391
| * Refactor 'super(cls, self)' -> 'super()'aevri/supersuperAngelos Evripiotis2019-06-1211-17/+17
|/ | | | | | | | | | For most use-cases with modern Python, it's not necessary to supply the 'type' or 'object-or-type' arguments to super(). Replace all our instances with arg-less super, which is less error-prone. https://docs.python.org/3.5/library/functions.html#super
* Merge branch 'bschubert/fix-overnight' into 'master'bst-marge-bot2019-06-111-1/+2
|\ | | | | | | | | | | | | tests: Build wheel before installing BuildStream in overnight tests Closes #1045 See merge request BuildStream/buildstream!1388
| * tests: Build wheel before installing BuildStream in overnight testsBenjamin Schubert2019-06-101-1/+2
|/ | | | | | | BuildStream now requires setuptools and cython when building the wheel and thus can't be installed directly with pip install --no-index. Building a wheel beforehand allows us to install without dependencies.
* Merge branch 'bschubert/remove-useless-condition' into 'master'bst-marge-bot2019-06-102-2/+2
|\ | | | | | | | | plugins/sources: Remove 'or None' call that will never be true See merge request BuildStream/buildstream!1387
| * plugins/sources: Remove 'or None' call that will never be trueBenjamin Schubert2019-06-102-2/+2
|/ | | | | Since node_get_member has a default value passed in, it is impossible for the method to return 'None'
* Merge branch 'bschubert/optimize-extract-depends-node' into 'master'bst-marge-bot2019-06-075-52/+59
|\ | | | | | | | | rewrite _extract_depends_from_node in Cython and optimize See merge request BuildStream/buildstream!1383
| * _loader/types: Use range() instead of enumerate in extract_depends_from_nodeBenjamin Schubert2019-06-071-2/+2
| | | | | | | | | | range() and access to the list can be optimized better by cython than the enumerate() call.
| * _loader/types: Use an accumulator to speed up _extract_depends_from_nodeBenjamin Schubert2019-06-071-15/+8
| | | | | | | | | | | | | | We need to call this function three times in a row then concatenate the three results. Using an accumulator is slightly faster.
| * _loader/types: add type information on _extract_depends_from_nodeBenjamin Schubert2019-06-071-11/+15
| |
| * _loader/types: Use helper function for extract_depends_from_nodeBenjamin Schubert2019-06-071-17/+30
| | | | | | | | | | | | | | extract_depends_from_node has two different behaviors depending on whether it is calling itself or something else is calling it. Extracting the inner calls to a helper function helps speed up the code and makes it more understandable.
| * _loader: Move extract_depends_from_node from loadelement to typesBenjamin Schubert2019-06-075-52/+49
|/ | | | | | | | | | | extract_depends_from_node is only depending on things declared in types, loadelement doesn't have any dependency on it. It makes more sense to have it in types.pyx. Moreover, this allows us to cythonize the function, reducing its total runtime impact. - _yaml: expose node_del as public api for Cython
* Merge branch 'bschubert/stricter-node-api' into 'master'bst-marge-bot2019-06-075-23/+22
|\ | | | | | | | | Make the Node api stricter, by only accepting nodes See merge request BuildStream/buildstream!1384
| * NEWS: restrict `Plugin.node_items` to be called on `Node`s.bschubert/stricter-node-apiBenjamin Schubert2019-06-072-3/+6
| | | | | | | | | | Also update documentation in plugin for APIs that do accept Node and not `dict`.
| * _yaml: Don't check for none node in __trim_list_provenanceBenjamin Schubert2019-06-071-2/+2
| | | | | | | | | | By being more restrictive when creating new nodes, we can remove checks for not-node values.