-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The same assembly is loaded multiple times if it passed as multiple --custom-step arguments #1314
Labels
Milestone
Comments
61 tasks
rolfbjarne
added a commit
to rolfbjarne/xamarin-macios
that referenced
this issue
Jul 23, 2020
The linker will load the assemblies with the custom steps once per custom step argument, which means that each step is effectively in a different assembly, making it impossible to share state between steps. This behavior is filed as a linker bug: dotnet/linker#1314 Until this is fixed, we can just have a single step that injects all the other steps programmatically.
rolfbjarne
added a commit
to xamarin/xamarin-macios
that referenced
this issue
Jul 24, 2020
* [dotnet] Only pass a single custom step to the linker. The linker will load the assemblies with the custom steps once per custom step argument, which means that each step is effectively in a different assembly, making it impossible to share state between steps. This behavior is filed as a linker bug: dotnet/linker#1314 Until this is fixed, we can just have a single step that injects all the other steps programmatically. * [tests] Adjust .NET tests according to new behavior.
Another effect of loading the custom step assembly as a byte array is that no debug information will be loaded, so stack traces won't include source code information (not even if the embedding the debug information in the dll), and neither is it possible to debug using VSCode. |
This was referenced Apr 9, 2021
21 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The same assembly is loaded once for each --custom-step argument.
My guess is because it's loaded using the
Assembly.Load(byte[])
overload: https://github.com/mono/linker/blob/da2cc0fcd6c3a8e8e5d1b5d4a655f3653baa8980/src/linker/Linker/Driver.cs#L723This is quite confusing if you have static state in one step you expect to be around in subsequent steps (it also means that if I want to share state between steps, I have to resort to ugly workarounds.
The text was updated successfully, but these errors were encountered: