Open PureWeen opened 5 years ago
sounds like the cache is not updated when an assembly is no longer needed (so an old copy might still be present and copied to the .app) c.c. @rolfbjarne
Yes, this is how we currently behave, we don't keep track of assemblies that aren't included in the build anymore, so we don't know whether they should be deleted or not from the .app during incremental builds.
- rebuild ios app
I think you meant Build (or Run / Debug) but not Rebuild since
A rebuild is required in order for the dll that's no longer referenced in code to not be included with the app
After a rebuild the file is missing. The sample still crash but with a FileNotFoundException
(which is fine / expected) instead of
2019-02-12 11:18:51.480 PreserveTest.iOS[31158:15239321] error: Failed to load AOT module '/private/var/containers/Bundle/Application/2D306001-22BA-4F6C-B409-1AEB9FD41DF3/PreserveTest.iOS.app/ExtraLibrary.dll.so' in aot-only mode.
It's an old bug and was not an issue since Assembly.Load
is not something commonly used (not really needed) with full AOT builds. Also final/submitted builds are generally done from clean builds (different configs) so it likely never happened on release/appstore builds.
Now those assumptions are changing with the interpreter so thanks for noticing and reporting it :)
Steps to Reproduce
Make sure to have linking turned off
Expected Behavior
Behavior before rebuild should be the same as after rebuild
Actual Behavior
A rebuild is required in order for the dll that's no longer referenced in code to not be included with the app
Environment
Example Project (If Possible)
PreserveTest.zip