-
Notifications
You must be signed in to change notification settings - Fork 528
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
[linker] Add metadata to linked assemblies indicating the RID for which they were created #8183
Conversation
...but for now no idea how to get the RID
Converted to draft, because the test failures cannot be fixed without the planned changes to package all assemblies for all RIDs in shared libraries, work that hasn't been started yet. I'm going to keep this PR open and updated as draft, until the other changes are implemented. |
...marin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.ILLink.targets
Outdated
Show resolved
Hide resolved
TypeDefinition systemString = GetSystemString (corlib); | ||
|
||
var attr = new CustomAttribute (assembly.MainModule.ImportReference (assemblyMetadataAttributeCtor)); | ||
attr.ConstructorArguments.Add (new CustomAttributeArgument (systemString, "XamarinAndroidAbi")); // key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we avoid naming things with an XA
or Xamarin
prefix? Can this just be RuntimeIdentifier
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RuntimeIdentifier
is too generic IMO. XA
or XamarinAndroid
makes it less likely to clash with other people's metadata
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or AndroidRuntimeIdentifier
? I don't think they want us to introduce new things that say Xamarin
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who would know? :)
…Microsoft.Android.Sdk.ILLink.targets Co-authored-by: Jonathan Peppers <[email protected]>
With the change from @jonathanpeppers it can actually go in |
* main: LLVM IR code generator refactoring and updates (dotnet#8140) [ci] XA.PublishAllLogs publishes all build logs to build artifacts (dotnet#8189) Bump to xamarin/Java.Interop/main@151b03e (dotnet#8188) [Mono.Android] Use PublicApiAnalyzers to ensure we do not break API. (dotnet#8171) [Xamarin.Android.Build.Tasks] per-RID assemblies & typemaps (dotnet#8164) [AndroidDependenciesTests] Test both manifest types (dotnet#8186) [AndroidDependenciesTests] Use platform-tools 34.0.4 (dotnet#8184)
* main: (68 commits) Bump to dotnet/installer@2809943e7a 8.0.100-rc.2.23431.5 (dotnet#8317) [build] Use Microsoft OpenJDK 17.0.8 (dotnet#8309) [Mono.Android] Add missing `[Flags]` attribute for generated enums. (dotnet#8310) Bump to dotnet/installer@c5e45fd659 8.0.100-rc.2.23427.4 (dotnet#8305) [xaprepare] Improve dotnet-install script logging (dotnet#8312) [xaprepare] Fix dotnet-install script size check (dotnet#8311) [Xamarin.Android.Build.Tasks] improve net6.0 "out of support" message (dotnet#8307) [monodroid] Fix the EnableNativeAnalyzers build (dotnet#8293) Bump to dotnet/installer@56d8c6497c 8.0.100-rc.2.23422.31 (dotnet#8291) [Xamarin.Android.Build.Tasks] Fix APT2264 error on Windows. (dotnet#8289) [Mono.Android] Marshal .NET stack trace to Throwable.getStackTrace() (dotnet#8185) [tests] Skip sign check when installing MAUI (dotnet#8288) Bump to xamarin/monodroid@057b17fe (dotnet#8286) [Xamarin.Android.Build.Tasks] add $(AndroidStripILAfterAOT) (dotnet#8172) Bump to dotnet/installer@ec2c1ec1b1 8.0.100-rc.2.23420.6 (dotnet#8281) Bump to dotnet/installer@001d8e4465 8.0.100-rc.2.23417.14 (dotnet#8276) [Mono.Android] [IntentFilter] pathSuffix & pathAdvancedPattern (dotnet#8261) $(AndroidPackVersionSuffix)=rc.2; net8 is 34.0.0-rc.2 (dotnet#8278) Bump to xamarin/xamarin-android-tools/main@52f0866 (dotnet#8241) [build] set file extension for common `ToolExe` values (dotnet#8267) ...
As a preparation for future effort to properly support per-RID assemblies, this PR
adds a linker step which appends the
AssemblyMetadata
custom attribute to eachassembly, with the key
XamarinAndroidAbi
and its value set to the RID for whichthe assembly was linked.
Right now this metadata is not used, but in the future we plan to put all the
assemblies in per-architecture shared libraries, without any exceptions. This will
be done to ensure that unknown changes made to assemblies by the linker will not
break the application at runtime (since the runtime will not verify and complain
about "platform incompatible" assemblies, it doesn't have any notion of such
assemblies)