Skip to content
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

error MM0099: Can't create a token reference to an unregistered type when using the managed static registrar: LinkAll.LinkAllRegressionTest/ProtocolWithGenericsInOptionalMemberWrapper #18973

Closed
rolfbjarne opened this issue Sep 8, 2023 · 1 comment · Fixed by #19031
Labels
bug If an issue is a bug or a pull request a bug fix
Milestone

Comments

@rolfbjarne
Copy link
Member

rolfbjarne commented Sep 8, 2023

Repro:

make build BUILD_ARGUMENTS="/p:PublishAot=true /p:_IsPublishing=true" -C tests/linker/ios/link\ all/dotnet/macOS

Result:

ILLINK : warning MM2016: Keeping the dynamic registrar (by passing '--optimize=-remove-dynamic-registrar') is not possible, because the dynamic registrar is not supported when using NativeAOT. Support for dynamic registration will still be removed. [/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/linker/ios/link all/dotnet/macOS/link all.csproj]
ILLINK : warning MM2003: Option '--optimize=force-rejected-types-removal' will be ignored since it's only applicable to iOS, watchOS, tvOS, MacCatalyst. [/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/linker/ios/link all/dotnet/macOS/link all.csproj]
/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/bindings-test/RegistrarBindingTest.cs(356): warning MM4176: Unable to locate the delegate to block conversion type for the return value of the method Bindings.Test.SimpleCallback Xamarin.BindingTests.RegistrarBindingTest/FakePropertyBlock::get_MyOptionalProperty(). [/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/linker/ios/link all/dotnet/macOS/link all.csproj]
/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/bindings-test/RegistrarBindingTest.cs(356): warning MM4174: Unable to locate the block to delegate conversion method for the method System.Void Xamarin.BindingTests.RegistrarBindingTest/FakePropertyBlock::set_MyOptionalProperty(Bindings.Test.SimpleCallback)'s parameter #1. [/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/linker/ios/link all/dotnet/macOS/link all.csproj]
/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/bindings-test/RegistrarBindingTest.cs(359): warning MM4176: Unable to locate the delegate to block conversion type for the return value of the method Bindings.Test.SimpleCallback Xamarin.BindingTests.RegistrarBindingTest/FakePropertyBlock::get_MyRequiredProperty(). [/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/linker/ios/link all/dotnet/macOS/link all.csproj]
/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/bindings-test/RegistrarBindingTest.cs(359): warning MM4174: Unable to locate the block to delegate conversion method for the method System.Void Xamarin.BindingTests.RegistrarBindingTest/FakePropertyBlock::set_MyRequiredProperty(Bindings.Test.SimpleCallback)'s parameter #1. [/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/linker/ios/link all/dotnet/macOS/link all.csproj]
/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/bindings-test/RegistrarBindingTest.cs(362): warning MM4176: Unable to locate the delegate to block conversion type for the return value of the method Bindings.Test.SimpleCallback Xamarin.BindingTests.RegistrarBindingTest/FakePropertyBlock::get_MyOptionalStaticProperty(). [/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/linker/ios/link all/dotnet/macOS/link all.csproj]
/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/bindings-test/RegistrarBindingTest.cs(362): warning MM4174: Unable to locate the block to delegate conversion method for the method System.Void Xamarin.BindingTests.RegistrarBindingTest/FakePropertyBlock::set_MyOptionalStaticProperty(Bindings.Test.SimpleCallback)'s parameter #1. [/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/linker/ios/link all/dotnet/macOS/link all.csproj]
/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/bindings-test/RegistrarBindingTest.cs(365): warning MM4176: Unable to locate the delegate to block conversion type for the return value of the method Bindings.Test.SimpleCallback Xamarin.BindingTests.RegistrarBindingTest/FakePropertyBlock::get_MyRequiredStaticProperty(). [/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/linker/ios/link all/dotnet/macOS/link all.csproj]
/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/bindings-test/RegistrarBindingTest.cs(365): warning MM4174: Unable to locate the block to delegate conversion method for the method System.Void Xamarin.BindingTests.RegistrarBindingTest/FakePropertyBlock::set_MyRequiredStaticProperty(Bindings.Test.SimpleCallback)'s parameter #1. [/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/linker/ios/link all/dotnet/macOS/link all.csproj]
ILLink : MacOSX error IL7000: An error occured while executing the custom linker steps. Please review the build log for more information. [/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/linker/ios/link all/dotnet/macOS/link all.csproj]
ILLINK : error MM0099: Can't create a token reference to an unregistered type when using the managed static registrar: LinkAll.LinkAllRegressionTest/ProtocolWithGenericsInOptionalMemberWrapper [/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/linker/ios/link all/dotnet/macOS/link all.csproj]
ILLINK : error MM2362: The linker step 'Registrar' failed during processing: Can't create a token reference to an unregistered type when using the managed static registrar: LinkAll.LinkAllRegressionTest/ProtocolWithGenericsInOptionalMemberWrapper [/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/linker/ios/link all/dotnet/macOS/link all.csproj]
/Users/rolf/work/maccore/nativeaot/xamarin-macios/packages/microsoft.net.illink.tasks/8.0.0-rc.2.23431.9/build/Microsoft.NET.ILLink.targets(87,5): error NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false. [/Users/rolf/work/maccore/nativeaot/xamarin-macios/tests/linker/ios/link all/dotnet/macOS/link all.csproj]

Build FAILED.
@rolfbjarne rolfbjarne added this to the .NET 8 milestone Sep 8, 2023
@rolfbjarne rolfbjarne added the bug If an issue is a bug or a pull request a bug fix label Sep 8, 2023
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Sep 14, 2023
…pes to register. Fixes xamarin#18973.

Protocol wrapper types may be nested types, so make sure to look in nested
types when looking for protocol wrapper types.

Fixes xamarin#18973.
rolfbjarne added a commit that referenced this issue Sep 15, 2023
…pes to register. Fixes #18973. (#19031)

Protocol wrapper types may be nested types, so make sure to look in nested
types when looking for protocol wrapper types.

Fixes #18973.
@rolfbjarne
Copy link
Member Author

Fixed in #19031.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug If an issue is a bug or a pull request a bug fix
Projects
None yet
1 participant