Zenject icon indicating copy to clipboard operation
Zenject copied to clipboard

Disabling Reflection Baking does not stop UWP warnings

Open NoTuxNoBux opened this issue 4 years ago • 3 comments

Describe the bug Reflection baking shows warnings about it not being supported are displayed on UWP, even when it is disabled entirely.

To Reproduce

  1. Switch the build settings to target UWP.
  2. Ensure reflection baking is disabled in the settings, through Assets -> Create -> Zenject -> Reflection Baking Settings and uncheck "Is Enabled In Builds" and "Is Enabled In Editor".
  3. Observe warnings on every script recompilation, despite is being disabled:
Zenject reflection baking skipped because it is not currently supported on WSA platform!
UnityEngine.Debug:LogWarning(Object)
ModestTree.Log:Warn(String, Object[]) (at Library/PackageCache/com.svermeulen.extenject@c2e33500a8/Source/Internal/Log.cs:38)
Zenject.ReflectionBaking.ReflectionBakingBuildObserver:OnAssemblyCompiled(String, CompilerMessage[]) (at Library/PackageCache/com.svermeulen.extenject@c2e33500a8/OptionalExtras/ReflectionBaking/Unity/ReflectionBakingBuildObserver.cs:33)
UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:TickCompilationPipeline(EditorScriptCompilationOptions, BuildTargetGroup, BuildTarget)

Expected behavior No warnings are shown, as reflection baking is disabled.

They should only be displayed if it is enabled and baking cannot be performed because the target platform does not support it.

Extenject and Unity info (please complete the following information):

  • Zenject version: 9.2.0.
  • Unity version: 2019.4.18f1
  • Project's scripting backend [e.g. Mono/IL2CPP]: IL2CPP

Additional context ReflectionBakingBuildObserver seems to read ZenjectReflectionBakingSettings but does not read IsEnabledInEditor or IsEnabledInBuilds. Instead, it just always displays a warning on UWP, no matter whether it's enabled or not.

Alternatively, being able to uninstall the optional reflection baking extension would also solve this, but this requires #24 and an optional package per optional extra.

NoTuxNoBux avatar Jan 18 '21 13:01 NoTuxNoBux

I realize this is off topic, but I can’t find any explanation for why baking isn’t supported on WSA. Is there any record of why this can’t be done or what work would need to be done to add baking?

FreakTheMighty avatar Sep 14 '21 00:09 FreakTheMighty

I'd also like to know why this isn't supported. Is it any different than other IL2CPP-only build targets? Is it due to winmd support being special or something else entirely?

Holo-Krzysztof avatar Nov 26 '21 10:11 Holo-Krzysztof

@Holo-Krzysztof I recently just commented out the warning/exit from the baking function and managed to build and run with baking on. I haven't done much more investigation, but it wasn't obviously broken. 🤷

FreakTheMighty avatar Nov 29 '21 19:11 FreakTheMighty