summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* _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>
| * _yaml.py: Reduce use of `isinstance()` in `node_sanitize()`Daniel Silverstone2019-02-121-3/+21
| | | | | | | | | | | | | | | | | | | | We know that nodes are typically one of: str, list, dict, bool, tuple, NoneType or our ChainMap Of these, dict and ChainMap are Mapping, only list is list and the rest are returned unchanged. We can reduce/defer our use of isinstance here, dramatically, improving performance. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
| * _yaml.py: Only retrieve provenance in node_get() when neededDaniel Silverstone2019-02-121-1/+1
|/ | | | | | | | | | We were indiscriminately retrieving the node's provenance data in the `node_get()` function which was accounting for approximately a third of the total runtime of `node_get()` which dominates pre-scheduler time in `bst build`. This change ameliorates that situation by only retrieving the provenance data when it's actually needed. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
* Merge branch 'jjardon/fedora_29' into 'master'Javier Jardón2019-02-121-15/+10
|\ | | | | | | | | .gitlab-ci.yml: Test with current fedora release: 29 See merge request BuildStream/buildstream!1137
| * .gitlab-ci.yml: Remove "tests-python-3.7-stretch" jobJavier Jardón2019-02-121-10/+0
| | | | | | | | Fedora 29 includes python 3.7 so this is not needed anymore
| * .gitlab-ci.yml: run all generic fedora test in current stable version:29Javier Jardón2019-02-121-5/+5
| |
| * .gitlab-ci.yml: Add job to run test in current Fedora:29Javier Jardón2019-02-121-0/+5
|/
* Merge branch 'chandan/deps' into 'master'Chandan Singh2019-02-1224-22/+77
|\ | | | | | | | | | | | | _frontend: Allow printing dependencies using `bst show` Closes #890 See merge request BuildStream/buildstream!1121
| * Re-generate man pageschandan/depsChandan Singh2019-02-1221-21/+27
| |
| * _frontend: Allow printing dependencies using `bst show`Chandan Singh2019-02-123-1/+50
|/ | | | | | | | | | | | | | | | | | At present, there isn't an easy way to print anything from `bst show` that would give the users an idea of what the dependency graph looks like. One could use things like `--deps build`, but that will just print a list, without any information about the dependency edges. Add `%{deps}`, `%{build-deps}` and `%{runtime-deps}` format strings to `bst show` that would simply print the list of all dependencies, build dependencies and runtime dependencies respectively. Summary of changes: * buildstream/_frontend/cli.py: Add help for new format symbols. * buildstream/_frontend/widget.py: Add support for new format symbols for dependencies. * tests/frontend/show.py: Add tests for new format symbols.
* Merge branch 'juerg/buffer-size' into 'master'Jürg Billeter2019-02-122-3/+5
|\ | | | | | | | | Increase read buffer size to improve performance See merge request BuildStream/buildstream!1142
| * _cas/cascache.py: Increase buffer size in add_object()Jürg Billeter2019-02-121-2/+4
| | | | | | | | | | Increasing buffer size from 4 kB to 64 kB speeds up read() bandwidth by factor 4, according to a very simple benchmark.
| * utils.py: Increase buffer size in sha256sum()Jürg Billeter2019-02-121-1/+1
|/ | | | | Increasing buffer size from 4 kB to 64 kB speeds up read() bandwidth by factor 4, according to a very simple benchmark.
* Merge branch 'jjardon/allow_fail_WSL' into 'master'Jürg Billeter2019-02-111-0/+1
|\ | | | | | | | | .gitlab-ci.yml: allow "test-wsl" to fail until runner problems are sorted out See merge request BuildStream/buildstream!1145
| * .gitlab-ci.yml: Do not automatically run "test-wsl" until runner problems ↵jjardon/allow_fail_WSLJavier Jardón2019-02-111-0/+1
|/ | | | are sorted out
* Merge branch 'aevri/include-error' into 'master'Jürg Billeter2019-02-112-11/+68
|\ | | | | | | | | More user-friendly reporting on include errors See merge request BuildStream/buildstream!891
| * tests/format/include: remove unused tmpdir'saevri/include-errorAngelos Evripiotis2019-02-111-6/+6
| | | | | | | | | | Don't create and remove temp dirs unnecessarily when they are not used, looks like these were just copy-pastes without intended side-effects.
| * _includes: re-use file_path variableAngelos Evripiotis2019-02-111-1/+1
| | | | | | | | Avoid an unnecessary call to os.path.join().
| * _includes: better error on including directoryAngelos Evripiotis2019-02-112-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, include a directory result in an error like this: mydir is a directory. bst command expects a .bst file. Note that the file containing the include was not mentioned. Now we get an error like this instead: element.bst [line 12 column 0]: Include block references a directory instead of a file: 'mydir'.
| * _includes: better error on missing includeAngelos Evripiotis2019-02-112-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, a missing include would result in an error like this: Could not find file at not-a-file.include Note that the file containing the include was not mentioned. Now we get an error like this instead: element.bst [line 7 column 5]: Include block references a file that could not be found: 'not-a-file.include'.
| * _includes: better provenance on recursive includeAngelos Evripiotis2019-02-112-3/+6
|/ | | | Use the provenance of the include block, instead of the whole node.
* Merge branch 'snakeviz' into 'master'Jürg Billeter2019-02-111-18/+5
|\ | | | | | | | | contributing: snakeviz replaces pyflame+flamegraph See merge request BuildStream/buildstream!1129
| * contributing: snakeviz replaces pyflame+flamegraphsnakevizAngelos Evripiotis2019-02-111-18/+5
|/ | | | | | | | | | | | | Replace the instructions for pyflame+flamegraph with simpler ones for snakeviz. For our general use-case this seems to be easier and better. Usage of this tool was demonstrated at the 2019 BuildStream Gathering in January by Daniel Silverstone, when presenting the aggregate results of profiling on many target environments. Here is the relevant mailing list thread: "Profiling before the gathering" https://mail.gnome.org/archives/buildstream-list/2019-January/msg00057.html
* Merge branch 'juerg/symlinks' into 'master'Jürg Billeter2019-02-115-38/+43
|\ | | | | | | | | Symlink fixes See merge request BuildStream/buildstream!1138
| * tests/sources/local.py: Add directory symlink testJürg Billeter2019-02-111-0/+20
| |
| * _casbaseddirectory.py: Do not mimic os.walk() in list_relative_paths()Jürg Billeter2019-02-111-14/+1
| | | | | | | | | | | | This matches the change in utils.list_relative_paths() that now sorts all symlinks as files, instead of following the broken behavior of os.walk().
| * utils.py: Fix sorting of symlinks to directoriesJürg Billeter2019-02-111-13/+13
| | | | | | | | | | | | | | | | | | os.walk() resolves symlinks to check whether they point to a directory even when followlinks is set to False. We already work around that broken behavior by extracting symlinks from `dirnames`. However, the sort order was still incorrect as we returned symlinks in dirnames before files and other symlinks. This change fixes this, sorting all files and symlinks in a single list.