Commits on Source 81
-
Daniel Silverstone authored
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>
-
Daniel Silverstone authored
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>
-
Daniel Silverstone authored
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>
-
Daniel Silverstone authored
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>
-
Daniel Silverstone authored
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>
-
Benjamin Schubert authored
Further optimisations See merge request !1131
-
Jonathan Maw authored
-
Jonathan Maw authored
-
Jonathan Maw authored
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.
-
Jonathan Maw authored
Stage junctions into .bst instead of a tmpdir Closes #895 See merge request !1134
-
This was broken by 5ef19a0b.
-
Valentin David authored
buildstream/_cas/cascache.py: Set 0644 rights to pulled files See merge request !1144
-
James Ennis authored
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.
-
James Ennis authored
-
James Ennis authored
-
James Ennis authored
-
James Ennis authored
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
-
James Ennis authored
-
James Ennis authored
-
James Ennis authored
* 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
-
James Ennis authored
-
James Ennis authored
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).
-
James Ennis authored
The loading of elements and the handling of artifacts does not belong in this module. Such logic should be invoked using the Stream API
-
James Ennis authored
This method has been moved to Stream, where is it used there exclusively.
-
James Ennis authored
This commit ensures that CASCache.list_refs(), and ArtifactCache.list_artifacts(), can both handle glob expressions.
-
James Ennis authored
_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.
-
James Ennis authored
Refactor artifact log command See merge request !1101
-
Jürg Billeter authored
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.
-
Jürg Billeter authored
This is required to fix tests with the following commit that changes list_relative_paths() to return all directories.
-
Jürg Billeter authored
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.
-
Jürg Billeter authored
This matches the change in utils.list_relative_paths().
-
Jürg Billeter authored
Return all directories in list_relative_paths() See merge request !1139
-
Tom Pollard authored
_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.
-
Tom Pollard authored
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
-
Tom Pollard authored
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.
-
Jürg Billeter authored
Optional creation of buildtrees Closes #896 See merge request !1135
-
Benjamin Schubert authored
-
Benjamin Schubert authored
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.
-
Benjamin Schubert authored
Cleanup MetaElement local state See merge request !1147
-
Daniel Silverstone authored
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>
-
Tristan Van Berkom authored
Update cache keys to use JSON See merge request !1151
-
Benjamin Schubert authored
We can easily rebiuld MetaSource from any source so there is no reason to keep them around. This will slightly improve memory usage.
-
Tristan Van Berkom authored
Don't keep MetaSource around in Source See merge request !1150
-
Jürg Billeter authored
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.
-
Jürg Billeter authored
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.
-
Jürg Billeter authored
Copy symlinks as they are, absolute or relative. We no longer resolve symlinks when copying files, which makes this safe.
-
Jürg Billeter authored
-
Jürg Billeter authored
-
Jürg Billeter authored
Do not resolve or mangle symlinks during staging See merge request !1140
-
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.
-
Chandan Singh authored
contrib/bst-graph: Add script to print graph in DOT format Closes #705 See merge request !1148
-
Daniel Silverstone authored
Rather than constantly using regular expressions and retrieval from YAML nodes, pre-parse expansion strings into a list representation cached for reuse, and then expand them as simple string concatenation. Signed-off-by:
Daniel Silverstone <daniel.silverstone@codethink.co.uk>
-
Benjamin Schubert authored
Variables: Rework how expansion strings work See merge request !1152
-
Change the default value of mtime when doing export_to_tar() from `0` to `_utils._magic_timestamp`. This avoids problems in other software, which assume that an mtime of `0` means the file does not exist. There is more than one example where files with an mtime of zero are treated as non-existant by other software. e.g. [ninja][1] and [Template Toolkit][2]. The OSTree project also [express an intention][3] to move from an mtime of 0 to an mtime of 1: > For this reason, OSTree acts as though all timestamps are set to > time_t 0, so that comparisons will be considered up-to-date. Note that > for a few releases, OSTree used 1 to fix warnings such as GNU Tar > emitting "implausibly old time stamp" with 0; however, until we have a > mechanism to transition cleanly to 1, for compatibilty OSTree is > reverted to use zero again. From the comments on export_to_tar(), the motivation for having an mtime of 0 was to have reproducible results, rather than it specifically being the value 0. Additionally, the reproducible builds project has a [page on archives][4]; it mentions the benefits of setting all the files to have the same mtime, or clamping the mtime. It makes no mention of a motivation for the mtime to be specifically 0. Fixes #914 [1]: https://github.com/ninja-build/ninja/issues/1120 [2]: https://github.com/abw/Template2/blob/8d7d37200af436f1ad43628278d3caad257c8e27/lib/Template/Provider.pm#L635 [3]: https://ostree.readthedocs.io/en/latest/manual/repo/ [4]: https://reproducible-builds.org/docs/archives/
-
Angelos Evripiotis authored
storage.Directory.export_to_tar: default mtime=utils._magic_timestamp Closes #914 See merge request !1149
-
Benjamin Schubert authored
-
Benjamin Schubert authored
Use sets when checking for existence of an element See merge request !1154
-
Remove the need for the 'really-workspace-close-project-inaccessible' config option, as well as the option itself. As agreed on the mailing list [1], all the 'are you sure?' prompts on workspace reset and close were removed. While that discussion was going on, this new prompt and option was added. At the 2019 BuildStream Gathering, it was verbally agreed between myself and Tristan VB that we would also remove this instance. It was also agreed that we should have a notice to let the user know what they'd done, this was already in place if interactive. Moved it to be unconditional so that there's no difference in non-interactive behaviour. Made it output to stderr, as it's diagnostic meant for the user. Made it the last thing echo'd so it's next to the prompt - it's very relevant to what they type next. Added a test to make sure the text makes it to stderr in the appropriate case, and not in an inappropriate one. This is the last instance of any prompt configuration, so BuildStream can also forget all of that machinery. [1] https://mail.gnome.org/archives/buildstream-list/2018-December/msg00111.html
-
Angelos Evripiotis authored
userconfig: rm really-workspace-close-project-inaccessible Closes #726 and #744 See merge request !1130
-
Chandan Singh authored
See buildstream-docker-images#26 for detailed discussion around this. `buildstream/buildstream-fedora` is now considered deprecated. Switch to `buildstream/buildstream` image. This image also offers more tags that will provide users more flexibility.
-
Chandan Singh authored
Now that the `buildstream/buildstream` image has 9 variants, let's make it easier to choose the desired tag, using a command-line option. This is otherwise possible by specifying the full image name `image:tag` using the `-i` option. But, this will make it easier to specify just the tag using `-j`. The following two invocations of `bst-here` are now equivalent: bst-here -i buildstream/buildstream:dev bst-here -j dev
-
Chandan Singh authored
contrib/bst-here: Allow users to specify image variant See merge request !1153
-
Javier Jardón authored
[ci skip]
-
Javier Jardón authored
README.rst: Add table with distros with packaged buildstream See merge request !1143
-
Tristan Van Berkom authored
So that other people can also make releases.
-
Tristan Van Berkom authored
CONTRIBUTING.rst: Documenting the release process See merge request !1155
-
Jürg Billeter authored
The directory needs to be serialized after the Digest for the subdirectory `caller` has been updated.
-
-
Jürg Billeter authored
-
-
Jürg Billeter authored
-
Jürg Billeter authored
ArtifactCache.commit() is no longer the only expensive part and even more so with the upcoming change to use CASBasedDirectory.
-
-
Jürg Billeter authored
Cache artifacts with virtual directories instead of filesystem. Closes #787 See merge request !991
-
Chandan Singh authored
Having `pkg-resources` in requirements files is never the right thing as it is not really a package that one can install. This is basically an artifact of Debian-based systems providing incorrect metadata to pip. See [this pip issue](https://github.com/pypa/pip/issues/4022) and [this Ubuntu issue](https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1635463) for more background.
-
Tristan Van Berkom authored
requirements/Makefile: exclude pkg-resources Closes #918 See merge request !1156
-
The test jobs which create coverage reports need to be listed in the dependencies of the coverage job, as highlighted in issue #356.
-
Tristan Van Berkom authored
.gitlab-ci.yml: Some new test environments were added, but not collecting coverage. See merge request !1157
-
Chandan Singh authored
This will allow cross-junction dependencies to be listed as strings on a single line. As part of this, some logic around initializing `Dependency()` objects have been moved out of `_extract_depends_from_node()` method into the constructor of `Dependency()` class, to keep all related code in one place. * _loader/types.py: While initializing `Dependency` objects, attempt to split filenames, only if no `junction` was specified explicitly. If a `junction` was specified, then filenames with `:` in their names will result in an error. * _loader/loadelement.py: Refactor logic to initialize `Dependency()` objects to move it to the `Dependency()` constructor. * tests/frontend/buildcheckout.py: Add tests to ensure the above. * _versions.py: Bump BST_FORMAT_VERSION. Fixes #809.
-
Chandan Singh authored
-
Chandan Singh authored
In the previous commit, we added support to express cross-junction dependencies inline as simple strings. Document it along with the version in which the feature was added.