Daniel pushed to branch danielsilverstone-ct/report-loop at BuildStream / buildstream
Commits:
-
edc07536
by Tiago Gomes at 2018-10-17T13:49:15Z
-
155296a7
by Tiago Gomes at 2018-10-17T13:49:15Z
-
131f95eb
by Tiago Gomes at 2018-10-17T14:15:38Z
-
c327d1f3
by Valentin David at 2018-10-17T14:33:40Z
-
eeb334f2
by Javier Jardón at 2018-10-17T15:03:17Z
-
b8f69946
by Daniel Silverstone at 2018-10-18T09:32:09Z
10 changed files:
- README.rst
- buildstream/_loader/loader.py
- doc/examples/autotools/project.conf
- doc/examples/developing/project.conf
- doc/examples/integration-commands/project.conf
- doc/examples/junctions/autotools/project.conf
- doc/examples/running-commands/project.conf
- setup.py
- tests/integration/project/project.conf
- tests/loader/dependencies.py
Changes:
1 | 1 |
About
|
2 | 2 |
-----
|
3 | 3 |
|
4 |
-.. image:: https://buildstream.gitlab.io/buildstream/_static/release.svg
|
|
4 |
+.. image:: https://docs.buildstream.build/_static/release.svg
|
|
5 | 5 |
:target: https://gitlab.com/BuildStream/buildstream/commits/bst-1.2
|
6 | 6 |
|
7 |
-.. image:: https://buildstream.gitlab.io/buildstream/_static/snapshot.svg
|
|
7 |
+.. image:: https://docs.buildstream.build/_static/snapshot.svg
|
|
8 | 8 |
:target: https://gitlab.com/BuildStream/buildstream/commits/master
|
9 | 9 |
|
10 | 10 |
.. image:: https://gitlab.com/BuildStream/buildstream/badges/master/pipeline.svg
|
... | ... | @@ -63,7 +63,7 @@ BuildStream offers the following advantages: |
63 | 63 |
|
64 | 64 |
How do I use BuildStream?
|
65 | 65 |
=========================
|
66 |
-Please refer to the `documentation <https://buildstream.gitlab.io/buildstream/>`_
|
|
66 |
+Please refer to the `documentation <https://docs.buildstream.build>`_
|
|
67 | 67 |
for information about installing BuildStream, and about the BuildStream YAML format
|
68 | 68 |
and plugin options.
|
69 | 69 |
|
... | ... | @@ -86,9 +86,9 @@ BuildStream operates on a set of YAML files (.bst files), as follows: |
86 | 86 |
How can I get started?
|
87 | 87 |
======================
|
88 | 88 |
To get started, first `install BuildStream by following the installation guide
|
89 |
-<https://buildstream.gitlab.io/buildstream/main_install.html>`_
|
|
89 |
+<https://buildstream.build/install.html>`_
|
|
90 | 90 |
and then follow our tutorial in the
|
91 |
-`user guide <https://buildstream.gitlab.io/buildstream/main_using.html>`_.
|
|
91 |
+`user guide <https://docs.buildstream.build/main_using.html>`_.
|
|
92 | 92 |
|
93 | 93 |
We also recommend exploring some existing BuildStream projects:
|
94 | 94 |
|
... | ... | @@ -296,12 +296,14 @@ class Loader(): |
296 | 296 |
# Raises:
|
297 | 297 |
# (LoadError): In case there was a circular dependency error
|
298 | 298 |
#
|
299 |
- def _check_circular_deps(self, element_name, check_elements=None, validated=None):
|
|
299 |
+ def _check_circular_deps(self, element_name, check_elements=None, validated=None, sequence=None):
|
|
300 | 300 |
|
301 | 301 |
if check_elements is None:
|
302 | 302 |
check_elements = {}
|
303 | 303 |
if validated is None:
|
304 | 304 |
validated = {}
|
305 |
+ if sequence is None:
|
|
306 |
+ sequence = []
|
|
305 | 307 |
|
306 | 308 |
element = self._elements[element_name]
|
307 | 309 |
|
... | ... | @@ -314,16 +316,24 @@ class Loader(): |
314 | 316 |
return
|
315 | 317 |
|
316 | 318 |
if check_elements.get(element_name) is not None:
|
319 |
+ # Create `chain`, the loop of element dependencies from this
|
|
320 |
+ # element back to itself, by trimming everything before this
|
|
321 |
+ # element from the sequence under consideration.
|
|
322 |
+ chain = sequence[sequence.index(element_name):]
|
|
323 |
+ chain.append(element_name)
|
|
317 | 324 |
raise LoadError(LoadErrorReason.CIRCULAR_DEPENDENCY,
|
318 |
- "Circular dependency detected for element: {}"
|
|
319 |
- .format(element.name))
|
|
325 |
+ ("Circular dependency detected at element: {}\n" +
|
|
326 |
+ "Dependency chain: {}")
|
|
327 |
+ .format(element.name, " -> ".join(chain)))
|
|
320 | 328 |
|
321 | 329 |
# Push / Check each dependency / Pop
|
322 | 330 |
check_elements[element_name] = True
|
331 |
+ sequence.append(element_name)
|
|
323 | 332 |
for dep in element.deps:
|
324 | 333 |
loader = self._get_loader_for_dep(dep)
|
325 |
- loader._check_circular_deps(dep.name, check_elements, validated)
|
|
334 |
+ loader._check_circular_deps(dep.name, check_elements, validated, sequence)
|
|
326 | 335 |
del check_elements[element_name]
|
336 |
+ sequence.pop()
|
|
327 | 337 |
|
328 | 338 |
# Eliminate duplicate paths
|
329 | 339 |
validated[element_name] = True
|
... | ... | @@ -9,5 +9,5 @@ element-path: elements |
9 | 9 |
|
10 | 10 |
# Define some aliases for the tarballs we download
|
11 | 11 |
aliases:
|
12 |
- alpine: https://gnome7.codethink.co.uk/tarballs/
|
|
12 |
+ alpine: https://bst-integration-test-images.ams3.cdn.digitaloceanspaces.com/
|
|
13 | 13 |
gnu: http://ftpmirror.gnu.org/gnu/automake/
|
... | ... | @@ -9,4 +9,4 @@ element-path: elements |
9 | 9 |
|
10 | 10 |
# Define an alias for our alpine tarball
|
11 | 11 |
aliases:
|
12 |
- alpine: https://gnome7.codethink.co.uk/tarballs/
|
|
12 |
+ alpine: https://bst-integration-test-images.ams3.cdn.digitaloceanspaces.com/
|
... | ... | @@ -9,4 +9,4 @@ element-path: elements |
9 | 9 |
|
10 | 10 |
# Define an alias for our alpine tarball
|
11 | 11 |
aliases:
|
12 |
- alpine: https://gnome7.codethink.co.uk/tarballs/
|
|
12 |
+ alpine: https://bst-integration-test-images.ams3.cdn.digitaloceanspaces.com/
|
... | ... | @@ -9,5 +9,5 @@ element-path: elements |
9 | 9 |
|
10 | 10 |
# Define some aliases for the tarballs we download
|
11 | 11 |
aliases:
|
12 |
- alpine: https://gnome7.codethink.co.uk/tarballs/
|
|
12 |
+ alpine: https://bst-integration-test-images.ams3.cdn.digitaloceanspaces.com/
|
|
13 | 13 |
gnu: https://ftpmirror.gnu.org/gnu/automake/
|
... | ... | @@ -9,4 +9,4 @@ element-path: elements |
9 | 9 |
|
10 | 10 |
# Define an alias for our alpine tarball
|
11 | 11 |
aliases:
|
12 |
- alpine: https://gnome7.codethink.co.uk/tarballs/
|
|
12 |
+ alpine: https://bst-integration-test-images.ams3.cdn.digitaloceanspaces.com/
|
... | ... | @@ -269,7 +269,7 @@ setup(name='BuildStream', |
269 | 269 |
url='https://buildstream.build',
|
270 | 270 |
project_urls={
|
271 | 271 |
'Source': 'https://gitlab.com/BuildStream/buildstream',
|
272 |
- 'Documentation': 'https://buildstream.gitlab.io/buildstream/',
|
|
272 |
+ 'Documentation': 'https://docs.buildstream.build',
|
|
273 | 273 |
'Tracker': 'https://gitlab.com/BuildStream/buildstream/issues',
|
274 | 274 |
'Mailing List': 'https://mail.gnome.org/mailman/listinfo/buildstream-list'
|
275 | 275 |
},
|
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 |
name: test
|
3 | 3 |
element-path: elements
|
4 | 4 |
aliases:
|
5 |
- alpine: https://gnome7.codethink.co.uk/tarballs/
|
|
5 |
+ alpine: https://bst-integration-test-images.ams3.cdn.digitaloceanspaces.com/
|
|
6 | 6 |
project_dir: file://{project_dir}
|
7 | 7 |
options:
|
8 | 8 |
linux:
|
... | ... | @@ -110,6 +110,7 @@ def test_circular_dependency(datafiles): |
110 | 110 |
element = loader.load(['elements/circulartarget.bst'])[0]
|
111 | 111 |
|
112 | 112 |
assert (exc.value.reason == LoadErrorReason.CIRCULAR_DEPENDENCY)
|
113 |
+ assert ("seconddep" in exc.value.args[0])
|
|
113 | 114 |
|
114 | 115 |
|
115 | 116 |
@pytest.mark.datafiles(DATA_DIR)
|