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

Bump .NET to 6.0.100-preview.2.21114.3. #10666

Merged
merged 14 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,10 @@ DOTNET_FEED_DIR ?= $(DOTNET_DESTDIR)/nuget-feed
# We're using preview versions, and there will probably be many of them, so install locally (into builds/downloads) if there's no system version to
# avoid consuming a lot of disk space (since they're never automatically deleted). The system-dependencies.sh script will install locally as long
# as there's a TARBALL url.
DOTNET6_VERSION=6.0.100-preview.1.21103.13
DOTNET6_VERSION=6.0.100-preview.2.21114.3
DOTNET6_VERSION_BAND=$(firstword $(subst -, ,$(DOTNET6_VERSION)))
DOTNET6_URL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.1.21103.13/dotnet-sdk-6.0.100-preview.1.21103.13-osx-x64.pkg
DOTNET6_TARBALL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.1.21103.13/dotnet-sdk-6.0.100-preview.1.21103.13-osx-x64.tar.gz
DOTNET6_URL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.2.21114.3/dotnet-sdk-6.0.100-preview.2.21114.3-osx-x64.pkg
DOTNET6_TARBALL=https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100-preview.2.21114.3/dotnet-sdk-6.0.100-preview.2.21114.3-osx-x64.tar.gz
DOTNET6_TARBALL_NAME=$(notdir $(DOTNET6_TARBALL))
DOTNET6_DIR=$(abspath $(TOP)/builds/downloads/$(basename $(basename $(DOTNET6_TARBALL_NAME))))
DOTNET6=$(DOTNET6_DIR)/dotnet
Expand Down
5 changes: 3 additions & 2 deletions dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@
<EnableUnsafeUTF7Encoding Condition="'$(EnableUnsafeUTF7Encoding)' == ''">false</EnableUnsafeUTF7Encoding>
<EventSourceSupport Condition="'$(EventSourceSupport)' == ''">false</EventSourceSupport>
<HttpActivityPropagationSupport Condition="'$(HttpActivityPropagationSupport)' == ''">false</HttpActivityPropagationSupport>
<InvariantGlobalization Condition="'$(InvariantGlobalization)' == ''">false</InvariantGlobalization>
<!-- .NET only supports invariant globalization for Apple platforms for now: https://github.com/xamarin/xamarin-macios/issues/8906 -->
<InvariantGlobalization Condition="'$(InvariantGlobalization)' == ''">true</InvariantGlobalization>
<StartupHookSupport Condition="'$(StartupHookSupport)' == ''">false</StartupHookSupport>
<UseSystemResourceKeys Condition="'$(UseSystemResourceKeys)' == ''">true</UseSystemResourceKeys>
</PropertyGroup>
Expand Down Expand Up @@ -301,7 +302,7 @@

<!-- add a custom step which inserts any other steps we need -->
<_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)">
<BeforeStep>LoadReferencesStep</BeforeStep>
<BeforeStep>MarkStep</BeforeStep>
<Type>Xamarin.SetupStep</Type>
</_TrimmerCustomSteps>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ Copyright (C) 2011-2013 Xamarin. All rights reserved.
<!-- Replace the custom steps using the remote file paths for those -->
<_TrimmerCustomSteps Remove="$(_AdditionalTaskAssembly)" />
<_TrimmerCustomSteps Include="$([System.String]::Copy('$(_AdditionalTaskAssembly)').Replace('$(NetCoreRoot)', '$(_RemoteDotNetDir)'))">
<BeforeStep>LoadReferencesStep</BeforeStep>
<BeforeStep>MarkStep</BeforeStep>
<Type>Xamarin.SetupStep</Type>
</_TrimmerCustomSteps>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/bgen/bgen-tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Mono.Cecil" Version="0.11.2" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.1.176" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.1.303" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/dotnet/UnitTests/DotNetUnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Mono.Cecil" Version="0.11.2" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.1.215" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.1.303" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/generator/generator-tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.11.1" />
<PackageReference Include="Mono.Cecil" Version="0.11.1" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.1.176" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.1.303" />
</ItemGroup>
<ItemGroup>
<Compile Include="ErrorTests.cs" />
Expand Down
4 changes: 4 additions & 0 deletions tests/introspection/ApiPInvokeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ protected void Check (Assembly a)
case "libSystem.Native":
path += ".dylib";
break;
case "QCall":
if (name.StartsWith ("LogThreadPool", StringComparison.Ordinal))
continue;
break;
#endif
case "libc":
// we still have some rogue/not-fully-qualified DllImport
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageReference Include="NUnit.ConsoleRunner" Version="3.11.1" />
<PackageReference Include="NUnit.Extension.NUnitV2ResultWriter" Version="3.6.0" />
<PackageReference Include="Mono.Cecil" Version="0.11.1" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.1.176" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.1.303" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\mtouch\Cache.cs">
Expand Down
2 changes: 1 addition & 1 deletion tests/mtouch/mtouch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.11.1" />
<PackageReference Include="Mono.Cecil" Version="0.11.1" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.1.176" />
<PackageReference Include="MSBuild.StructuredLogger" Version="2.1.303" />
</ItemGroup>
<ItemGroup>
<Compile Include="MTouch.cs" />
Expand Down
39 changes: 23 additions & 16 deletions tools/dotnet-linker/SetupStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ void InsertBefore (IStep step, string stepName)
return;
}
}
DumpSteps ();
throw new InvalidOperationException ($"Could not insert {step} before {stepName} because {stepName} wasn't found.");
}

