[release/5.0-rc2] [WASM] Add satellite assemblies bundle and hook to register them #41828
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.
Backport of #41358 to release/5.0-rc2
/cc @CoffeeFlux @safern
Customer Impact
The tests outlined in #39379 uncovered various issues in our handling of satellite assemblies that would affect customers' abilities to use them. Satellite assemblies were not corrected added to the bundle and instead relied on the VFS to load. Even if added to the bundle, nothing would disambiguate them based on culture. Finally, attempting to load a satellite assembly for two different cultures would return the wrong assembly for the second load.
Testing
This was prompted by a test failure that is now functional, and as part of my investigation to ensure this would be safe to backport an additional test was added to verify the functionality of
LoadFromAssemblyPath.Risk
This makes some significant changes to loader behavior, especially related to how we register satellite assemblies, but this is inevitable given the previous handling was fairly broken. The riskiest component is the changes to
MonoImageregistration, but I went through the code in detail and the tests now cover the various scenarios we care about for wasm, so I think this is unlikely to regress any other part while enabling a previously-broken customer scenario.