7da04184cf
The CustomizedCodeSigning test asserts that a certain condition shows a particular error message from codesign. There are multiple files in the app bundle that can trigger this particular message, so change the logic to not assert on a particular file, instead use assert on the remained of the error message. Fixes this random test failure: Xamarin.Tests.DotNetProjectTest.CustomizedCodeSigning(iOS,"ios-arm64"): Failure when comparing error messages: Unexpected error message #0: Expected: /usr/bin/codesign exited with code 1:\n/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: replacing existing signature\n/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: code object is not signed at all\nIn subcomponent: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app/System.Diagnostics.DiagnosticSource.dll Actual: /usr/bin/codesign exited with code 1:\n/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: replacing existing signature\n/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: code object is not signed at all\nIn subcomponent: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app/System.Collections.NonGeneric.aotdata.arm64 Unexpected error message #1: Expected: Failed to codesign '/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app': /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: replacing existing signature\n/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: code object is not signed at all\nIn subcomponent: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app/System.Diagnostics.DiagnosticSource.dll Actual: Failed to codesign '/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app': /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: replacing existing signature\n/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: code object is not signed at all\nIn subcomponent: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app/System.Collections.NonGeneric.aotdata.arm64 All errors: /usr/bin/codesign exited with code 1: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: replacing existing signature /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: code object is not signed at all In subcomponent: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app/System.Collections.NonGeneric.aotdata.arm64 Failed to codesign '/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app': /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: replacing existing signature /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: code object is not signed at all In subcomponent: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app/System.Collections.NonGeneric.aotdata.arm64 --------- Co-authored-by: Alex Soto <alex@alexsoto.me> Co-authored-by: Manuel de la Pena <mandel@microsoft.com> |
||
---|---|---|
.. | ||
AdditionalAppExtensionConsumer | ||
AppWithGenericLibraryReference | ||
AppWithNativeDynamicLibrariesInPackageReference | ||
AppWithResources | ||
AppWithWinExeOutputType | ||
AppWithXCAssets | ||
AppWithXCFrameworkWithStaticLibraryInPackageReference | ||
AutoDetectEntitlements | ||
BindingOldStyle | ||
BindingWithDefaultCompileInclude | ||
BindingWithUncompressedResourceBundle | ||
BundleStructure | ||
CatalystAppOptimizedForMacOS | ||
CentralPackageVersionsApp | ||
CustomizedCodeSigning | ||
Entitlements | ||
ExceptionalTestApp | ||
ExtensionConsumer | ||
ExtensionConsumerWithFrameworks | ||
ExtensionProject | ||
ExtensionProjectWithFrameworks | ||
LibraryReferencingBindingLibrary | ||
MultiTargetingLibrary | ||
MyCatalystApp | ||
MyClassLibrary | ||
MyClassRedirectApp | ||
MyCocoaApp | ||
MyInterpretedApp | ||
MyMauiApp | ||
MyPartialAppManifestApp | ||
MyRegistrarApp | ||
MySatelliteAssembliesLibrary | ||
MySimpleApp | ||
MySimpleAppWithSatelliteReference | ||
MySingleView | ||
MyTVApp | ||
NativeDynamicLibraryReferencesApp | ||
NativeFileReferencesApp | ||
NativeFrameworkReferencesApp | ||
NativeXCFrameworkReferencesApp | ||
Net6_0SimpleApp | ||
Net7_0SimpleApp | ||
RebuildTestAppWithLibraryReference | ||
SimpleAppWithOldReferences | ||
UnitTests | ||
WidgetConsumer | ||
WidgetExtension | ||
Windows | ||
size-comparison | ||
.gitignore | ||
Makefile | ||
README.md |
README.md
.net tests
size-comparison
To install the latest appcompare
tool do:
$ dotnet tool install --global appcompare
You can update it to the latest version by running:
$ dotnet tool update --global appcompare
The current directory might point to a different and incompatible dotnet SDK, resulting in an error. However running the command from a different location (outside the repo) should work.
Easier Analysis
If you want to read/compare the IL inside the assemblies you need to disable IL stripping.
- Legacy (oldnet)
Add this option inside the Release|iPhone
configuration of size-comparison/MySingleView/oldnet/MySingleView.csproj
<MtouchExtraArgs>--nostrip</MtouchExtraArgs>
- net6
Build with /p:EnableAssemblyILStripping=false
set. The MtouchExtraArgs
legacy option is also honored.