Fix circular reference errors with junction overrides#2114
Open
Fix circular reference errors with junction overrides#2114
Conversation
Different behavior for `provenance_node is None` is not ideal. And since commit 07a1e45 ("Ensure that the parent project is fully loaded..."), it's no longer needed.
Shallow override loading is needed only to discover link elements for correct link resolution. Defer loading of elements that require the project to be fully loaded, as second pass loading during shallow override loading can trigger a circular reference error. Fixes #2037.
This commit adds an additional level of nesting to a copy of the
override-self buildstream test project by a new subproject and moving
the self-junction into the subproject.
Both the `link.bst` and the `nested-link.bst` elements point to the
subproject's `target.bst` element but `nested-link.bst` does so via the
self-junction, hence the "nesting".
Running `bst show --deps none nested-link.bst` in the directory
`tests/format/junctions/override-self-link` gives the following output:
```
20:17:48 --:--:-- main:core activity START Loading elements
20:17:48 00:00:00 main:core activity FAILURE Loading elements
project.conf [line 6 column 2]: Circular reference while searching for 'subproject.bst:self-junction.bst'
Already searching for 'subproject.bst:self-junction.bst' at: nested-link.bst [line 4 column 10]
```
This creates a variant of the include-complex test project where the
subproject is moved into a new intermediate project and the
subproject.bst junction element is replaced by a link element. Including
a file from a nested junction via a link element in the top level
project.conf file tests more code paths in the loader.
This change shows a bug in the loader, running `bst show --deps none
target.bst` in the `tests/format/junctions/include-complex-nested`
directory gives the following output:
```
20:02:32 --:--:-- main:core activity START Loading elements
20:02:32 00:00:00 main:core activity FAILURE Loading elements
intermediate-project.bst:project.conf [line 5 column 2]: Circular reference while searching for 'subproject.bst'
Already searching for 'subproject.bst' at: subproject.bst [line 4 column 10]
```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2037 and #2118.