summaryrefslogtreecommitdiff
path: root/buildstream/plugin.py
Commit message (Collapse)AuthorAgeFilesLines
...
* plugin.py: Added BST_REQUIRED_VERSION_MAJOR and BST_REQUIRED_VERSION_MINORTristan Van Berkom2017-08-301-0/+7
| | | | | Element and Source plugins can set this as class data to indicate the minimal BuildStream API they depend on.
* plugin.py: Added detail parameter to Plugin.timed_activity()Tristan Van Berkom2017-08-291-2/+3
| | | | | | | | Allows for more information in timed activities, consequently avoiding the need for additional status messages in some cases. The message detail component is only shown at activity START time but omitted at FAILURE/SUCCESS time.
* plugin.py: Document that logging is normally suppressed during configureJonathan Maw2017-07-011-0/+5
|
* plugin.py: Use utils._call()Jürg Billeter2017-06-271-39/+1
|
* plugin.py: Use utils._kill_proc_tree()Tristan Van Berkom2017-06-131-6/+1
| | | | Instead of doing this manually, we're gonna share that code.
* plugin.py: More brutal approach for sub process terminationTristan Van Berkom2017-05-311-16/+17
| | | | | | | | | | When a plugin shells out to another program and then it's job is terminated, just kill the whole process tree which we introspect using psutil. This is brutal but reliably cleans up active processes and never leaves any orphaned tasks, all approaches so far to allow abstract child tasks exit gracefully on SIGTERM have not been reliable.
* plugin.py: More gentle and reliable subprocess terminationTristan Van Berkom2017-05-291-71/+66
| | | | | | | | | o Refactored the Plugin.call() and Plugin.check_output() APIs to share a common implementation o Implement more gentle process killing by first sending SIGTERM and then SIGKILL only if the child process group does not exit after 5 seconds of waiting.
* Make logging go to stdout when the test suite is being run in CIJonathan Maw2017-05-251-1/+4
|
* plugin.py: Use suspendable() to track paused seconds in timed activitiesTristan Van Berkom2017-04-071-15/+28
| | | | | Timed activities now do not count the passing of time while the build is suspended.
* Updated sources to use _signals.py for the signal handling.Tristan Van Berkom2017-04-071-3/+3
|
* Refactor: Untangling element/source namesTristan Van Berkom2017-03-181-11/+29
| | | | | | | | | | | | | | | | | | | | | | | o The metaelements and metasources now carry the name, the loader resolves source names now. o Element/Source factories dont require a name anymore as they are already in the meta objects o Pipeline no longer composes names o Element.name is now the original project relative filename, this allows plugins to identify that name in their dependencies, allowing one to express configuration which identifies elements by the same name that the user used in the dependencies. o Removed plugin._get_display_name() in favor of the plugin.name o Added Element.normal_name, for the cases where we need to have a normalized name for creating directories and log files o Updated frontend and test cases and all callers to use the new naming
* plugin.py: Use utils._suspendable() to properly suspend/resume subprocesses.Tristan Van Berkom2017-03-061-6/+27
|
* Fixing permissions, some random python files became executableTristan Van Berkom2017-03-061-0/+0
|
* plugin.py: Enhanced host tool calling functions to terminate forcefullyTristan Van Berkom2017-03-051-18/+32
| | | | | | | | When the calling process is terminating, force kill the child subprocess. Also small change to not `raise e` when reraising, that loses the traceback and starts a new one, instead just `raise` is correct.
* plugin.py: timed_activity() Now takes silent_nested parameterTristan Van Berkom2017-02-231-5/+6
| | | | This ensures any child messages are silenced.
* Introduce base (internal) Exception class _BstErrorTristan Van Berkom2017-02-161-2/+2
| | | | | | This is used to carry additional internal context (like the sandbox directory at assembly time) on errors reported by plugins so they can be easily reported back to the main process.
* Remove apostrophes from grammatically incorrect instances of "it's"Paul Sherwood2017-02-111-2/+2
|
* plugin.py: Host command status message format changeTristan Van Berkom2017-01-191-1/+1
| | | | | Put the command in the detail parameter so it shows up on a separate line, status messages are optional anyway.
* plugin.py: Dont create Message() objects in destructor.Tristan Van Berkom2017-01-161-2/+5
| | | | | | These will pass on a plugin unique id which when used to index the plugin will raise KeyError, instead just accept the plugin is dead and print to stdout if in debug mode.
* plugin.py: Push and pop message depth and few changesTristan Van Berkom2017-01-141-47/+90
| | | | | | | | | | | | Push and pop the timed activity depth for the process in the timed_activity() context manager. Other changes: o plugin.py: Improved check_output() o Added info() api to send INFO messages o Discard DEBUG messages at the stem if not in debug mode o Added _get_provenance()
* plugin.py: Added helper methods for running host toolsTristan Van Berkom2017-01-121-10/+142
| | | | | These create the appropriate exceptions automatically, reducing the work for plugins.
* plugin.py: Added logging utilitiesTristan Van Berkom2017-01-121-1/+157
| | | | | | | | | | Plugin now has debug(), status(), warn(), error() and the new context manager timed_activity() inspired from the similar context manager in ybd. This patch also adds unique ID handling for all plugin instances, this is used to refer to specific plugins in messages and return values from child processes.
* plugin.py: Added missing import for ImplErrorTristan Van Berkom2017-01-091-0/+1
|
* plugin.py: Added new Plugin base class.Tristan Van Berkom2017-01-071-0/+213
| | | | | | | This just shares some common aspects of being a plugin in buildstream, allowing some code sharing between Element and Source interfaces. This class also swallows up the utils node handling utilities.
* Move plugin.py -> _plugin.pyTristan Van Berkom2016-11-091-98/+0
| | | | This is entirely private.
* Adding plugin moduleTristan Van Berkom2016-11-081-0/+98
This provides the internal _PluginContext class used as a base class for Source and Element factories. This supports loading Element and Source plugins from multiple sources, and allows the pipeline to keep separate contexts of loaded plugins, so that recursive pipeline builds can work with separate plugin contexts.