diff --git a/docs/website/mtouch-errors.md b/docs/website/mtouch-errors.md index 7af89c53df..af150805b8 100644 --- a/docs/website/mtouch-errors.md +++ b/docs/website/mtouch-errors.md @@ -447,71 +447,79 @@ No action is required on your part, this message is purely informational. For further information see bug #[51634](https://bugzilla.xamarin.com/show_bug.cgi?id=51634). -

MT0112: Native code sharing has been disabled because the container app's deployment target is earlier than iOS 8.0 (it's *)).

+ +

MT0112: Native code sharing has been disabled because *

+ +There are multiple reasons code sharing can be disabled: + +* because the container app's deployment target is earlier than iOS 8.0 (it's *)). Native code sharing requires iOS 8.0 because native code sharing is implemented using user frameworks, which was introduced with iOS 8.0. -

MT0113: Native code sharing has been disabled because the container app includes I18N assemblies (*).

+* because the container app includes I18N assemblies (*). Native code sharing is currently not supported if the container app includes I18N assemblies. -

MT0114: Native code sharing has been disabled for the extension '*' because the bitcode options differ between the container app (*) and the extension (*).

+* because the container app has custom xml definitions for the managed linker (*). + +Native code sharing requires is not supported for projects that use custom xml definitions for the managed linker. + + +

MT0113: Native code sharing has been disabled for the extension '*' because *.

+ +* because the bitcode options differ between the container app (*) and the extension (*). Native code sharing requires that the bitcode options match between the projects that share code. -

MT0115: Native code sharing has been disabled for the extension '*' because the --assembly-build-target options are different between the container app (*) and the extension (*).

+* because the --assembly-build-target options are different between the container app (*) and the extension (*). Native code sharing requires that the --assembly-build-target options are identical between the projects that share code. This condition can occur if incremental builds are not either enabled or disabled in all the projects. -

MT0116: Native code sharing has been disabled for the extension '*' because the I18N assemblies are different between the container app (*) and the extension (*).

+* because the I18N assemblies are different between the container app (*) and the extension (*). Native code sharing is currently not supported for extensions that include I18N assemblies. -

MT0117: Native code sharing has been disabled for the extension '*' because the arguments to the AOT compiler are different between the container app (*) and the extension (*).

+* because the arguments to the AOT compiler are different between the container app (*) and the extension (*). Native code sharing requires that the arguments to the AOT compiler do not differ between projects that share code. -

MT0118: Native code sharing has been disabled for the extension '*' because the other arguments to the AOT compiler are different between the container app (*) and the extension (*).

+* because the other arguments to the AOT compiler are different between the container app (*) and the extension (*). Native code sharing requires that the arguments to the AOT compiler do not differ between projects that share code. This condition occurs if the 'Perform all 32-bit float operations as 64-bit float' differs between projects. -

MT0119: Native code sharing has been disabled for the extension '*' because LLVM is not enabled or disabled in both the container app (*) and the extension (*).

++ because LLVM is not enabled or disabled in both the container app (*) and the extension (*). Native code sharing requires that LLVM is either enabled or disabled for all projects that share code. -

MT0120: Native code sharing has been disabled for the extension '*' because the managed linker settings are different between the container app (*) and the extension (*).

+* because the managed linker settings are different between the container app (*) and the extension (*). Native code sharing requires that the managed linker settings are identical for all projects that share code. -

MT0121: Native code sharing has been disabled for the extension '*' because the skipped assemblies for the managed linker are different between the container app (*) and the extension (*).

+* because the skipped assemblies for the managed linker are different between the container app (*) and the extension (*). Native code sharing requires that the managed linker settings are identical for all projects that share code. -

MT0122: Native code sharing has been disabled because the container app has custom xml definitions for the managed linker (*).

+* because the extension has custom xml definitions for the managed linker (*). Native code sharing requires is not supported for projects that use custom xml definitions for the managed linker. -

MT0123: Native code sharing has been disabled for the extension '*' because the extension has custom xml definitions for the managed linker (*).

- -Native code sharing requires is not supported for projects that use custom xml definitions for the managed linker. - -

MT0124: Native code sharing has been disabled for the extension '*' because the container app does not build for the ABI * (while the extension is building for this ABI).

+* because the container app does not build for the ABI * (while the extension is building for this ABI). Native code sharing requires that the container app builds for all the architectures any app extension builds for. For instance: this condition occurs when an extension builds for ARM64+ARMv7, but the container app only builds for ARM64. -

MT0125: Native code sharing has been disabled for the extension '*' because the container app is building for the ABI *, which is not compatible with the extension's ABI (*).

+* because the container app is building for the ABI *, which is not compatible with the extension's ABI (*). Native code sharing requires that all the projects build for the exact same API. For instance: this condition occurs when an extension builds for ARMv7+llvm+thumb2, but the container app only builds for ARMv7+llvm. -

MT0126: Native code sharing has been disabled for the extension '{0}' because the container app is referencing the assembly '{1}' from '{2}', while the extension references it from '{3}'.

+* because the container app is referencing the assembly '*' from '*', while the extension references it from '*'. Native code sharing requires that all the projects that share code use the same versions for all assemblies. diff --git a/tests/mtouch/MTouch.cs b/tests/mtouch/MTouch.cs index b19fe1fb6d..7d236541fa 100644 --- a/tests/mtouch/MTouch.cs +++ b/tests/mtouch/MTouch.cs @@ -909,7 +909,7 @@ namespace Xamarin /* MT0109 is tested in other tests (MT2018) */ [Test] - public void MT0112 () + public void MT0112_deploymenttarget () { using (var extension = new MTouchTool ()) { extension.CreateTemporaryServiceExtension (); @@ -928,7 +928,7 @@ namespace Xamarin } [Test] - public void MT0113 () + public void MT0112_i18n () { using (var extension = new MTouchTool ()) { extension.CreateTemporaryServiceExtension (); @@ -939,15 +939,15 @@ namespace Xamarin app.CreateTemporaryApp (); app.CreateTemporaryCacheDirectory (); app.I18N = I18N.CJK; - app.WarnAsError = new int [] { 113 }; + app.WarnAsError = new int [] { 112 }; app.AssertExecuteFailure (MTouchAction.BuildDev, "build app"); - app.AssertError (113, "Native code sharing has been disabled because the container app includes I18N assemblies (CJK)."); + app.AssertError (112, "Native code sharing has been disabled because the container app includes I18N assemblies (CJK)."); } } } [Test] - public void MT0114 () + public void MT0113_bitcode () { using (var extension = new MTouchTool ()) { extension.CreateTemporaryServiceExtension (); @@ -959,9 +959,9 @@ namespace Xamarin app.CreateTemporaryCacheDirectory (); app.Abi = "arm64+llvm"; app.Bitcode = MTouchBitcode.Full; - app.WarnAsError = new int [] { 114 }; + app.WarnAsError = new int [] { 113 }; app.AssertExecuteFailure (MTouchAction.BuildDev, "build app"); - app.AssertError (114, "Native code sharing has been disabled for the extension 'testServiceExtension' because the bitcode options differ between the container app (None) and the extension (LLVMOnly)."); + app.AssertError (113, "Native code sharing has been disabled for the extension 'testServiceExtension' because the bitcode options differ between the container app (None) and the extension (LLVMOnly)."); } } } @@ -971,7 +971,7 @@ namespace Xamarin [TestCase ("framework ext", null, new string [] { "@sdk=framework=Xamarin.Sdk" })] [TestCase ("fastdev app", new string [] { "@all=dynamiclibrary" }, null)] [TestCase ("fastdev ext", null, new string [] { "@all=dynamiclibrary" })] - public void MT0115 (string name, string[] extension_abt, string[] app_abt) + public void MT0113_assemblybuildtarget (string name, string[] extension_abt, string[] app_abt) { using (var extension = new MTouchTool ()) { extension.CreateTemporaryServiceExtension (); @@ -983,17 +983,17 @@ namespace Xamarin app.AppExtensions.Add (extension); app.CreateTemporaryApp (); app.CreateTemporaryCacheDirectory (); - app.WarnAsError = new int [] { 115 }; + app.WarnAsError = new int [] { 113 }; if (app_abt != null) app.AssemblyBuildTargets.AddRange (app_abt); app.AssertExecuteFailure (MTouchAction.BuildDev, "build app"); - app.AssertError (115, $"Native code sharing has been disabled for the extension 'testServiceExtension' because the --assembly-build-target options are different between the container app ({(app_abt == null ? string.Empty : string.Join (", ", app_abt.Select ((v) => "--assembly-build-target:" + v)))}) and the extension ({(extension_abt == null ? string.Empty : string.Join (", ", extension_abt?.Select ((v) => "--assembly-build-target:" + v)))})."); + app.AssertError (113, $"Native code sharing has been disabled for the extension 'testServiceExtension' because the --assembly-build-target options are different between the container app ({(app_abt == null ? string.Empty : string.Join (", ", app_abt.Select ((v) => "--assembly-build-target:" + v)))}) and the extension ({(extension_abt == null ? string.Empty : string.Join (", ", extension_abt?.Select ((v) => "--assembly-build-target:" + v)))})."); } } } [Test] - public void MT0116 () + public void MT0113_i18n () { using (var extension = new MTouchTool ()) { extension.CreateTemporaryServiceExtension (); @@ -1004,15 +1004,15 @@ namespace Xamarin app.AppExtensions.Add (extension); app.CreateTemporaryApp (); app.CreateTemporaryCacheDirectory (); - app.WarnAsError = new int [] { 116 }; + app.WarnAsError = new int [] { 113 }; app.AssertExecuteFailure (MTouchAction.BuildDev, "build app"); - app.AssertError (116, "Native code sharing has been disabled for the extension 'testServiceExtension' because the I18N assemblies are different between the container app (None) and the extension (CJK)."); + app.AssertError (113, "Native code sharing has been disabled for the extension 'testServiceExtension' because the I18N assemblies are different between the container app (None) and the extension (CJK)."); } } } [Test] - public void MT0117 () + public void MT0113_aot () { using (var extension = new MTouchTool ()) { extension.CreateTemporaryServiceExtension (); @@ -1022,16 +1022,16 @@ namespace Xamarin app.AppExtensions.Add (extension); app.CreateTemporaryApp (); app.CreateTemporaryCacheDirectory (); - app.WarnAsError = new int [] { 117 }; + app.WarnAsError = new int [] { 113 }; app.AotArguments = "dwarfdebug"; // doesn't matter exactly what, just that it's different from the extension. app.AssertExecuteFailure (MTouchAction.BuildDev, "build app"); - app.AssertError (117, "Native code sharing has been disabled for the extension 'testServiceExtension' because the arguments to the AOT compiler are different between the container app (dwarfdebug,static,asmonly,direct-icalls,) and the extension (static,asmonly,direct-icalls,)."); + app.AssertError (113, "Native code sharing has been disabled for the extension 'testServiceExtension' because the arguments to the AOT compiler are different between the container app (dwarfdebug,static,asmonly,direct-icalls,) and the extension (static,asmonly,direct-icalls,)."); } } } [Test] - public void MT0118 () + public void MT0113_aotother () { using (var extension = new MTouchTool ()) { extension.CreateTemporaryServiceExtension (); @@ -1041,16 +1041,16 @@ namespace Xamarin app.AppExtensions.Add (extension); app.CreateTemporaryApp (); app.CreateTemporaryCacheDirectory (); - app.WarnAsError = new int [] { 118 }; + app.WarnAsError = new int [] { 113 }; app.AotOtherArguments = "--aot-options=-O=float32"; // doesn't matter exactly what, just that it's different from the extension. app.AssertExecuteFailure (MTouchAction.BuildDev, "build app"); - app.AssertError (118, "Native code sharing has been disabled for the extension 'testServiceExtension' because the other arguments to the AOT compiler are different between the container app (--aot-options=-O=float32 ) and the extension ()."); + app.AssertError (113, "Native code sharing has been disabled for the extension 'testServiceExtension' because the other arguments to the AOT compiler are different between the container app (--aot-options=-O=float32 ) and the extension ()."); } } } [Test] - public void MT0119 () + public void MT0113_llvm () { using (var extension = new MTouchTool ()) { extension.CreateTemporaryServiceExtension (); @@ -1061,16 +1061,16 @@ namespace Xamarin app.AppExtensions.Add (extension); app.CreateTemporaryApp (); app.CreateTemporaryCacheDirectory (); - app.WarnAsError = new int [] { 119 }; + app.WarnAsError = new int [] { 113 }; app.Abi = "arm64+llvm"; app.AssertExecuteFailure (MTouchAction.BuildDev, "build app"); - app.AssertError (119, "Native code sharing has been disabled for the extension 'testServiceExtension' because LLVM is not enabled or disabled in both the container app (True) and the extension (False)."); + app.AssertError (113, "Native code sharing has been disabled for the extension 'testServiceExtension' because LLVM is not enabled or disabled in both the container app (True) and the extension (False)."); } } } [Test] - public void MT0120 () + public void MT0113_linker () { using (var extension = new MTouchTool ()) { extension.CreateTemporaryServiceExtension (); @@ -1083,15 +1083,15 @@ namespace Xamarin app.CreateTemporaryApp (); app.CreateTemporaryCacheDirectory (); app.Linker = MTouchLinker.DontLink; - app.WarnAsError = new int [] { 120 }; + app.WarnAsError = new int [] { 113 }; app.AssertExecuteFailure (MTouchAction.BuildDev, "build app"); - app.AssertError (120, "Native code sharing has been disabled for the extension 'testServiceExtension' because the managed linker settings are different between the container app (None) and the extension (All)."); + app.AssertError (113, "Native code sharing has been disabled for the extension 'testServiceExtension' because the managed linker settings are different between the container app (None) and the extension (All)."); } } } [Test] - public void MT0121 () + public void MT0113_skipped () { using (var extension = new MTouchTool ()) { extension.CreateTemporaryServiceExtension (); @@ -1101,16 +1101,16 @@ namespace Xamarin app.AppExtensions.Add (extension); app.CreateTemporaryApp (); app.CreateTemporaryCacheDirectory (); - app.WarnAsError = new int [] { 121 }; + app.WarnAsError = new int [] { 113 }; app.LinkSkip = new string [] { "mscorlib.dll" }; app.AssertExecuteFailure (MTouchAction.BuildDev, "build app"); - app.AssertError (121, "Native code sharing has been disabled for the extension 'testServiceExtension' because the skipped assemblies for the managed linker are different between the container app (mscorlib.dll) and the extension ()."); + app.AssertError (113, "Native code sharing has been disabled for the extension 'testServiceExtension' because the skipped assemblies for the managed linker are different between the container app (mscorlib.dll) and the extension ()."); } } } [Test] - public void MT0122 () + public void MT0112_xml () { using (var extension = new MTouchTool ()) { extension.CreateTemporaryServiceExtension (); @@ -1120,16 +1120,16 @@ namespace Xamarin app.AppExtensions.Add (extension); app.CreateTemporaryApp (); app.CreateTemporaryCacheDirectory (); - app.WarnAsError = new int [] { 122 }; + app.WarnAsError = new int [] { 112 }; app.XmlDefinitions = new string [] { "foo.xml" }; app.AssertExecuteFailure (MTouchAction.BuildDev, "build app"); - app.AssertError (122, "Native code sharing has been disabled because the container app has custom xml definitions for the managed linker (foo.xml)."); + app.AssertError (112, "Native code sharing has been disabled because the container app has custom xml definitions for the managed linker (foo.xml)."); } } } [Test] - public void MT0123 () + public void MT0113_xml () { using (var extension = new MTouchTool ()) { extension.CreateTemporaryServiceExtension (); @@ -1140,9 +1140,9 @@ namespace Xamarin app.AppExtensions.Add (extension); app.CreateTemporaryApp (); app.CreateTemporaryCacheDirectory (); - app.WarnAsError = new int [] { 123 }; + app.WarnAsError = new int [] { 113 }; app.AssertExecuteFailure (MTouchAction.BuildDev, "build app"); - app.AssertError (123, "Native code sharing has been disabled for the extension 'testServiceExtension' because the extension has custom xml definitions for the managed linker (foo.xml)."); + app.AssertError (113, "Native code sharing has been disabled for the extension 'testServiceExtension' because the extension has custom xml definitions for the managed linker (foo.xml)."); } } } @@ -1150,7 +1150,7 @@ namespace Xamarin [Test] [TestCase ("arm64", "armv7", "ARMv7")] [TestCase ("armv7", "armv7,arm64", "ARM64")] - public void MT0124 (string app_abi, string extension_abi, string error_abi) + public void MT0113_abi (string app_abi, string extension_abi, string error_abi) { using (var extension = new MTouchTool ()) { extension.CreateTemporaryServiceExtension (); @@ -1161,17 +1161,17 @@ namespace Xamarin app.AppExtensions.Add (extension); app.CreateTemporaryApp (); app.CreateTemporaryCacheDirectory (); - app.WarnAsError = new int [] { 124 }; + app.WarnAsError = new int [] { 113 }; app.Abi = app_abi; app.AssertExecuteFailure (MTouchAction.BuildDev, "build app"); - app.AssertError (124, $"Native code sharing has been disabled for the extension 'testServiceExtension' because the container app does not build for the ABI {error_abi} (while the extension is building for this ABI)."); + app.AssertError (113, $"Native code sharing has been disabled for the extension 'testServiceExtension' because the container app does not build for the ABI {error_abi} (while the extension is building for this ABI)."); } } } [Test] [TestCase ("armv7+llvm+thumb2", "armv7+llvm", "ARMv7, Thumb, LLVM", "ARMv7, LLVM")] - public void MT0125 (string app_abi, string extension_abi, string container_error_abi, string extension_error_abi) + public void MT0113_incompatible_abi (string app_abi, string extension_abi, string container_error_abi, string extension_error_abi) { using (var extension = new MTouchTool ()) { extension.CreateTemporaryServiceExtension (); @@ -1182,16 +1182,16 @@ namespace Xamarin app.AppExtensions.Add (extension); app.CreateTemporaryApp (); app.CreateTemporaryCacheDirectory (); - app.WarnAsError = new int [] { 125 }; + app.WarnAsError = new int [] { 113 }; app.Abi = app_abi; app.AssertExecuteFailure (MTouchAction.BuildDev, "build app"); - app.AssertError (125, $"Native code sharing has been disabled for the extension 'testServiceExtension' because the container app is building for the ABI {container_error_abi}, which is not compatible with the extension's ABI ({extension_error_abi})."); + app.AssertError (113, $"Native code sharing has been disabled for the extension 'testServiceExtension' because the container app is building for the ABI {container_error_abi}, which is not compatible with the extension's ABI ({extension_error_abi})."); } } } [Test] - public void MT0126 () + public void MT0113_refmismatch () { using (var extension = new MTouchTool ()) { var ext_tmpdir = extension.CreateTemporaryDirectory (); @@ -1210,9 +1210,9 @@ namespace Xamarin app.CreateTemporaryApp (extraCode: "class Y : X {}", extraArg: $"-r:{Quote (app_dll)}"); app.CreateTemporaryCacheDirectory (); app.References = new string [] { app_dll }; - app.WarnAsError = new int [] { 126 }; + app.WarnAsError = new int [] { 113 }; app.AssertExecuteFailure (MTouchAction.BuildDev, "build app"); - app.AssertError (126, $"Native code sharing has been disabled for the extension 'testServiceExtension' because the container app is referencing the assembly 'testLibrary' from '{app_dll}', while the extension references it from '{ext_dll}'."); + app.AssertError (113, $"Native code sharing has been disabled for the extension 'testServiceExtension' because the container app is referencing the assembly 'testLibrary' from '{app_dll}', while the extension references it from '{ext_dll}'."); } } } diff --git a/tools/mtouch/Application.cs b/tools/mtouch/Application.cs index d767997190..f21ba12d78 100644 --- a/tools/mtouch/Application.cs +++ b/tools/mtouch/Application.cs @@ -908,14 +908,14 @@ namespace Xamarin.Bundler { if (DeploymentTarget.Major < 8) { // This is a limitation it's technically possible to fix (we can build all extensions into frameworks, and the main app to static objects). // It would make our code a bit more complicated though, and would only be valuable for apps that target iOS 6 or iOS 7 and has more than one extension. - ErrorHelper.Warning (112, "Native code sharing has been disabled because the container app's deployment target is earlier than iOS 8.0 (it's {0}).", DeploymentTarget); + ErrorHelper.Warning (112, "Native code sharing has been disabled because {0}", $"the container app's deployment target is earlier than iOS 8.0 (it's {DeploymentTarget})."); return; } // No I18N assemblies can be included if (I18n != Mono.Linker.I18nAssemblies.None) { // This is a limitation it's technically possible to fix. - ErrorHelper.Warning (113, "Native code sharing has been disabled because the container app includes I18N assemblies ({0}).", I18n); + ErrorHelper.Warning (112, "Native code sharing has been disabled because the container app includes I18N assemblies ({0}).", I18n); return; } @@ -933,7 +933,7 @@ namespace Xamarin.Bundler { } if (BitCodeMode != appex.BitCodeMode) { - ErrorHelper.Warning (114, "Native code sharing has been disabled for the extension '{0}' because the bitcode options differ between the container app ({1}) and the extension ({2}).", appex.Name, appex.BitCodeMode, BitCodeMode); + ErrorHelper.Warning (113, "Native code sharing has been disabled for the extension '{0}' because {1}", appex.Name, $"the bitcode options differ between the container app ({appex.BitCodeMode}) and the extension ({BitCodeMode})."); continue; } @@ -942,21 +942,21 @@ namespace Xamarin.Bundler { // We can probably lift this requirement (at least partially) at some point, // but for now it makes our code simpler. if (assembly_build_targets.Count != appex.assembly_build_targets.Count) { - ErrorHelper.Warning (115, "Native code sharing has been disabled for the extension '{0}' because the --assembly-build-target options are different between the container app ({1}) and the extension ({2}).", appex.Name, FormatAssemblyBuildTargets (), appex.FormatAssemblyBuildTargets ()); + ErrorHelper.Warning (113, "Native code sharing has been disabled for the extension '{0}' because {1}", appex.Name, $"the --assembly-build-target options are different between the container app ({FormatAssemblyBuildTargets ()}) and the extension ({appex.FormatAssemblyBuildTargets ()})."); continue; } foreach (var key in assembly_build_targets.Keys) { Tuple appex_value; if (!appex.assembly_build_targets.TryGetValue (key, out appex_value)) { - ErrorHelper.Warning (115, "Native code sharing has been disabled for the extension '{0}' because the --assembly-build-target options are different between the container app ({1}) and the extension ({2}).", appex.Name, FormatAssemblyBuildTargets (), appex.FormatAssemblyBuildTargets ()); + ErrorHelper.Warning (113, "Native code sharing has been disabled for the extension '{0}' because {1}", appex.Name, $"the --assembly-build-target options are different between the container app ({FormatAssemblyBuildTargets ()}) and the extension ({appex.FormatAssemblyBuildTargets ()})."); applicable = false; break; } var value = assembly_build_targets [key]; if (value.Item1 != appex_value.Item1 || value.Item2 != appex_value.Item2) { - ErrorHelper.Warning (115, "Native code sharing has been disabled for the extension '{0}' because the --assembly-build-target options are different between the container app ({1}) and the extension ({2}).", appex.Name, FormatAssemblyBuildTargets (), appex.FormatAssemblyBuildTargets ()); + ErrorHelper.Warning (113, "Native code sharing has been disabled for the extension '{0}' because {1}", appex.Name, $"the --assembly-build-target options are different between the container app ({FormatAssemblyBuildTargets ()}) and the extension ({appex.FormatAssemblyBuildTargets ()})."); applicable = false; break; } @@ -967,45 +967,45 @@ namespace Xamarin.Bundler { // No I18N assemblies can be included if (appex.I18n != Mono.Linker.I18nAssemblies.None) { - ErrorHelper.Warning (116, "Native code sharing has been disabled for the extension '{0}' because the I18N assemblies are different between the container app ({1}) and the extension ({2}).", appex.Name, I18n, appex.I18n); + ErrorHelper.Warning (113, "Native code sharing has been disabled for the extension '{0}' because {1}", appex.Name, $"the I18N assemblies are different between the container app ({I18n}) and the extension ({appex.I18n})."); continue; } // All arguments to the AOT compiler must be identical if (AotArguments != appex.AotArguments) { - ErrorHelper.Warning (117, "Native code sharing has been disabled for the extension '{0}' because the arguments to the AOT compiler are different between the container app ({1}) and the extension ({2}).", appex.Name, AotArguments, appex.AotArguments); + ErrorHelper.Warning (113, "Native code sharing has been disabled for the extension '{0}' because {1}", appex.Name, $"the arguments to the AOT compiler are different between the container app ({AotArguments}) and the extension ({appex.AotArguments})."); continue; } if (AotOtherArguments != appex.AotOtherArguments) { - ErrorHelper.Warning (118, "Native code sharing has been disabled for the extension '{0}' because the other arguments to the AOT compiler are different between the container app ({1}) and the extension ({2}).", appex.Name, AotOtherArguments, appex.AotOtherArguments); + ErrorHelper.Warning (113, "Native code sharing has been disabled for the extension '{0}' because {1}", appex.Name, $"the other arguments to the AOT compiler are different between the container app ({AotOtherArguments}) and the extension ({appex.AotOtherArguments})."); continue; } if (IsLLVM != appex.IsLLVM) { - ErrorHelper.Warning (119, "Native code sharing has been disabled for the extension '{0}' because LLVM is not enabled or disabled in both the container app ({1}) and the extension ({2}).", appex.Name, IsLLVM, appex.IsLLVM); + ErrorHelper.Warning (113, "Native code sharing has been disabled for the extension '{0}' because {1}", appex.Name, $"LLVM is not enabled or disabled in both the container app ({IsLLVM}) and the extension ({appex.IsLLVM})."); continue; } if (LinkMode != appex.LinkMode) { - ErrorHelper.Warning (120, "Native code sharing has been disabled for the extension '{0}' because the managed linker settings are different between the container app ({1}) and the extension ({2}).", appex.Name, LinkMode, appex.LinkMode); + ErrorHelper.Warning (113, "Native code sharing has been disabled for the extension '{0}' because {1}", appex.Name, $"the managed linker settings are different between the container app ({LinkMode}) and the extension ({appex.LinkMode})."); continue; } if (LinkMode != LinkMode.None) { var linkskipped_same = !LinkSkipped.Except (appex.LinkSkipped).Any () && !appex.LinkSkipped.Except (LinkSkipped).Any (); if (!linkskipped_same) { - ErrorHelper.Warning (121, "Native code sharing has been disabled for the extension '{0}' because the skipped assemblies for the managed linker are different between the container app ({1}) and the extension ({2}).", appex.Name, string.Join (", ", LinkSkipped), string.Join (", ", appex.LinkSkipped)); + ErrorHelper.Warning (113, "Native code sharing has been disabled for the extension '{0}' because {1}", appex.Name, $"the skipped assemblies for the managed linker are different between the container app ({string.Join (", ", LinkSkipped)}) and the extension ({string.Join (", ", appex.LinkSkipped)})."); continue; } if (Definitions.Count > 0) { - ErrorHelper.Warning (122, "Native code sharing has been disabled because the container app has custom xml definitions for the managed linker ({0}).", string.Join (", ", Definitions)); + ErrorHelper.Warning (112, "Native code sharing has been disabled because {0}", $"the container app has custom xml definitions for the managed linker ({string.Join (", ", Definitions)})."); continue; } if (appex.Definitions.Count > 0) { - ErrorHelper.Warning (123, "Native code sharing has been disabled for the extension '{0}' because the extension has custom xml definitions for the managed linker ({1}).", appex.Name, string.Join (", ", appex.Definitions)); + ErrorHelper.Warning (113, "Native code sharing has been disabled for the extension '{0}' because {1}", appex.Name, $"the extension has custom xml definitions for the managed linker ({string.Join (", ", appex.Definitions)})."); continue; } } @@ -1015,12 +1015,12 @@ namespace Xamarin.Bundler { var matching = abis.FirstOrDefault ((v) => (v & Abi.ArchMask) == (abi & Abi.ArchMask)); if (matching == Abi.None) { // Example: extension has arm64+armv7, while the main app has only arm64. - ErrorHelper.Warning (124, "Native code sharing has been disabled for the extension '{0}' because the container app does not build for the ABI {1} (while the extension is building for this ABI).", appex.Name, abi); + ErrorHelper.Warning (113, "Native code sharing has been disabled for the extension '{0}' because {1}", appex.Name, $"the container app does not build for the ABI {abi} (while the extension is building for this ABI)."); applicable = false; break; } else if (matching != abi) { // Example: extension has arm64+llvm, while the main app has only arm64. - ErrorHelper.Warning (125, "Native code sharing has been disabled for the extension '{0}' because the container app is building for the ABI {1}, which is not compatible with the extension's ABI ({2}).", appex.Name, matching, abi); + ErrorHelper.Warning (113, "Native code sharing has been disabled for the extension '{0}' because {1}", appex.Name, $"the container app is building for the ABI {matching}, which is not compatible with the extension's ABI ({abi})."); applicable = false; break; } @@ -1037,7 +1037,7 @@ namespace Xamarin.Bundler { continue; // appex references an assembly the main app doesn't. This is fine. if (asm.FullPath != kvp.Value.FullPath) { applicable = false; // app references an assembly with the same name as the main app, but from a different location. This is not fine. - ErrorHelper.Warning (126, "Native code sharing has been disabled for the extension '{0}' because the container app is referencing the assembly '{1}' from '{2}', while the extension references it from '{3}'.", appex.Name, asm.Identity, asm.FullPath, kvp.Value.FullPath); + ErrorHelper.Warning (113, "Native code sharing has been disabled for the extension '{0}' because {1}", appex.Name, $"the container app is referencing the assembly '{asm.Identity}' from '{asm.FullPath}', while the extension references it from '{kvp.Value.FullPath}'."); break; } }