Expand All @@ -46,6 +47,7 @@ void InsertAfter (IStep step, string stepName)
return;
}
}
DumpSteps ();
throw new InvalidOperationException ($"Could not insert {step} after {stepName} because {stepName} wasn't found.");
}

Expand All @@ -57,13 +59,13 @@ protected override void TryProcess ()

// Load the list of assemblies loaded by the linker.
// This would not be needed of LinkContext.GetAssemblies () was exposed to us.
InsertAfter (new CollectAssembliesStep (), "LoadReferencesStep");
InsertBefore (new CollectAssembliesStep (), "MarkStep");

var pre_dynamic_dependency_lookup_substeps = new DotNetSubStepDispatcher ();
InsertBefore (pre_dynamic_dependency_lookup_substeps, "DynamicDependencyLookupStep");
InsertBefore (pre_dynamic_dependency_lookup_substeps, "MarkStep");

var prelink_substeps = new DotNetSubStepDispatcher ();
InsertAfter (prelink_substeps, "RemoveSecurityStep");
InsertBefore (prelink_substeps, "MarkStep");

var post_sweep_substeps = new DotNetSubStepDispatcher ();
InsertAfter (post_sweep_substeps, "SweepStep");
Expand Down Expand Up @@ -100,24 +102,29 @@ protected override void TryProcess ()
Configuration.Write ();

if (Configuration.Verbosity > 0) {
Console.WriteLine ();
Console.WriteLine ("Pipeline Steps:");
foreach (var step in Steps) {
Console.WriteLine ($" {step}");
if (step is SubStepsDispatcher) {
var substeps = typeof (SubStepsDispatcher).GetField ("substeps", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue (step) as IEnumerable<ISubStep>;
if (substeps != null) {
foreach (var substep in substeps) {
Console.WriteLine ($" {substep}");
}
}
}
}
DumpSteps ();
}

ErrorHelper.Platform = Configuration.Platform;
Directory.CreateDirectory (Configuration.ItemsDirectory);
Directory.CreateDirectory (Configuration.CacheDirectory);
}

void DumpSteps ()
{
Console.WriteLine ();
Console.WriteLine ("Pipeline Steps:");
foreach (var step in Steps) {
Console.WriteLine ($" {step}");
if (step is SubStepsDispatcher) {
var substeps = typeof (SubStepsDispatcher).GetField ("substeps", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue (step) as IEnumerable<ISubStep>;
if (substeps != null) {
foreach (var substep in substeps) {
Console.WriteLine ($" {substep}");
}
}
}
}
}
}
}
16 changes: 12 additions & 4 deletions tools/dotnet-linker/Steps/CollectAssembliesStep.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
using System.Collections.Generic;
using Mono.Cecil;

namespace Xamarin.Linker {
public class CollectAssembliesStep : ConfigurationAwareStep {
protected override string Name { get; } = "Collect Assemblies";
protected override int ErrorCode { get; } = 2330;

protected override void TryProcessAssembly (AssemblyDefinition assembly)
protected override void TryProcess ()
{
base.TryProcessAssembly (assembly);
base.TryProcess ();

Configuration.Assemblies.Add (assembly);
// This is a temporary workaround, we need to mark members and types, and we have to do it before
// the MarkStep. However, MarkStep is the first step, and if we add another step before it,
// there won't be any assemblies loaded (since MarkStep will load assemblies as needed).
// This step now runs at the very beginning, using reflection to call into the linker to load all
// the referenced assemblies, so that we can then have another step before MarkStep that does the
// custom marking we need to do.
var getReferencedAssemblies = Configuration.Context.GetType ().GetMethod ("GetReferencedAssemblies");
var assemblies = (IEnumerable<AssemblyDefinition>) getReferencedAssemblies.Invoke (Configuration.Context, new object [0]);
Configuration.Assemblies.AddRange (assemblies);
}
}
}

16 changes: 16 additions & 0 deletions tools/dotnet-linker/Steps/GenerateMainStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Text;

using Xamarin.Linker;
using Xamarin.Utils;

namespace Xamarin {

Expand Down Expand Up @@ -35,6 +36,21 @@ protected override void TryEndProcess ()
contents.AppendLine ("}");
contents.AppendLine ();

if (Configuration.Platform == ApplePlatform.MacOSX) {
// mono_config_parse_memory was removed in .NET: https://github.com/dotnet/runtime/pull/48007
// however, we still use this function in our libxamarin code, and we can't remove it without affecting
// legacy Xamarin.Mac, so just add a dummy implementation of mono_config_parse_memory so that the
// native linker doesn't complain. This is a temporary solution: we'll soon build a .NET-specific
// libxamarin, in which case we can #ifdef out the call to mono_config_parse_memory for .NET only.
contents.AppendLine ("#include <stdio.h>");
contents.AppendLine ("extern \"C\" void mono_config_parse_memory (const char *buffer);");
contents.AppendLine ("void mono_config_parse_memory (const char *buffer)");
contents.AppendLine ("{");
contents.AppendLine ("\tfprintf (stderr, \"mono_config_parse_memory has been removed\\n\");");
contents.AppendLine ("}");
contents.AppendLine ();
}

Configuration.Target.GenerateMain (contents, app.Platform, abi, file, registration_methods);

var item = new MSBuildItem {
Expand Down