summaryrefslogtreecommitdiff
path: root/buildstream/element.py
Commit message (Collapse)AuthorAgeFilesLines
...
* element.py: Protect against variable substitutions outside of ↵Tristan Van Berkom2017-05-301-0/+10
| | | | Element.configure()
* element.py: Fixed dumb mistake bad bitwise operationTristan Van Berkom2017-05-301-1/+2
|
* element.py: Format '?' instead of zeroes for fallback display cache keys.Tristan Van Berkom2017-05-291-1/+1
| | | | | These make more sense than zeroes, since zeroes are astronomically rare but valid cache keys.
* element.py: Added _force_inconsistent() method and fixed cached stateTristan Van Berkom2017-05-291-8/+21
| | | | | | | | | | For initializing a pipeline in a forcefully inconsistent state, this is required for pipelines which execute TrackQueues. Also improved handling of the cached state in general so that the cached state is only calculated once, and only after there is a cache key. The element appears to be not cached unconditionally until a cache key can be resolved.
* element.py: Allow forceful reinterrogation of consistency stateTristan Van Berkom2017-05-281-2/+5
|
* element: Give a helpful error if the 'collect' dir doesn't existSam Thursfield2017-05-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can occur with 'script' elements for example where the 'collect' directory can be specified by the user. Previously putting an invalid directory for the 'collect' field caused this output: [--:--:--][7ea949f2][initramfs/initramfs-gz.bst ] START Caching Artifact [00:03:09][7ea949f2][initramfs/initramfs-gz.bst ] BUG gnu-toolchain/initramfs-initramfs-gz/7ea949f2-build.4045.log An unhandled exception occured: Traceback (most recent call last): File "/home/shared/src/buildstream/buildstream/_scheduler.py", line 643, in child_action result = self.action(element) File "/home/shared/src/buildstream/buildstream/_pipeline.py", line 152, in process element._assemble() File "/home/shared/src/buildstream/buildstream/element.py", line 715, in _assemble self.__artifacts.commit(self, collectdir) File "/home/shared/src/buildstream/buildstream/_artifactcache.py", line 136, in commit _ostree.commit(self.repo, content, ref) File "/home/shared/src/buildstream/buildstream/_ostree.py", line 138, in commit mtree, commit_modifier) GLib.GError: g-io-error-quark: openat: No such file or directory (1) Build failure on element: initramfs/initramfs-gz.bst One now gets a more useful error: [00:02:55] FAILURE [initramfs/initramfs-gz.bst]: Build Directory '/invalid' was not found inside the sandbox, unable to collect artifact contents
* element.py: Substitute variables in integration commands.Tristan Van Berkom2017-05-211-1/+2
| | | | | These were being performed raw, but better to support the substitutions in integration commands.
* element.py: Added Element.get_variable()Tristan Van Berkom2017-05-151-0/+15
| | | | | | Allows plugins to behave differently depending on the value of a variable declared on a given element (i.e. the resolved 'variables' section of the element configuration).
* element.py: Dont raise error when the shell returns errorTristan Van Berkom2017-04-091-2/+0
| | | | | | | When running a shell, either to debug a build or because the user invoked `bst shell`, it is not an error for the actual shell to return an error, if the user entered 'exit' or 'exit 1' from their shell, we dont really care.
* element.py: Handle log flushing at termination more carefullyTristan Van Berkom2017-04-081-3/+11
| | | | | | | | | If the child process is in the middle of using the I/O stack in python while trying to flush the python file handle, this is non reentrant and will raise an exception. Handle this exception and simply flush the underlying file descriptor instead.
* Updated sources to use _signals.py for the signal handling.Tristan Van Berkom2017-04-071-2/+3
|
* Untangling _yaml and utils modules.Tristan Van Berkom2017-04-071-7/+7
| | | | | These had a circular import, which is only supported > python 3.5 but undesirable anyway.
* element.py: Added Element.search() APITristan Van Berkom2017-04-021-0/+16
| | | | | A convenience method for searching a dependency by it's name (which is the project relative bst filename as usual).
* element.py: Fix _get_display_key() formatting for keyless elementsTristan Van Berkom2017-03-291-1/+1
|
* element.py: Include project cache key in element cache key calculationTristan Van Berkom2017-03-241-0/+2
|
* Refactor: Untangling element/source namesTristan Van Berkom2017-03-181-10/+15
| | | | | | | | | | | | | | | | | | | | | | | 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
* element.py: Documentation fixesTristan Van Berkom2017-03-161-5/+17
|
* element.py: Added stage_dependencies() convenience function.Tristan Van Berkom2017-03-151-10/+42
| | | | | | | | | | | | This iterates over the elements dependencies and stages them somewhere in a sandbox. This is especially interesting because of the added warnings it gives you about the file overlaps and ignored files which would otherwise overwrite non-empty directories. Also updated build and compose elements to use this in place of manually looping.
* element.py: Added arguments to Element.stage()Tristan Van Berkom2017-03-151-12/+69
| | | | | | | | Element.stage() now understands artifact splitting rules, one can now specify: o A list of domains to include when staging o Whether to stage orphaned files or not
* element.py: Expose element sources generator function.Tristan Van Berkom2017-03-151-10/+11
| | | | | This can be useful to plugins, even if usually they will be using the stage_sources() convenience function.
* element.py: Add 'recurse' argument to dependencies()Tristan Van Berkom2017-03-151-32/+37
| | | | | | By default this is True and the functionality remains the same as before. If False is specified, then only direct dependencies of the specified Scope are reported.
* element.py: Load and composite the split-rules public data.Tristan Van Berkom2017-03-131-1/+54
|
* element.py: Adapt to artifact API changeTristan Van Berkom2017-03-101-16/+5
|
* element.py: Adapt to new clean sandbox implementationTristan Van Berkom2017-03-081-52/+41
| | | | | | | | Now sandbox has proper API contract and encapsulates better this way, at the moment Element is the only one creating sandboxes, so it will create a SandboxBwrap implementation directly until there is need of a factory function to decide on which implementation to use.
* Fixing permissions, some random python files became executableTristan Van Berkom2017-03-061-0/+0
|
* element.py: Remove build sandbox and flush logs on termination.Tristan Van Berkom2017-03-051-4/+18
| | | | | | | | Ensure cleanest as possible state when forcefully terminating a task. Also time the activity of staging dependencies at _shell() time and make them silent nested messages, avoid huge output when running `bst shell`.
* element.py: Simplify message, cache keys already in the default log lineTristan Van Berkom2017-03-021-1/+1
|
* element.py: Added _get_display_key()Tristan Van Berkom2017-03-021-7/+21
| | | | | And use the abbreviated displayable cache key for the artifact caching message and for log file names.
* element.py: Propagate provenance directly from metadata when chaining up ↵Tristan Van Berkom2017-02-271-2/+2
| | | | constructor
* element.py: Use Mapping in _yaml.node_get(), also only recalculate cached ↵Tristan Van Berkom2017-02-261-7/+18
| | | | | | | | | | | state once. This is more accurate than 'dict', it can be a ChainMap sometimes which will not be a 'dict' Now we only recalculate the cached state when explicitly asked and not before, ensuring that we only ever interrogate the artifact cache once per element.
* element.py: Fixed __init_defaults() to only initialize class data once.Tristan Van Berkom2017-02-261-1/+1
|
* element.py: Use _node_chain_copy() in place of deepcopy()Tristan Van Berkom2017-02-261-8/+6
| | | | While initializing element configurations.
* element.py: Shave off a couple seconds in redundant deep copiesTristan Van Berkom2017-02-261-23/+9
|
* element.py: Calculate cache keys based only on direct build dependenciesTristan Van Berkom2017-02-261-1/+1
| | | | | | | | | Instead of using the entire compounded dependency list including transient runtime dependencies of build dependencies, just use the direct build dependencies. The direct build dependency cache keys already include their dependencies, and this saves us about one full second while loading a converted baserock gnome stack (huge project).
* element.py: Set log handle on all dependencies.Tristan Van Berkom2017-02-251-2/+7
| | | | | So that logging things about other elements in the context of a task for a given element also redirects messages the logs to the log file.
* element.py: Changes to sandbox creation and shellingTristan Van Berkom2017-02-241-1/+17
| | | | | | | | | | o Unconditionally mount a read-write volume for the /buildstream directory. This separate bind mount is necessary to differentiate from the / which may be read only o If there is a build directory, make it the sandbox CWD by default, this is more practical when shelling into a failed build directory
* element.py: Timed activity for staging sources.Tristan Van Berkom2017-02-231-2/+4
|
* element.py: Added private accessor _get_variables()Tristan Van Berkom2017-02-221-0/+7
|
* element.py: Use 'sh' instead of '/bin/sh' to run shell commandsTristan Van Berkom2017-02-211-2/+2
| | | | Dont assume where the shell is located
* element.py: Catch any errors which originate from sandbox assemblyTristan Van Berkom2017-02-161-1/+8
| | | | And reraise the exception, after tacking on the internal build sandbox detail.
* element.py: Include build dependency integration commands in cache keys.Tristan Van Berkom2017-02-161-0/+13
| | | | | | | | | | | Integration commands in BuildStream run whenever staging the build dependencies of an element, so that an element can expect a fully integrated base to build on. As such, integration commands imposed on depending elements do not effect the given element's cache key. However, the sum of an element's dependency integration commands does effect the depending element's cache key.
* Remove apostrophes from grammatically incorrect instances of "it's"Paul Sherwood2017-02-111-1/+1
|
* element.py: Time the activity of creating an artifactTristan Van Berkom2017-02-031-4/+6
| | | | | This can take some time and we weren't notifying the user about it, so better have some feedback while artifacts are being created.
* element.py: Set a deterministic mtime on the sources staging areaTristan Van Berkom2017-02-031-0/+3
|
* element.py: Use a uid/gid root sandboxTristan Van Berkom2017-02-031-6/+5
|
* element.py: Resolve environment-nocache and adjust cache key calculationTristan Van Berkom2017-01-271-16/+38
| | | | | Now we consider environment variables in our cache key calculations, excepting for the env vars flagged as nocache.
* element.py: Allow variable substitutions in environment variables.Tristan Van Berkom2017-01-271-4/+9
| | | | | | | | | There is some danger in confusing the environment variables with system targetting variables, one should not make assumptions around the install %{prefix} being the correct prefix for running, even though it's correct some of the time and tempting to do. On the other hand variable substitutions here can be useful.
* element.py: Handle integration of staged artifacts.Tristan Van Berkom2017-01-251-0/+40
| | | | | | | | | o Added get_public_data() to fetch public attributes on the element o Added integrate() API to run the integration-commands, these are public data found in the BuildStream ('bst') domain. o Run integrate() on all dependencies when launching a shell.
* element.py: Fixed reversed assertion.Tristan Van Berkom2017-01-251-1/+1
|
* element.py: Rework cached & consistency state cachingTristan Van Berkom2017-01-201-30/+32
| | | | | Only interrogate plugins once, after that manually update states depending on successful build steps.