Hey!
When testing the 5.6 branch, I came across a weird error, where the OnlineSubsystemSteam module failed to load because its plugin dependency SteamShared wasn’t loaded.
My uproject has a mandatory dependency on a uplugin, which in turn depends OnlineSubsystemSteam, which correctly marks SteamShared as a plugin dependency.
After debugging, it turns out that the plugin was marked disabled because EOSShared.uplugin indicated SteamShared as “Enabled”: false, by this commit: https://github.com/EpicGames/UnrealEngine/commit/77521afaaadb7c0171e13843428be4e402c2bcbb
Now I would have expected that the plugin dependency lookup to sort this inconsitency, and to enable the plugin, but it doesn’t, and that is caused by the loop in FPluginManager::ConfigureEnabledPluginForTarget.
The code here https://github.com/EpicGames/UnrealEngine/blob/803688920e030c9a86c3659ac986030fba963833/Engine/Source/Runtime/Projects/Private/PluginManager.cpp\#L2379 goes like this:
- When iterating EOSShared plugin dependencies, it adds SteamShared to NewPluginQueue and SeenPlugins, with the reference descriptor that is associated to EOSShared that says that SteamShared is disabled
- When the for loop reaches SteamShared, it ignores it, and doesn’t add it to EnabledPlugins (which is correct)
- When my plugin is found, it adds OnlineSubsystemSteam to NewPluginQueue and SeenPlugins
- When OnlineSubsystemSteam is reached by the for loop, and its dependencies are read, SteamShared is not added again to the NewPluginQueue list, because of the bIsNewlySeen being false: https://github.com/EpicGames/UnrealEngine/blob/803688920e030c9a86c3659ac986030fba963833/Engine/Source/Runtime/Projects/Private/PluginManager.cpp\#L2549
This causes the dependency to be missing, and the error on startup.
As a fix, I’ve commented out the test of bIsNewlySeen to force reconsidering the dependency and it works fine:
// UE_5_6_DIFF - re-add the plugin even if already seen, as it could have been added disabled by another plugin if (!EnabledPlugins.Contains(NextReference.Name)/* && bIsNewlySeen*/) // ~UE_5_6_DIFF { NewPluginQueue.Add(&NextReference); }
Would be great to see this fixed upstream.
Thanks,
Lambert