Skip to content

Commit

Permalink
Fix .Unsafe, .Immutable?
Browse files Browse the repository at this point in the history
Commit 90c51a0 "worked" in that we no
longer got insta-crashes because of resolving System.Memory, a'la
24d5280.

It failed in that it introduces a unit test failure in
`CheckLintErrorsAndWarnings()`:

    Output should not contain any XA0102 warnings

Which contains:

    warning XA0102: The image icon.png varies significantly in its density-independent (dip) size across the various density versions: drawable-hdpi/icon.png: 32x32 dp (48x48 px), drawable-mdpi/icon.png: 48x48 dp (48x48 px), drawable-xhdpi/icon.png: 24x24 dp (48x48 px), drawable-xxhdpi/icon.png: 16x16 dp (48x48 px), drawable-xxxhdpi/icon.png: 12x12 dp (48x48 px) [IconDipSize]

Doh!

Ignoring *that* for now, the Windows smoke tests continue to fail,
now because of System.Runtime.CompilerServices.Unsafe!

    System.IO.FileLoadException : Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    ----> System.IO.FileLoadException : Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
       at System.MemoryExtensions.AsSpan(String text)
       at Microsoft.Build.Evaluation.Expander`2.Function`1.ExtractPropertyFunction(String expressionFunction, IElementLocation elementLocation, Object propertyValue, UsedUninitializedProperties usedUnInitializedProperties, IFileSystem fileSystem)
       at Microsoft.Build.Evaluation.Expander`2.PropertyExpander`1.ExpandPropertyBody(String propertyBody, Object propertyValue, IPropertyProvider`1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties, IFileSystem fileSystem)
       at Microsoft.Build.Evaluation.Expander`2.PropertyExpander`1.ExpandPropertiesLeaveTypedAndEscaped(String expression, IPropertyProvider`1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties, IFileSystem fileSystem)
       at Microsoft.Build.Evaluation.Expander`2.PropertyExpander`1.ExpandPropertiesLeaveEscaped(String expression, IPropertyProvider`1 properties, ExpanderOptions options, IElementLocation elementLocation, UsedUninitializedProperties usedUninitializedProperties, IFileSystem fileSystem)
       at Microsoft.Build.Evaluation.Expander`2.ExpandIntoStringLeaveEscaped(String expression, ExpanderOptions options, IElementLocation elementLocation)
       at Microsoft.Build.Evaluation.ToolsetReader.ExpandPropertyUnescaped(ToolsetPropertyDefinition property, Expander`2 expander)
       at Microsoft.Build.Evaluation.ToolsetReader.EvaluateAndSetProperty(ToolsetPropertyDefinition property, PropertyDictionary`1 properties, PropertyDictionary`1 globalProperties, PropertyDictionary`1 initialProperties, Boolean accumulateProperties, String& toolsPath, String& binPath, Expander`2& expander)
       at Microsoft.Build.Evaluation.ToolsetReader.ReadToolset(ToolsetPropertyDefinition toolsVersion, PropertyDictionary`1 globalProperties, PropertyDictionary`1 initialProperties, Boolean accumulateProperties)
       at Microsoft.Build.Evaluation.ToolsetReader.ReadEachToolset(Dictionary`2 toolsets, PropertyDictionary`1 globalProperties, PropertyDictionary`1 initialProperties, Boolean accumulateProperties)
       at Microsoft.Build.Evaluation.ToolsetReader.ReadToolsets(Dictionary`2 toolsets, PropertyDictionary`1 globalProperties, PropertyDictionary`1 initialProperties, Boolean accumulateProperties, String& msBuildOverrideTasksPath, String& defaultOverrideToolsVersion)
       at Microsoft.Build.Evaluation.ToolsetReader.<ReadAllToolsets>g__ReadConfigToolset|12_0(<>c__DisplayClass12_0& )
       at Microsoft.Build.Evaluation.ToolsetReader.ReadAllToolsets(Dictionary`2 toolsets, ToolsetRegistryReader registryReader, ToolsetConfigurationReader configurationReader, PropertyDictionary`1 environmentProperties, PropertyDictionary`1 globalProperties, ToolsetDefinitionLocations locations)
       at Microsoft.Build.Evaluation.ProjectCollection.InitializeToolsetCollection(ToolsetRegistryReader registryReader, ToolsetConfigurationReader configReader)
       at Microsoft.Build.Evaluation.ProjectCollection..ctor(IDictionary`2 globalProperties, IEnumerable`1 loggers, IEnumerable`1 remoteLoggers, ToolsetDefinitionLocations toolsetDefinitionLocations, Int32 maxNodeCount, Boolean onlyLogCriticalEvents, Boolean loadProjectsReadOnly, Boolean useAsynchronousLogging)
       at Microsoft.Build.Evaluation.ProjectCollection.get_GlobalProjectCollection()
       at Xamarin.ProjectTools.DotNetXamarinProject.Construct() in C:\a\_work\1\s\src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Common\DotNetXamarinProject.cs:line 101
       at Xamarin.ProjectTools.XamarinAndroidCommonProject.Construct() in C:\a\_work\1\s\src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Android\XamarinAndroidCommonProject.cs:line 53
       at Xamarin.ProjectTools.DotNetXamarinProject.SaveProject() in C:\a\_work\1\s\src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Common\DotNetXamarinProject.cs:line 141
       at Xamarin.ProjectTools.XamarinProject.Save(Boolean saveProject) in C:\a\_work\

Address a comment by @jonathanpeppers that the contents of the
App.config files should match MSBuild.exe.config from VS, and
revert the System.Collections.Immutable version bump back to 6.0.0.
Additionally, ensure all `App.config` files are consistent with
each other, which means updating versinos in
`src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/App.config`.

Maybe *now* Windows' smoke tests can run?  Maybe?
  • Loading branch information
jonpryor committed Nov 17, 2022
1 parent c87837d commit 1d38470
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<NuGetApiPackageVersion>5.4.0</NuGetApiPackageVersion>
<LZ4PackageVersion>1.1.11</LZ4PackageVersion>
<MonoOptionsVersion>6.12.0.148</MonoOptionsVersion>
<SystemCollectionsImmutableVersion>7.0.0</SystemCollectionsImmutableVersion>
<SystemCollectionsImmutableVersion>6.0.0</SystemCollectionsImmutableVersion>
<SystemRuntimeCompilerServicesUnsafeVersion>6.0.0</SystemRuntimeCompilerServicesUnsafeVersion>
<ELFSharpVersion>2.13.1</ELFSharpVersion>
<MdocPackageVersion Condition=" '$(MdocPackageVersion)' == '' ">5.8.9.2</MdocPackageVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="5.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="5.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
Expand Down
2 changes: 1 addition & 1 deletion tools/xabuild/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="7.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
Expand Down

0 comments on commit 1d38470

Please sign in to comment.