The `GetOptions` function for adding plugin dependencies (UPluginMetadataObject::GetAvailablePluginDependencies) only checks direct dependencies (this seems to be a known issue called out in the code).
As an example, if you had `A -> B -> C`, you would be able to add `C -> A` as a dependency, despite the fact that doing so would introduce a circular dependency and cause build failures.
I was able to update the function locally to properly cull deeply circular dependencies. It’s a bit slower (due to the greater complexity of the search), but could definitely be optimized further. Would this be something it might make sense to upstream?
[Attachment Removed]
Steps to Reproduce
- Have a plugin dependency chain with at least 3 plugins: A -> B -> C
- Try and add C -> B as a dependency. B correctly is excluded from the dropdown, preventing the addition.
- Try and add C -> A as a dependency. A appears in the dropdown and can be added.
- Adding C -> A causes the editor to no longer build or launch correctly, due to the circular dependency.
I’m not going to bother providing a repro project, as a code comment in UPluginMetadataObject::GetAvailablePluginDependencies indicates that this behavior is a known issue.
[Attachment Removed]
Hi,
It looks like this basic dependency check was added some time ago and never really expanded on, so we could probably make it more robust as long as it doesn’t have too negative of a performance impact. I’d be happy to have a look at your changes and see if that’s something we can bring into the engine; a Github PR is the best way to go typically (especially if it’s a big change) but you can also share snippets here if that’s simpler. Let me know if you do send in a Github PR and I’ll flag it with the relevant team.
Best,
Cody
[Attachment Removed]
Hi Cody!
I’ve created a PR (first time trying to contribute to Unreal, so hopefully I did it right).
https://github.com/EpicGames/UnrealEngine/pull/14887
Thanks,
Jonathan
[Attachment Removed]
Perfect, I’ve linked our internal tracking to this ticket so that the team reviewing that change will have all the context. You should receive updates on the PR directly once the team has had a chance to review that change.
Best,
Cody
[Attachment Removed]