feature: Improve dependency-cycle error to show the cycle - #11519
Merged
memsharded merged 3 commits intoJun 28, 2022
Merged
Conversation
Original message isn't help when diagnosing problems with a recipe...
Now it will print out all the X->Y dependencies that remain after the
irrelevant components have been eliminated.
Within that list will be the problematic cycle.
For example, as a test I introduced a cycle into my prototype VTK recipe,
I added:
self.cpp_info.components["vtksys"].requires.append("CommonDataModel")
The cycle would be:
vtksys -> CommonDataModel -> CommonCore -> vtksys
The message was a bit more verbose than that, but enough to be helpful:
ERROR: There is a dependency loop in 'self.cpp_info.components' requires:
CommonTransforms requires CommonMath
CommonDataModel requires CommonCore
CommonMath requires CommonCore
CommonCore requires vtksys
CommonTransforms requires CommonCore
CommonCore requires kwiml
CommonDataModel requires CommonMath
vtksys requires CommonDataModel
CommonDataModel requires CommonTransforms
CommonMath requires kissfft
memsharded
reviewed
Jun 24, 2022
memsharded
left a comment
Member
There was a problem hiding this comment.
This seems a helpful addition of error message.
It would be necessary to add an integration test, please try to add it, or ask for help or guidance if you need it.
Contributor
Author
|
@memsharded I had a look, and while I could probably figure it out with time, I'm a low on time. I'd want to test that it outputs an error message with an expected error. Error message (ignoring all the CCI hook errors I see): How would I implement such a test? |
Member
|
Thanks, that is enough, I'll add the test for you. |
lasote
approved these changes
Jun 28, 2022
Member
|
Thanks very much for your contribution! |
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.
Changelog: Feature: Improve dependency-cycle error to show the cycle.
Docs: Omit
Original message isn't help when diagnosing problems with a recipe...
Now it will print out all the X->Y dependencies that remain after the
irrelevant components have been eliminated.
Within that list will be the problematic cycle.
For example, as a test I introduced a cycle into my prototype VTK recipe,
I added:
self.cpp_info.components["vtksys"].requires.append("CommonDataModel")The cycle would be:
vtksys -> CommonDataModel -> CommonCore -> vtksysThe message was a bit more verbose than that, but enough to be helpful:
developbranch, documenting this one.