summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Use sets when checking for existence of an elementbschubert/set-as-setBenjamin Schubert2019-02-153-15/+11
|
* Merge branch 'chandan/dot-graph' into 'master'Chandan Singh2019-02-151-0/+107
|\ | | | | | | | | | | | | contrib/bst-graph: Add script to print graph in DOT format Closes #705 See merge request BuildStream/buildstream!1148
| * contrib/bst-graph: Add script to print graph in DOT formatchandan/dot-graphChandan Singh2019-02-151-0/+107
|/ | | | | | | | | | This script leverages the recently added format strings (`%{build-deps}`, `%{runtime-deps}`) to `bst show` to print a graph in DOT format. This requires users to have the `graphviz` python package installed. Additionally, users can also render the graph using the `--format` option if they have the `graphviz` command line tool installed.
* Merge branch 'juerg/symlinks2' into 'master'Jürg Billeter2019-02-1436-333/+86
|\ | | | | | | | | Do not resolve or mangle symlinks during staging See merge request BuildStream/buildstream!1140
| * NEWS: Add entry for change in symlink handlingJürg Billeter2019-02-141-0/+4
| |
| * Bump artifact version for changes in symlink handlingJürg Billeter2019-02-1430-30/+30
| |
| * utils.py: Do not mangle absolute symlinksJürg Billeter2019-02-142-59/+4
| | | | | | | | | | Copy symlinks as they are, absolute or relative. We no longer resolve symlinks when copying files, which makes this safe.
| * _casbaseddirectory.py: Do not resolve symlinksJürg Billeter2019-02-142-192/+11
| | | | | | | | | | | | | | | | This matches the change in utils._process_list(). This also removes the _Resolver class as it is now unused. We may want to support controlled symlink resolution in the future, in which case the _Resolver class can be resurrected from this commit.
| * utils.py: Change _ensure_real_directory() to not resolve symlinksJürg Billeter2019-02-143-52/+37
|/ | | | | | | | | | | | | | | | | | | | | | | | Resolving symlinks during staging causes various issues: * Split rules may not work properly as the resolved paths will differ depending on whether another artifact with a directory symlink has been staged in the same root directory or not, e.g., as part of compose. * The order of symlinks in file lists is difficult to get right to guarantee consistent and predictable behavior as paths in a file list might rely on symlinks in the same file list. See #647 and #817. * Staging order differences can lead to surprising results. See #390. * Difficult to properly support absolute symlinks. Absolute symlinks are currently converted to relative symlinks, however, this doesn't always work. See #606 and #830. This will require changes in projects that rely on the current behavior. However, the changes are expected to be small and are often a sign of buggy element files. E.g., elements that don't fully obey `bindir` or `sbindir` variables.
* Merge branch 'bschubert/dont-keep-metasource' into 'master'Tristan Van Berkom2019-02-141-4/+14
|\ | | | | | | | | Don't keep MetaSource around in Source See merge request BuildStream/buildstream!1150
| * Don't keep MetaSource around in Sourcebschubert/dont-keep-metasourceBenjamin Schubert2019-02-141-4/+14
|/ | | | | | | We can easily rebiuld MetaSource from any source so there is no reason to keep them around. This will slightly improve memory usage.
* Merge branch 'danielsilverstone-ct/json-cache-key' into 'master'Tristan Van Berkom2019-02-1433-33/+36
|\ | | | | | | | | Update cache keys to use JSON See merge request BuildStream/buildstream!1151
| * Cache Keys: Update to use JSON rather than pickledanielsilverstone-ct/json-cache-keyDaniel Silverstone2019-02-1433-33/+36
|/ | | | | | | | This affects the cache key version (updated to 7) and introduces a dependency on `ujson` which is BSD licenced as of the version locked in `requirements.txt` Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
* Merge branch 'bschubert/cleanup-local-state' into 'master'Benjamin Schubert2019-02-134-5/+47
|\ | | | | | | | | Cleanup MetaElement local state See merge request BuildStream/buildstream!1147
| * Don't register exceptions when not running the testsuitebschubert/cleanup-local-stateBenjamin Schubert2019-02-131-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fix a problem with the garbage collector not being able to clean the MetaElements that are loaded. On small projects this is not a problem, but in bigger projects, this can save a few hundred of MBs at runtime The reason behind this is, whenever we have a "stack" element, which has no stack.yaml configuration, since it doesn't need it, we would get an exception thrown when initiating the first one, as loading the yaml file would fail. This would capture the frame in which this command was executed, which references meta_elements. Therefore, as long as another exception is not thrown, the garbage collector would not be able to clean all the MetaElements.
| * Cleanup internal Loader cache after loading elementsBenjamin Schubert2019-02-133-0/+36
|/
* Merge branch 'tpollard/896' into 'master'Jürg Billeter2019-02-139-17/+242
|\ | | | | | | | | | | | | Optional creation of buildtrees Closes #896 See merge request BuildStream/buildstream!1135
| * Provide configuration for the optional creation of buildtreestpollard/896Tom Pollard2019-02-134-14/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Artifacts can be cached explicitly with an empty `build tree` when built via the cli main options or user config for all or only successful build artifacts. Default behaviour is to still create and cache all expected buildtrees. element.py: _cache_artifact() Check if context for cache_buildtrees has been set to always or failure with a corresponding build result, if not skip attempting to export the build-root. Element types without a build-root are cached with an empty buildtree regardless. Update _stage_sources_at() to warn the user that the buildtree import is empty. tests/integration: Add test to artifact.py for the optional caching of buildtree content from bst build. Rename build-tree.py to shellbuildtrees.py to reflect included test cases, add test for empty buildtree warning and failure option. NEWS: Add entry for new option.
| * _frontend/cli.py: Ensure failed buildtree warning is correctTom Pollard2019-02-131-1/+2
| | | | | | | | | | | | not _cached_sucess() could resolve to true if the element wasn't cached at all. switch to _cached_failure() to ensure condition reflects expected artifact state
| * Add cli main & user conf option for 'cache-buildtrees' contextTom Pollard2019-02-135-2/+24
|/ | | | | | | | | | | | | _context.py: Add cache_buildtrees global user context, the default of which is set to by default to 'always' via the addition of cache-buildtrees to userconfig.yaml cache group. 'failure' & 'never' can be given as valid options. app.py & cli.py: Add --cache-buildtrees as a bst main option, which when passed with a valid option can override the default or user defined context for cache_buildtrees. tests/completions/completions.py: Update for the added flag.
* Merge branch 'juerg/list-all-directories' into 'master'Jürg Billeter2019-02-1333-41/+44
|\ | | | | | | | | Return all directories in list_relative_paths() See merge request BuildStream/buildstream!1139
| * _casbaseddirectory.py: Return all directories in list_relative_paths()Jürg Billeter2019-02-131-4/+4
| | | | | | | | This matches the change in utils.list_relative_paths().
| * utils.py: Return all directories in list_relative_paths()Jürg Billeter2019-02-1315-22/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Returning only empty directories leads to inconsistencies when computing a manifest by combining results from multiple list_relative_paths() calls as done by the compose plugin. I.e., the same directory may be empty in one dependency and non-empty in another dependency. The merged file list will still contain that directory even though it's no longer empty. This inconsistency causes problems when calculating differences between manifests. Returning all directories fixes these inconsistencies. This is a change in API behavior.
| * tests/integration/project: Add tests directory to split ruleJürg Billeter2019-02-131-0/+2
| | | | | | | | | | This is required to fix tests with the following commit that changes list_relative_paths() to return all directories.
| * projectconfig.yaml: Consistently include directories in split rulesJürg Billeter2019-02-1330-29/+35
|/ | | | | | | | | Most split rules already included the relevant directories themselves in addition to the directory contents. Add the missing bin, sbin, and libexec directories. This is required to fix tests with the following commit that changes list_relative_paths() to return all directories.
* Merge branch 'jennis/refactor_artifact_log' into 'master'James Ennis2019-02-1311-200/+375
|\ | | | | | | | | Refactor artifact log command See merge request BuildStream/buildstream!1101
| * _stream.py: _classify_artifacts() should be able to handle globsjennis/refactor_artifact_logJames Ennis2019-02-131-13/+11
| | | | | | | | | | | | | | | | | | _classify_artifacts() no longer filters glob expressions by first obtaining a list of ALL refs locally cached. We now only obtain refs specified by the glob expression. Furthermore, the Project.element_path is used to start searching for globbed elements as opposed to the Project.directory.
| * cascache.py: Allow CASCache.list_refs() to handle globsJames Ennis2019-02-132-7/+24
| | | | | | | | | | This commit ensures that CASCache.list_refs(), and ArtifactCache.list_artifacts(), can both handle glob expressions.
| * cli.py: Remove _classify_artifacts() methodJames Ennis2019-02-131-33/+0
| | | | | | | | This method has been moved to Stream, where is it used there exclusively.
| * cli.py: Move artifact ref handling logic to streamJames Ennis2019-02-132-47/+43
| | | | | | | | | | The loading of elements and the handling of artifacts does not belong in this module. Such logic should be invoked using the Stream API
| * _artifactcache.py: Add get_artifacts_log() methodJames Ennis2019-02-131-0/+17
| | | | | | | | | | | | | | A CasBasedDirectory object of an artifacts logs can be obtained with ArtifactCache.get_artifacts_log(). This ultimately calls CASCache.get_top_level_dir() to obtain a CasBasedDirectory of an artifact's subdirectory (or subdirectories).
| * _stream.py: Allow loading to handle artifact refsJames Ennis2019-02-131-14/+32
| |
| * _stream.py: Modify behaviour of _classify_artifacts()James Ennis2019-02-131-17/+23
| | | | | | | | | | | | * There is no need for this method to use a cas object. * Search for artifact globs in the project's element path * An artifact key is always 64 chars long
| * _stream.py: Add the _classify_artifacts() helperJames Ennis2019-02-131-0/+45
| |
| * _project.py: Add create_artifact_element() methodJames Ennis2019-02-131-0/+14
| |
| * _artifactelement.py: New ArtifactElement object (derived from Element)James Ennis2019-02-132-0/+97
| | | | | | | | | | | | This object should be used when we want to handle artifact refs directly from the command line. An ArtifactElementError has also been added to _exceptions.py
| * metaelement.py: Provide constructor with default keyword argumentsJames Ennis2019-02-131-9/+9
| |
| * element.py: Return early in __init_defaults if no plugin configJames Ennis2019-02-131-0/+2
| |
| * element.py: Make calculate_cache_key() API privateJames Ennis2019-02-131-40/+39
| |
| * element.py: Lift ArtifactCache.get_artifact_fullname() to hereJames Ennis2019-02-134-49/+48
|/ | | | | | | | This commit removes the method ArtifactCache.get_artifact_fullname() and replaces it with Element.get_artifact_name() Given a key, we are now able to construct the full name of any of an element's artifacts.
* Merge branch 'valentindavid/pull-chmod-bug' into 'master'Valentin David2019-02-122-5/+88
|\ | | | | | | | | buildstream/_cas/cascache.py: Set 0644 rights to pulled files See merge request BuildStream/buildstream!1144
| * buildstream/_cas/cascache.py: Set 0644 rights to pulled filesvalentindavid/pull-chmod-bugValentin David2019-02-122-5/+88
|/ | | | This was broken by 5ef19a0b31df84caed1e41719ef7ea5c6bd8a8bc.
* Merge branch 'jonathan/junction-no-tmpdir' into 'master'Jonathan Maw2019-02-122-44/+17
|\ | | | | | | | | | | | | Stage junctions into .bst instead of a tmpdir Closes #895 See merge request BuildStream/buildstream!1134
| * Remove cleanup functionality from loaderJonathan Maw2019-02-122-41/+6
| | | | | | | | | | | | | | | | | | | | | | | | Since junction check-outs are now persistent, there is no need to clean up temporary directories once finished. Now, junction checkouts are stored within the top-level project dir and will be cleaned-up when that directory is removed. This involves changes in: * loader.py: Remove cleanup logic and passing-around of tmpdir. * _project.py: Remove passing around tmpdir and calling loader's cleanup.
| * loader.py: Load junction from workspace if one's openJonathan Maw2019-02-121-1/+6
| |
| * loader.py: Stage junctions into .bst instead of a tmpdirJonathan Maw2019-02-121-4/+7
|/
* Merge branch 'danielsilverstone-ct/further-optimisations' into 'master'Benjamin Schubert2019-02-122-30/+101
|\ | | | | | | | | Further optimisations See merge request BuildStream/buildstream!1131
| * _context.py: Cache result of get_strict()Daniel Silverstone2019-02-121-6/+9
| | | | | | | | | | | | | | | | | | While get_strict() doesn't look expensive per-se, it is called so many times that it is valuable to cache the result once computed. Since I don't think it can change once it is computable, cache it immediately that becomes possible and we save 20s in my test case. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
| * _yaml.py: Reduce cost of node_final_assertionsDaniel Silverstone2019-02-121-5/+13
| | | | | | | | | | | | | | | | | | By re-using the isinstance replacements from earlier commits and using a tuple of the string constants for checking for composition markers, we reduce the cost of node_final_assertions by two thirds in basic testing. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
| * _yaml.py: Remove use of isinstance() in `{node,list}_{chain_,}copy`Daniel Silverstone2019-02-121-15/+57
| | | | | | | | | | | | | | | | A non-trivial proportion of time pre-scheduler in `bst build` is spent copying (or chain-copying) nodes. Approximately a quarter of the time spent in that effort is in `isinstance()`. This removes that CPU load. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>