From 08e5f3c5022fcacd87797c99cfaf5027d5a284ce Mon Sep 17 00:00:00 2001 From: Vitek Karas <10670590+vitek-karas@users.noreply.github.com> Date: Tue, 17 Jan 2023 10:16:42 -0800 Subject: [PATCH 1/5] Fix a small bug in message origin for warnings from static field access on generic type (dotnet/linker#3186) The warning needs to be generated from the origin where the field reference comes from - so if it's a method body, then from the method body. This is because the instantiation is determined by that place, not the field itself (the field is defined on an open generic definition of the type). This syncs the relevants tests with a NativeAOT work-in-progress change, but in generately it adds a lot more cases and some better comments. Co-authored-by: Tlakaelel Axayakatl Ceja Commit migrated from https://github.com/dotnet/linker/commit/c790896f128957acd2999208f44f09ae1e826c8c --- .../src/linker/Linker.Steps/MarkStep.cs | 2 +- .../GenericParameterWarningLocation.cs | 340 ++++++++++++++++-- 2 files changed, 320 insertions(+), 22 deletions(-) diff --git a/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs b/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs index ad20063a06a7c2..00c1f8b2d6db35 100644 --- a/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs +++ b/src/tools/illink/src/linker/Linker.Steps/MarkStep.cs @@ -1610,7 +1610,7 @@ protected void MarkField (FieldReference reference, DependencyInfo reason, in Me Debug.Assert (reason.Kind == DependencyKind.FieldAccess || reason.Kind == DependencyKind.Ldtoken); // Blame the field reference (without actually marking) on the original reason. Tracer.AddDirectDependency (reference, reason, marked: false); - MarkType (reference.DeclaringType, new DependencyInfo (DependencyKind.DeclaringType, reference), new MessageOrigin (Context.TryResolve (reference))); + MarkType (reference.DeclaringType, new DependencyInfo (DependencyKind.DeclaringType, reference)); // Blame the field definition that we will resolve on the field reference. reason = new DependencyInfo (DependencyKind.FieldOnGenericInstance, reference); diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterWarningLocation.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterWarningLocation.cs index 1b82d33abbf85e..6b34dfc799517a 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterWarningLocation.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterWarningLocation.cs @@ -3,6 +3,7 @@ using System; using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; using System.Security.Policy; using Mono.Linker.Tests.Cases.Expectations.Assertions; @@ -25,7 +26,12 @@ public static void Main () class TypeInheritance { class BaseWithPublicMethods<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods> - { } + { + public static void GetMethods () + { + typeof (TPublicMethods).GetMethods (); + } + } class BaseWithTwo< [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods, @@ -61,6 +67,18 @@ class DerivedWithTwoMatching< : BaseWithTwo { } + [ExpectedWarning ("IL2091")] + class DerivedWithOnlyStaticMethodReference : BaseWithPublicMethods + { + // The method body in this case looks like: + // BaseWithPublicMethods.GetMethods () + // The type instantiation needs to be validated and in this case it produces a warning. + // This is no different from the same code being part of a completely unrelated method/class. + // So the fact that this is in derived class has no impact on the validation in this case. + [ExpectedWarning ("IL2091")] + public static void GetDerivedMethods () => GetMethods (); + } + public static void Test () { Type t; @@ -70,6 +88,8 @@ public static void Test () t = typeof (DerivedWithMismatchAnnotation<>); t = typeof (DerivedWithOneMismatch<>); t = typeof (DerivedWithTwoMatching<,>); + + DerivedWithOnlyStaticMethodReference.GetDerivedMethods (); } } @@ -115,6 +135,13 @@ public static void Test () } } + // Method parameter instantiation doesn't technically need to be validated on its own + // Especially in AOT compiler the type of the method parameter won't even exist in the compilation + // unless something passes a real value to it, in which case that value creation will do all the necessary + // validations. So the declaration of the parameter type alone doesn't create an analysis hole + // it only becomes one if something tries to create an instance of such type. + // Similarly for statics - since we do validate accesses to static members, the static .ctor is covered through + // those as well. class MethodParametersAndReturn { class TypeWithPublicMethods<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods> @@ -127,11 +154,11 @@ interface IWithTwo< static void MethodWithSpecificType (TypeWithPublicMethods one, IWithTwo two) { } - [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] static void MethodWithOneMismatch (TypeWithPublicMethods one) { } - [ExpectedWarning ("IL2091", nameof (IWithTwo))] - [ExpectedWarning ("IL2091", nameof (TypeWithPublicMethods))] + [ExpectedWarning ("IL2091", nameof (IWithTwo), ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] + [ExpectedWarning ("IL2091", nameof (TypeWithPublicMethods), ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] static void MethodWithTwoMismatches< [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicFields)] TPublicFields, [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods> @@ -142,11 +169,11 @@ static void MethodWithTwoMismatches< static TypeWithPublicMethods MethodWithMatchingReturn<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods> () => null; - [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] static TypeWithPublicMethods MethodWithOneMismatchReturn () => null; - [ExpectedWarning ("IL2091")] - [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] static IWithTwo MethodWithTwoMismatchesInReturn< [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicFields)] TPublicFields, [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods> @@ -165,6 +192,9 @@ public static void Test () } } + // Same as for method parameters - declaring a field with a specific type in itself is not problematic + // for the field to be "dangerous" it would need to have a non-null value and thus the instance has to be created somewhere + // and that point of creation is the place where the validation happens. class FieldDefinition { class TypeWithPublicMethods<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods> @@ -197,10 +227,10 @@ public static void Test () class MultipleReferencesToTheSameType<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods, TUnknown> { - [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] static TypeWithPublicMethods _field1; static TypeWithPublicMethods _field2; - [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] static TypeWithPublicMethods _field3; public static void Test () @@ -215,8 +245,8 @@ class TwoMismatchesInOne< [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods, [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicFields)] TPublicFields> { - [ExpectedWarning ("IL2091")] - [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] static IWithTwo _field; public static void Test () @@ -267,12 +297,12 @@ public static void Test () class MultipleReferencesToTheSameType<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods, TUnknown> { // The warning is generated on the backing field - [ExpectedWarning ("IL2091", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL2091", CompilerGeneratedCode = true, ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] static TypeWithPublicMethods Property1 { - [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] get; - [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] set; } @@ -282,12 +312,12 @@ static TypeWithPublicMethods Property2 { } // The warning is generated on the backing field - [ExpectedWarning ("IL2091", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL2091", CompilerGeneratedCode = true, ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] static TypeWithPublicMethods Property3 { - [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] get; - [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] set; } @@ -304,14 +334,14 @@ class TwoMismatchesInOne< [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicFields)] TPublicFields> { // The warnings are generated on the backing field - [ExpectedWarning ("IL2091", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL2091", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL2091", CompilerGeneratedCode = true, ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] + [ExpectedWarning ("IL2091", CompilerGeneratedCode = true, ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] static IWithTwo Property { // Getter is trimmed and doesn't produce any warning get; - [ExpectedWarning ("IL2091")] - [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.Analyzer)] set; } @@ -335,6 +365,10 @@ class MethodBody class TypeWithPublicMethods<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods> : Exception { public static void Method () { } + + public static string Field; + + public static string Property { get; set; } } interface IWithTwo< @@ -342,6 +376,10 @@ interface IWithTwo< [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicFields)] TPublicFields> { public static void Method () { } + + public static string Field; + + public static string Property { get; set; } } class TypeWithTwo< @@ -358,6 +396,13 @@ static void MethodWithTwo< class TypeOf { + static void AccessOpenTypeDefinition () + { + // Accessing the open type definition should not do anything on its own - just validating that it doesn't break anything + Type t = typeof (TypeWithPublicMethods<>); + t = typeof (IWithTwo<,>); + } + static void SpecificType () { Type t = typeof (TypeWithPublicMethods); @@ -392,6 +437,7 @@ static void TwoMismatchesInOneStatement< public static void Test () { + AccessOpenTypeDefinition (); SpecificType (); OneMatchingAnnotation (); MultipleReferencesToTheSameType (); @@ -485,6 +531,49 @@ public static void Test () } } + class FieldAccessOnGenericType + { + static void SpecificType () + { + _ = TypeWithPublicMethods.Field; + IWithTwo.Field = ""; + } + + static void OneMatchingAnnotation<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods> () + { + _ = TypeWithPublicMethods.Field; + } + + [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091")] + static void MultipleReferencesToTheSameField< + [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods, + TUnknown> () + { + _ = TypeWithPublicMethods.Field; // Warn + TypeWithPublicMethods.Field = ""; // No warn + TypeWithPublicMethods.Field = ""; // Warn + } + + [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091")] + static void TwoMismatchesInOneStatement< + [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicFields)] TPublicFields, + [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods> + () + { + _ = IWithTwo.Field; + } + + public static void Test () + { + SpecificType (); + OneMatchingAnnotation (); + MultipleReferencesToTheSameField (); + TwoMismatchesInOneStatement (); + } + } + class LocalVariable { static void SpecificType () @@ -612,6 +701,210 @@ public static void Test () } } + class LdTokenOnGenericMethod + { + static void SpecificType () + { + Expression a = () => MethodWithPublicMethods (); + } + + static void OneMatchingAnnotation<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods> () + { + Expression a = () => MethodWithPublicMethods (); + } + + [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091")] + static void MultipleReferencesToTheSameMethod< + [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods, + TUnknown> () + { + Expression a = () => MethodWithPublicMethods (); // Warn + a = () => MethodWithPublicMethods (); // No warn + a = () => MethodWithPublicMethods (); // Warn + } + + [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091")] + static void TwoMismatchesInOneStatement< + [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicFields)] TPublicFields, + [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods> + () + { + Expression a = () => MethodWithTwo (); + } + + public static void Test () + { + SpecificType (); + OneMatchingAnnotation (); + MultipleReferencesToTheSameMethod (); + TwoMismatchesInOneStatement (); + } + } + + class LdTokenOfMethodOnGenericType + { + static void SpecificType () + { + Expression a = () => TypeWithPublicMethods.Method (); + } + + static void OneMatchingAnnotation<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods> () + { + Expression a = () => TypeWithPublicMethods.Method (); + } + + // There are two warnings per "callsite" in this case because the generated IL does + // ldtoken method + // ldtoken owningtype + // In order to call the right Expression APIs. + [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)] + [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)] + static void MultipleReferencesToTheSameMethod< + [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods, + TUnknown> () + { + Expression a = () => TypeWithPublicMethods.Method (); // Warn + a = () => TypeWithPublicMethods.Method (); // No warn + a = () => TypeWithPublicMethods.Method (); // Warn + } + + // There are two warnings per "callsite" in this case because the generated IL does + // ldtoken method + // ldtoken owningtype + // In order to call the right Expression APIs. + [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)] + [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)] + static void TwoMismatchesInOneStatement< + [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicFields)] TPublicFields, + [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods> + () + { + Expression a = () => IWithTwo.Method (); + } + + public static void Test () + { + SpecificType (); + OneMatchingAnnotation (); + MultipleReferencesToTheSameMethod (); + TwoMismatchesInOneStatement (); + } + } + + class LdTokenOfFieldOnGenericType + { + static void SpecificType () + { + Expression> a = () => TypeWithPublicMethods.Field; + } + + static void OneMatchingAnnotation<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods> () + { + Expression> a = () => TypeWithPublicMethods.Field; + } + + // There are two warnings per "callsite" in this case because the generated IL does + // ldtoken field + // ldtoken owningtype + // In order to call the right Expression APIs. + [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)] + [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)] + static void MultipleReferencesToTheSameField< + [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods, + TUnknown> () + { + Expression> a = () => TypeWithPublicMethods.Field; // Warn + a = () => TypeWithPublicMethods.Field; // No warn + a = () => TypeWithPublicMethods.Field; // Warn + } + + // There are two warnings per "callsite" in this case because the generated IL does + // ldtoken field + // ldtoken owningtype + // In order to call the right Expression APIs. + [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)] + [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)] + static void TwoMismatchesInOneStatement< + [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicFields)] TPublicFields, + [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods> + () + { + Expression> a = () => IWithTwo.Field; + } + + public static void Test () + { + SpecificType (); + OneMatchingAnnotation (); + MultipleReferencesToTheSameField (); + TwoMismatchesInOneStatement (); + } + } + + class LdTokenOfPropertyOnGenericType + { + static void SpecificType () + { + Expression> a = () => TypeWithPublicMethods.Property; + } + + static void OneMatchingAnnotation<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods> () + { + Expression> a = () => TypeWithPublicMethods.Property; + } + + // There are two warnings per "callsite" in this case because the generated IL does + // ldtoken method (getter) + // ldtoken owningtype + // In order to call the right Expression APIs. + [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)] + [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)] + static void MultipleReferencesToTheSameProperty< + [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods, + TUnknown> () + { + Expression> a = () => TypeWithPublicMethods.Property; // Warn + a = () => TypeWithPublicMethods.Property; // No warn + a = () => TypeWithPublicMethods.Property; // Warn + } + + // There are two warnings per "callsite" in this case because the generated IL does + // ldtoken method (getter) + // ldtoken owningtype + // In order to call the right Expression APIs. + [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)] + [ExpectedWarning ("IL2091")] + [ExpectedWarning ("IL2091", ProducedBy = ProducedBy.Trimmer | ProducedBy.NativeAot)] + static void TwoMismatchesInOneStatement< + [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicFields)] TPublicFields, + [DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] TPublicMethods> + () + { + Expression> a = () => IWithTwo.Property; + } + + public static void Test () + { + SpecificType (); + OneMatchingAnnotation (); + MultipleReferencesToTheSameProperty (); + TwoMismatchesInOneStatement (); + } + } + class CreateInstance { static void SpecificType () @@ -871,9 +1164,14 @@ public static void Test () TypeOf.Test (); MethodCallOnGenericMethod.Test (); MethodCallOnGenericType.Test (); + FieldAccessOnGenericType.Test (); LocalVariable.Test (); DelegateUsageOnGenericMethod.Test (); DelegateUsageOnGenericType.Test (); + LdTokenOnGenericMethod.Test (); + LdTokenOfMethodOnGenericType.Test (); + LdTokenOfFieldOnGenericType.Test (); + LdTokenOfPropertyOnGenericType.Test (); CreateInstance.Test (); IsInstance.Test (); AsType.Test (); From 1b8d340af33c218060b9dfc9ba5c7f96296a392a Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 20 Jan 2023 09:44:30 -0800 Subject: [PATCH 2/5] Add cecil projects to sln (dotnet/linker#3188) Commit migrated from https://github.com/dotnet/linker/commit/6381e0b1008fd50a64fff3b8cd047e1e28d7b4b8 --- src/tools/illink/illink.sln | 54 +++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 8 deletions(-) diff --git a/src/tools/illink/illink.sln b/src/tools/illink/illink.sln index 9e29ce206c9a25..5cf19d14719c69 100644 --- a/src/tools/illink/illink.sln +++ b/src/tools/illink/illink.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30524.135 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33209.295 MinimumVisualStudioVersion = 15.0.26124.0 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mono.Linker", "src\linker\Mono.Linker.csproj", "{DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46}" EndProject @@ -33,16 +33,21 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "tlens", "src\tlens\tlens.cs EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILLink.CodeFixProvider", "src\ILLink.CodeFix\ILLink.CodeFixProvider.csproj", "{6D20F334-B7E4-4585-854B-8A0E2B29B4AA}" EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ILLink.Shared", "src\ILLink.Shared\ILLink.Shared.shproj", "{92F5E753-2179-46DC-BDCE-736858C18DC7}" +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ILLink.Shared", "src\ILLink.Shared\ILLink.Shared.shproj", "{FF598E93-8E9E-4091-9F50-61A7572663AE}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILLink.RoslynAnalyzer.Tests.Generator", "test\ILLink.RoslynAnalyzer.Tests.Generator\ILLink.RoslynAnalyzer.Tests.Generator.csproj", "{3DDE7064-4B68-4979-8843-FDF4CE5A5140}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "external", "external", "{8FD57ADB-B449-4960-A141-845C1E2E26EC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil", "external\cecil\Mono.Cecil.csproj", "{7C068318-84AF-4861-9E5F-6F8A3BF38C9D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cecil", "cecil", "{223B8007-F26C-4E28-B28D-E43C97F7EE23}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "symbols", "symbols", "{19C783E3-B710-4F25-A977-0ADDA4D2CFEE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil.Pdb", "external\cecil\symbols\pdb\Mono.Cecil.Pdb.csproj", "{AF7722A0-D1A7-4294-A181-B88B6BD67C6E}" +EndProject Global - GlobalSection(SharedMSBuildProjectFiles) = preSolution - src\ILLink.Shared\ILLink.Shared.projitems*{92f5e753-2179-46dc-bdce-736858c18dc7}*SharedItemsImports = 13 - src\ILLink.Shared\ILLink.Shared.projitems*{dd28e2b1-057b-4b4d-a04d-b2ebd9e76e46}*SharedItemsImports = 5 - src\ILLink.Shared\ILLink.Shared.projitems*{f1a44a78-34ee-408b-8285-9a26f0e7d4f2}*SharedItemsImports = 5 - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 @@ -208,6 +213,30 @@ Global {3DDE7064-4B68-4979-8843-FDF4CE5A5140}.Release|x64.Build.0 = Release|Any CPU {3DDE7064-4B68-4979-8843-FDF4CE5A5140}.Release|x86.ActiveCfg = Release|Any CPU {3DDE7064-4B68-4979-8843-FDF4CE5A5140}.Release|x86.Build.0 = Release|Any CPU + {7C068318-84AF-4861-9E5F-6F8A3BF38C9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7C068318-84AF-4861-9E5F-6F8A3BF38C9D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7C068318-84AF-4861-9E5F-6F8A3BF38C9D}.Debug|x64.ActiveCfg = Debug|Any CPU + {7C068318-84AF-4861-9E5F-6F8A3BF38C9D}.Debug|x64.Build.0 = Debug|Any CPU + {7C068318-84AF-4861-9E5F-6F8A3BF38C9D}.Debug|x86.ActiveCfg = Debug|Any CPU + {7C068318-84AF-4861-9E5F-6F8A3BF38C9D}.Debug|x86.Build.0 = Debug|Any CPU + {7C068318-84AF-4861-9E5F-6F8A3BF38C9D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7C068318-84AF-4861-9E5F-6F8A3BF38C9D}.Release|Any CPU.Build.0 = Release|Any CPU + {7C068318-84AF-4861-9E5F-6F8A3BF38C9D}.Release|x64.ActiveCfg = Release|Any CPU + {7C068318-84AF-4861-9E5F-6F8A3BF38C9D}.Release|x64.Build.0 = Release|Any CPU + {7C068318-84AF-4861-9E5F-6F8A3BF38C9D}.Release|x86.ActiveCfg = Release|Any CPU + {7C068318-84AF-4861-9E5F-6F8A3BF38C9D}.Release|x86.Build.0 = Release|Any CPU + {AF7722A0-D1A7-4294-A181-B88B6BD67C6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AF7722A0-D1A7-4294-A181-B88B6BD67C6E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AF7722A0-D1A7-4294-A181-B88B6BD67C6E}.Debug|x64.ActiveCfg = Debug|Any CPU + {AF7722A0-D1A7-4294-A181-B88B6BD67C6E}.Debug|x64.Build.0 = Debug|Any CPU + {AF7722A0-D1A7-4294-A181-B88B6BD67C6E}.Debug|x86.ActiveCfg = Debug|Any CPU + {AF7722A0-D1A7-4294-A181-B88B6BD67C6E}.Debug|x86.Build.0 = Debug|Any CPU + {AF7722A0-D1A7-4294-A181-B88B6BD67C6E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AF7722A0-D1A7-4294-A181-B88B6BD67C6E}.Release|Any CPU.Build.0 = Release|Any CPU + {AF7722A0-D1A7-4294-A181-B88B6BD67C6E}.Release|x64.ActiveCfg = Release|Any CPU + {AF7722A0-D1A7-4294-A181-B88B6BD67C6E}.Release|x64.Build.0 = Release|Any CPU + {AF7722A0-D1A7-4294-A181-B88B6BD67C6E}.Release|x86.ActiveCfg = Release|Any CPU + {AF7722A0-D1A7-4294-A181-B88B6BD67C6E}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -223,8 +252,17 @@ Global {8DA71B3B-5809-44E5-A018-5DE5C6FF6C2A} = {03EB085F-3E2E-4A68-A7DF-951ADF59A0CC} {6D20F334-B7E4-4585-854B-8A0E2B29B4AA} = {AA0569FB-73E9-4B42-9A19-714BB1229DAE} {3DDE7064-4B68-4979-8843-FDF4CE5A5140} = {C2969923-7BAA-4FE4-853C-F670B0D3C6C8} + {7C068318-84AF-4861-9E5F-6F8A3BF38C9D} = {8FD57ADB-B449-4960-A141-845C1E2E26EC} + {223B8007-F26C-4E28-B28D-E43C97F7EE23} = {8FD57ADB-B449-4960-A141-845C1E2E26EC} + {19C783E3-B710-4F25-A977-0ADDA4D2CFEE} = {223B8007-F26C-4E28-B28D-E43C97F7EE23} + {AF7722A0-D1A7-4294-A181-B88B6BD67C6E} = {19C783E3-B710-4F25-A977-0ADDA4D2CFEE} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {E43A3901-42B0-48CA-BB36-5CD40A99A6EE} EndGlobalSection + GlobalSection(SharedMSBuildProjectFiles) = preSolution + src\ILLink.Shared\ILLink.Shared.projitems*{dd28e2b1-057b-4b4d-a04d-b2ebd9e76e46}*SharedItemsImports = 5 + src\ILLink.Shared\ILLink.Shared.projitems*{f1a44a78-34ee-408b-8285-9a26f0e7d4f2}*SharedItemsImports = 5 + src\ILLink.Shared\ILLink.Shared.projitems*{ff598e93-8e9e-4091-9f50-61a7572663ae}*SharedItemsImports = 13 + EndGlobalSection EndGlobal From d78e9ef7742204c255b7e99bf9bc6355f5a48aee Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 17:26:42 +0000 Subject: [PATCH 3/5] [main] Update dependencies from dotnet/arcade (dotnet/linker#3177) [main] Update dependencies from dotnet/arcade - Analyzer fix - Update to net8 - Update import order - Add net8 handling - Analyzer fixes - Merge branch 'main' into darc-main-328ee272-9fb8-4717-bae0-5575b14d7744 - More analyzer fixes - Port fix from runtime - Update failing test - verbose test - Fix formatting - Fix the task to look for net8.0 location. Revert test changes. - Workaround a possible issue in the new SDK Commit migrated from https://github.com/dotnet/linker/commit/2bd23e198227c95774ce9068ed94f617843212fd --- src/tools/illink/Directory.Build.props | 10 ++--- src/tools/illink/NuGet.config | 1 + src/tools/illink/eng/Version.Details.xml | 8 ++-- src/tools/illink/eng/Versions.props | 4 +- .../illink/eng/common/cross/build-rootfs.sh | 18 +++++--- .../illink/eng/common/generate-locproject.ps1 | 45 ++++++++++++++++++- .../illink/eng/common/templates/job/job.yml | 10 +++++ .../templates/job/source-index-stage1.yml | 6 +-- .../templates/variables/pool-providers.yml | 4 +- src/tools/illink/eng/common/tools.ps1 | 4 +- src/tools/illink/eng/common/tools.sh | 4 +- src/tools/illink/global.json | 6 +-- .../DynamicallyAccessedMembersAnalyzer.cs | 2 +- .../TrimAnalysis/ParameterProxy.cs | 2 +- .../DataFlow/DefaultValueDictionary.cs | 3 ++ .../ILLink.Shared/DataFlow/MaybeLattice.cs | 3 ++ .../src/ILLink.Shared/DataFlow/ValueSet.cs | 3 ++ .../TypeSystemProxy/WellKnownType.cs | 1 + .../src/ILLink.Tasks/ILLink.Tasks.csproj | 2 + src/tools/illink/src/ILLink.Tasks/LinkTask.cs | 2 +- .../linker/Linker.Dataflow/HoistedLocalKey.cs | 3 ++ .../src/linker/Linker.Dataflow/ValueNode.cs | 3 ++ .../illink/src/linker/Mono.Linker.csproj | 2 + .../RequiresAssemblyFilesAnalyzerTests.cs | 4 ++ .../TestCaseUtils.cs | 6 +-- .../Verifiers/CSharpAnalyzerVerifier`1.cs | 4 +- .../ExpectedInstructionSequenceAttribute.cs | 3 +- ...tionSequenceOnMemberInAssemblyAttribute.cs | 9 ++-- .../ExpectedLocalsSequenceAttribute.cs | 6 +-- .../Assertions/IgnoreTestCaseAttribute.cs | 3 +- .../Assertions/KeptAttributeAttribute.cs | 3 +- ...KeptAttributeOnFixedBufferTypeAttribute.cs | 3 +- .../KeptBaseOnTypeInAssemblyAttribute.cs | 3 +- .../Assertions/KeptBaseTypeAttribute.cs | 9 ++-- .../Assertions/KeptExportedTypeAttribute.cs | 3 +- .../Assertions/KeptInitializerData.cs | 3 +- .../Assertions/KeptInterfaceAttribute.cs | 9 ++-- .../KeptInterfaceOnTypeInAssemblyAttribute.cs | 3 +- .../KeptMemberInAssemblyAttribute.cs | 12 ++--- .../Assertions/KeptOverrideAttribute.cs | 3 +- .../KeptReferencesInAssemblyAttribute.cs | 3 +- .../Assertions/KeptSecurityAttribute.cs | 3 +- .../Assertions/KeptTypeInAssemblyAttribute.cs | 3 +- ...movedInterfaceOnTypeInAssemblyAttribute.cs | 3 +- .../RemovedMemberInAssemblyAttribute.cs | 12 ++--- .../RemovedTypeInAssemblyAttribute.cs | 3 +- .../TestCaseRequirementsAttribute.cs | 3 +- .../Metadata/SetupCompileAfterAttribute.cs | 3 +- .../Metadata/SetupCompileBeforeAttribute.cs | 6 +-- .../Mono.Linker.Tests/Extensions/NiceIO.cs | 3 +- .../TestCasesRunner/AssemblyChecker.cs | 2 +- .../TestCasesRunner/PathUtilities.cs | 4 +- .../TestCasesRunner/TestCaseCompiler.cs | 4 +- 53 files changed, 165 insertions(+), 119 deletions(-) diff --git a/src/tools/illink/Directory.Build.props b/src/tools/illink/Directory.Build.props index fd92a0f7f46458..f80f6f9039258d 100644 --- a/src/tools/illink/Directory.Build.props +++ b/src/tools/illink/Directory.Build.props @@ -1,14 +1,17 @@ + + + false true true - net7.0 + $(NetCurrent) - net7.0 + $(NetCurrent) true @@ -18,9 +21,6 @@ false false - - - false MIT diff --git a/src/tools/illink/NuGet.config b/src/tools/illink/NuGet.config index e50a0328b5ff6e..3ea744d2973352 100644 --- a/src/tools/illink/NuGet.config +++ b/src/tools/illink/NuGet.config @@ -6,6 +6,7 @@ + diff --git a/src/tools/illink/eng/Version.Details.xml b/src/tools/illink/eng/Version.Details.xml index fd8cf6a393bdad..cca31d3301159c 100644 --- a/src/tools/illink/eng/Version.Details.xml +++ b/src/tools/illink/eng/Version.Details.xml @@ -3,14 +3,14 @@ - + https://github.com/dotnet/arcade - e82404fca08383513e0b0b3c5308d4a9b18b7c7a + 3600aa80a01e90f38a7b86b9d7c1264e091aa5a8 - + https://github.com/dotnet/arcade - e82404fca08383513e0b0b3c5308d4a9b18b7c7a + 3600aa80a01e90f38a7b86b9d7c1264e091aa5a8 https://github.com/dotnet/runtime diff --git a/src/tools/illink/eng/Versions.props b/src/tools/illink/eng/Versions.props index 21861f23f41790..a4efb9fe852717 100644 --- a/src/tools/illink/eng/Versions.props +++ b/src/tools/illink/eng/Versions.props @@ -18,14 +18,14 @@ 5.0.0 17.0.0-preview-21267-01 17.0.0-preview-21267-01 - 8.0.0-beta.22630.1 + 8.0.0-beta.23067.5 6.0.0-beta.21271.1 3.10.0-2.final 4.5.0-1.22517.9 $(MicrosoftCodeAnalysisVersion) 1.0.1-beta1.* 3.3.2 - 7.0.0-preview.7.22375.6 + 8.0.0-alpha.1.23067.11 diff --git a/src/tools/illink/eng/common/cross/build-rootfs.sh b/src/tools/illink/eng/common/cross/build-rootfs.sh index b04d3b3806575f..1ebf454f3cf284 100755 --- a/src/tools/illink/eng/common/cross/build-rootfs.sh +++ b/src/tools/illink/eng/common/cross/build-rootfs.sh @@ -48,12 +48,14 @@ __UbuntuPackages+=" symlinks" __UbuntuPackages+=" libicu-dev" __UbuntuPackages+=" liblttng-ust-dev" __UbuntuPackages+=" libunwind8-dev" +__UbuntuPackages+=" libnuma-dev" __AlpinePackages+=" gettext-dev" __AlpinePackages+=" icu-dev" __AlpinePackages+=" libunwind-dev" __AlpinePackages+=" lttng-ust-dev" __AlpinePackages+=" compiler-rt-static" +__AlpinePackages+=" numactl-dev" # runtime libraries' dependencies __UbuntuPackages+=" libcurl4-openssl-dev" @@ -147,9 +149,9 @@ while :; do __BuildArch=ppc64le __UbuntuArch=ppc64el __UbuntuRepo="http://ports.ubuntu.com/ubuntu-ports/" - __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libunwind8-dev//') - __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libomp-dev//') - __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libomp5//') + __UbuntuPackages="${__UbuntuPackages// libunwind8-dev/}" + __UbuntuPackages="${__UbuntuPackages// libomp-dev/}" + __UbuntuPackages="${__UbuntuPackages// libomp5/}" unset __LLDB_Package ;; riscv64) @@ -157,7 +159,7 @@ while :; do __UbuntuArch=riscv64 __UbuntuRepo="http://deb.debian.org/debian-ports" __CodeName=sid - __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libunwind8-dev//') + __UbuntuPackages="${__UbuntuPackages// libunwind8-dev/}" unset __LLDB_Package if [[ -e "/usr/share/keyrings/debian-ports-archive-keyring.gpg" ]]; then @@ -168,9 +170,9 @@ while :; do __BuildArch=s390x __UbuntuArch=s390x __UbuntuRepo="http://ports.ubuntu.com/ubuntu-ports/" - __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libunwind8-dev//') - __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libomp-dev//') - __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libomp5//') + __UbuntuPackages="${__UbuntuPackages// libunwind8-dev/}" + __UbuntuPackages="${__UbuntuPackages// libomp-dev/}" + __UbuntuPackages="${__UbuntuPackages// libomp5/}" unset __LLDB_Package ;; x64) @@ -310,6 +312,8 @@ done if [[ "$__BuildArch" == "armel" ]]; then __LLDB_Package="lldb-3.5-dev" +elif [[ "$__BuildArch" == "arm" && "$__AlpineVersion" == "3.13" ]]; then + __AlpinePackages="${__AlpinePackages//numactl-dev/}" fi __UbuntuPackages+=" ${__LLDB_Package:-}" diff --git a/src/tools/illink/eng/common/generate-locproject.ps1 b/src/tools/illink/eng/common/generate-locproject.ps1 index dbf2ab4ee7d17b..69e65eeae7de04 100644 --- a/src/tools/illink/eng/common/generate-locproject.ps1 +++ b/src/tools/illink/eng/common/generate-locproject.ps1 @@ -34,6 +34,25 @@ $jsonTemplateFiles | ForEach-Object { $jsonWinformsTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\\strings\.json" } # current winforms pattern $wxlFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\\.+\.wxl" -And -Not( $_.Directory.Name -Match "\d{4}" ) } # localized files live in four digit lang ID directories; this excludes them +if (-not $wxlFiles) { + $wxlEnFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\\1033\\.+\.wxl" } # pick up en files (1033 = en) specifically so we can copy them to use as the neutral xlf files + if ($wxlEnFiles) { + $wxlFiles = @() + $wxlEnFiles | ForEach-Object { + $destinationFile = "$($_.Directory.Parent.FullName)\$($_.Name)" + $wxlFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru + } + } +} + +$macosHtmlEnFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\.lproj\\.+\.html" } # add installer HTML files +$macosHtmlFiles = @() +if ($macosHtmlEnFiles) { + $macosHtmlEnFiles | ForEach-Object { + $destinationFile = "$($_.Directory.Parent.FullName)\$($_.Name)" + $macosHtmlFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru + } +} $xlfFiles = @() @@ -99,8 +118,7 @@ $locJson = @{ $outputPath = "$($_.Directory.FullName | Resolve-Path -Relative)\" $continue = $true foreach ($exclusion in $exclusions.Exclusions) { - if ($_.FullName.Contains($exclusion)) - { + if ($_.FullName.Contains($exclusion)) { $continue = $false } } @@ -115,6 +133,29 @@ $locJson = @{ } } ) + }, + @{ + LanguageSet = $LanguageSet + CloneLanguageSet = "VS_macOS_CloneLanguages" + LocItems = @( + $macosHtmlFiles | ForEach-Object { + $outputPath = "$($_.Directory.FullName | Resolve-Path -Relative)\" + $continue = $true + foreach ($exclusion in $exclusions.Exclusions) { + if ($_.FullName.Contains($exclusion)) { + $continue = $false + } + } + $sourceFile = ($_.FullName | Resolve-Path -Relative) + if ($continue) { + return @{ + SourceFile = $sourceFile + CopyOption = "LangIDOnPath" + OutputPath = $outputPath + } + } + } + ) } ) } diff --git a/src/tools/illink/eng/common/templates/job/job.yml b/src/tools/illink/eng/common/templates/job/job.yml index 0549e4c71ce3e0..f0af425d9f68a8 100644 --- a/src/tools/illink/eng/common/templates/job/job.yml +++ b/src/tools/illink/eng/common/templates/job/job.yml @@ -88,6 +88,16 @@ jobs: - ${{ if ne(variable.group, '') }}: - group: ${{ variable.group }} + # handle template variable syntax + # example: + # - template: path/to/template.yml + # parameters: + # [key]: [value] + - ${{ if ne(variable.template, '') }}: + - template: ${{ variable.template }} + ${{ if ne(variable.parameters, '') }}: + parameters: ${{ variable.parameters }} + # handle key-value variable syntax. # example: # - [key]: [value] diff --git a/src/tools/illink/eng/common/templates/job/source-index-stage1.yml b/src/tools/illink/eng/common/templates/job/source-index-stage1.yml index 09c506d11855db..71b66aeb8a5c5d 100644 --- a/src/tools/illink/eng/common/templates/job/source-index-stage1.yml +++ b/src/tools/illink/eng/common/templates/job/source-index-stage1.yml @@ -1,6 +1,6 @@ parameters: runAsPublic: false - sourceIndexPackageVersion: 1.0.1-20220804.1 + sourceIndexPackageVersion: 1.0.1-20221220.2 sourceIndexPackageSource: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json sourceIndexBuildCommand: powershell -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "eng/common/build.ps1 -restore -build -binarylog -ci" preSteps: [] @@ -40,10 +40,10 @@ jobs: - ${{ preStep }} - task: UseDotNet@2 - displayName: Use .NET Core sdk 3.1 + displayName: Use .NET Core SDK 6 inputs: packageType: sdk - version: 3.1.x + version: 6.0.x installationPath: $(Agent.TempDirectory)/dotnet workingDirectory: $(Agent.TempDirectory) diff --git a/src/tools/illink/eng/common/templates/variables/pool-providers.yml b/src/tools/illink/eng/common/templates/variables/pool-providers.yml index a7b943c2fa4c1a..1b820b41605779 100644 --- a/src/tools/illink/eng/common/templates/variables/pool-providers.yml +++ b/src/tools/illink/eng/common/templates/variables/pool-providers.yml @@ -16,7 +16,7 @@ # First, import the template in an arcade-ified repo to pick up the variables, e.g.: # # variables: -# - template: eng/common/templates/variables/pool-providers.yml +# - template: /eng/common/templates/variables/pool-providers.yml # # ... then anywhere specifying the pool provider use the runtime variables, # $(DncEngInternalBuildPool) and $ (DncEngPublicBuildPool), e.g.: @@ -45,4 +45,4 @@ variables: - name: DncEngPublicBuildPool value: NetCore-Svc-Public - name: DncEngInternalBuildPool - value: NetCore1ESPool-Svc-Internal \ No newline at end of file + value: NetCore1ESPool-Svc-Internal diff --git a/src/tools/illink/eng/common/tools.ps1 b/src/tools/illink/eng/common/tools.ps1 index 1a8c16c56e566b..7caacc6de2e1f9 100644 --- a/src/tools/illink/eng/common/tools.ps1 +++ b/src/tools/illink/eng/common/tools.ps1 @@ -581,7 +581,7 @@ function InitializeBuildTool() { ExitWithExitCode 1 } $dotnetPath = Join-Path $dotnetRoot (GetExecutableFileName 'dotnet') - $buildTool = @{ Path = $dotnetPath; Command = 'msbuild'; Tool = 'dotnet'; Framework = 'net7.0' } + $buildTool = @{ Path = $dotnetPath; Command = 'msbuild'; Tool = 'dotnet'; Framework = 'net8.0' } } elseif ($msbuildEngine -eq "vs") { try { $msbuildPath = InitializeVisualStudioMSBuild -install:$restore @@ -743,6 +743,8 @@ function MSBuild() { (Join-Path $basePath (Join-Path netcoreapp2.1 'Microsoft.DotNet.Arcade.Sdk.dll')) (Join-Path $basePath (Join-Path netcoreapp3.1 'Microsoft.DotNet.ArcadeLogging.dll')), (Join-Path $basePath (Join-Path netcoreapp3.1 'Microsoft.DotNet.Arcade.Sdk.dll')) + (Join-Path $basePath (Join-Path net7.0 'Microsoft.DotNet.ArcadeLogging.dll')), + (Join-Path $basePath (Join-Path net7.0 'Microsoft.DotNet.Arcade.Sdk.dll')) ) $selectedPath = $null foreach ($path in $possiblePaths) { diff --git a/src/tools/illink/eng/common/tools.sh b/src/tools/illink/eng/common/tools.sh index 2f27d7453cd495..cf9fb1ea2d32b5 100755 --- a/src/tools/illink/eng/common/tools.sh +++ b/src/tools/illink/eng/common/tools.sh @@ -312,7 +312,7 @@ function InitializeBuildTool { # return values _InitializeBuildTool="$_InitializeDotNetCli/dotnet" _InitializeBuildToolCommand="msbuild" - _InitializeBuildToolFramework="net7.0" + _InitializeBuildToolFramework="net8.0" } # Set RestoreNoCache as a workaround for https://github.com/NuGet/Home/issues/3116 @@ -428,6 +428,8 @@ function MSBuild { possiblePaths+=( "$toolset_dir/netcoreapp2.1/Microsoft.DotNet.Arcade.Sdk.dll" ) possiblePaths+=( "$toolset_dir/netcoreapp3.1/Microsoft.DotNet.ArcadeLogging.dll" ) possiblePaths+=( "$toolset_dir/netcoreapp3.1/Microsoft.DotNet.Arcade.Sdk.dll" ) + possiblePaths+=( "$toolset_dir/net7.0/Microsoft.DotNet.ArcadeLogging.dll" ) + possiblePaths+=( "$toolset_dir/net7.0/Microsoft.DotNet.Arcade.Sdk.dll" ) for path in "${possiblePaths[@]}"; do if [[ -f $path ]]; then selectedPath=$path diff --git a/src/tools/illink/global.json b/src/tools/illink/global.json index 06e0b987ce9c14..c752cf9f674437 100644 --- a/src/tools/illink/global.json +++ b/src/tools/illink/global.json @@ -1,14 +1,14 @@ { "sdk": { - "version": "7.0.100", + "version": "8.0.100-alpha.1.23061.8", "allowPrerelease": true, "rollForward": "major" }, "tools": { - "dotnet": "7.0.100" + "dotnet": "8.0.100-alpha.1.23061.8" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.22630.1", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23067.5", "Microsoft.FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", "Microsoft.NET.Sdk.IL": "7.0.0-rtm.22507.1" } diff --git a/src/tools/illink/src/ILLink.RoslynAnalyzer/DynamicallyAccessedMembersAnalyzer.cs b/src/tools/illink/src/ILLink.RoslynAnalyzer/DynamicallyAccessedMembersAnalyzer.cs index 1c8ee148389c95..b372d4f3fdce11 100644 --- a/src/tools/illink/src/ILLink.RoslynAnalyzer/DynamicallyAccessedMembersAnalyzer.cs +++ b/src/tools/illink/src/ILLink.RoslynAnalyzer/DynamicallyAccessedMembersAnalyzer.cs @@ -164,7 +164,7 @@ invocationExpression.Expression is IdentifierNameSyntax ident1 && } } - static IEnumerable GetDynamicallyAccessedMembersDiagnostics (SingleValue sourceValue, SingleValue targetValue, Location location) + static List GetDynamicallyAccessedMembersDiagnostics (SingleValue sourceValue, SingleValue targetValue, Location location) { // The target should always be an annotated value, but the visitor design currently prevents // declaring this in the type system. diff --git a/src/tools/illink/src/ILLink.RoslynAnalyzer/TrimAnalysis/ParameterProxy.cs b/src/tools/illink/src/ILLink.RoslynAnalyzer/TrimAnalysis/ParameterProxy.cs index fe01aeaf5187ae..27b47d4f3b4e98 100644 --- a/src/tools/illink/src/ILLink.RoslynAnalyzer/TrimAnalysis/ParameterProxy.cs +++ b/src/tools/illink/src/ILLink.RoslynAnalyzer/TrimAnalysis/ParameterProxy.cs @@ -11,7 +11,7 @@ partial struct ParameterProxy { public ParameterProxy (IParameterSymbol parameter) { - Method = (new ((IMethodSymbol) parameter.ContainingSymbol)); + Method = new ((IMethodSymbol) parameter.ContainingSymbol); Index = (ParameterIndex) parameter.Ordinal + (Method.HasImplicitThis () ? 1 : 0); } diff --git a/src/tools/illink/src/ILLink.Shared/DataFlow/DefaultValueDictionary.cs b/src/tools/illink/src/ILLink.Shared/DataFlow/DefaultValueDictionary.cs index 599e7d3b9871c5..0c2ce21ad67018 100644 --- a/src/tools/illink/src/ILLink.Shared/DataFlow/DefaultValueDictionary.cs +++ b/src/tools/illink/src/ILLink.Shared/DataFlow/DefaultValueDictionary.cs @@ -108,5 +108,8 @@ public DefaultValueDictionary Clone () // Prevent warning CS0659 https://docs.microsoft.com/en-us/dotnet/csharp/misc/cs0659. // This type should never be used as a dictionary key. public override int GetHashCode () => throw new NotImplementedException (); + + public static bool operator == (DefaultValueDictionary left, DefaultValueDictionary right) => left.Equals (right); + public static bool operator != (DefaultValueDictionary left, DefaultValueDictionary right) => !(left == right); } } diff --git a/src/tools/illink/src/ILLink.Shared/DataFlow/MaybeLattice.cs b/src/tools/illink/src/ILLink.Shared/DataFlow/MaybeLattice.cs index 4e77f96347ef0a..6c2e6d60309c1b 100644 --- a/src/tools/illink/src/ILLink.Shared/DataFlow/MaybeLattice.cs +++ b/src/tools/illink/src/ILLink.Shared/DataFlow/MaybeLattice.cs @@ -26,6 +26,9 @@ public Maybe Clone () return new (copyValue.DeepCopy ()); return new (value); } + + public static bool operator == (Maybe left, Maybe right) => left.Equals (right); + public static bool operator != (Maybe left, Maybe right) => !(left == right); } public struct MaybeLattice : ILattice> diff --git a/src/tools/illink/src/ILLink.Shared/DataFlow/ValueSet.cs b/src/tools/illink/src/ILLink.Shared/DataFlow/ValueSet.cs index c47397d5af258a..d4d5af4a362c69 100644 --- a/src/tools/illink/src/ILLink.Shared/DataFlow/ValueSet.cs +++ b/src/tools/illink/src/ILLink.Shared/DataFlow/ValueSet.cs @@ -120,6 +120,9 @@ public bool Equals (ValueSet other) } } + public static bool operator == (ValueSet left, ValueSet right) => left.Equals (right); + public static bool operator != (ValueSet left, ValueSet right) => !(left == right); + public override int GetHashCode () { if (_values == null) diff --git a/src/tools/illink/src/ILLink.Shared/TypeSystemProxy/WellKnownType.cs b/src/tools/illink/src/ILLink.Shared/TypeSystemProxy/WellKnownType.cs index 999f8f4dc95f2a..d673f5c0b3e242 100644 --- a/src/tools/illink/src/ILLink.Shared/TypeSystemProxy/WellKnownType.cs +++ b/src/tools/illink/src/ILLink.Shared/TypeSystemProxy/WellKnownType.cs @@ -38,6 +38,7 @@ public static (string Namespace, string Name) GetNamespaceAndName (this WellKnow WellKnownType.System_NotSupportedException => ("System", "NotSupportedException"), WellKnownType.System_Runtime_CompilerServices_DisablePrivateReflectionAttribute => ("System.Runtime.CompilerServices", "DisablePrivateReflectionAttribute"), WellKnownType.System_Void => ("System", "Void"), + _ => throw new System.ArgumentException (type.ToString ()) }; } public static string GetNamespace (this WellKnownType type) => GetNamespaceAndName (type).Namespace; diff --git a/src/tools/illink/src/ILLink.Tasks/ILLink.Tasks.csproj b/src/tools/illink/src/ILLink.Tasks/ILLink.Tasks.csproj index bd69b155788b08..8d82be6429b9b5 100644 --- a/src/tools/illink/src/ILLink.Tasks/ILLink.Tasks.csproj +++ b/src/tools/illink/src/ILLink.Tasks/ILLink.Tasks.csproj @@ -22,6 +22,8 @@ disable $(NoWarn);NU5129 + + true diff --git a/src/tools/illink/src/ILLink.Tasks/LinkTask.cs b/src/tools/illink/src/ILLink.Tasks/LinkTask.cs index b89b893be681da..256bc4e51e3bbe 100644 --- a/src/tools/illink/src/ILLink.Tasks/LinkTask.cs +++ b/src/tools/illink/src/ILLink.Tasks/LinkTask.cs @@ -260,7 +260,7 @@ public string ILLinkPath { var taskDirectory = Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location); // The linker always runs on .NET Core, even when using desktop MSBuild to host ILLink.Tasks. - _illinkPath = Path.Combine (Path.GetDirectoryName (taskDirectory), "net7.0", "illink.dll"); + _illinkPath = Path.Combine (Path.GetDirectoryName (taskDirectory), "net8.0", "illink.dll"); return _illinkPath; } set => _illinkPath = value; diff --git a/src/tools/illink/src/linker/Linker.Dataflow/HoistedLocalKey.cs b/src/tools/illink/src/linker/Linker.Dataflow/HoistedLocalKey.cs index b721df288b408b..503bdc6bbb840e 100644 --- a/src/tools/illink/src/linker/Linker.Dataflow/HoistedLocalKey.cs +++ b/src/tools/illink/src/linker/Linker.Dataflow/HoistedLocalKey.cs @@ -26,5 +26,8 @@ public HoistedLocalKey (FieldDefinition field) public override bool Equals (object? obj) => obj is HoistedLocalKey other && Equals (other); public override int GetHashCode () => Field.GetHashCode (); + + public static bool operator == (HoistedLocalKey left, HoistedLocalKey right) => left.Equals (right); + public static bool operator != (HoistedLocalKey left, HoistedLocalKey right) => !(left == right); } } \ No newline at end of file diff --git a/src/tools/illink/src/linker/Linker.Dataflow/ValueNode.cs b/src/tools/illink/src/linker/Linker.Dataflow/ValueNode.cs index 81d5e0581c2f9f..3374ca3317af94 100644 --- a/src/tools/illink/src/linker/Linker.Dataflow/ValueNode.cs +++ b/src/tools/illink/src/linker/Linker.Dataflow/ValueNode.cs @@ -64,5 +64,8 @@ public ValueBasicBlockPair (MultiValue value, int basicBlockIndex) public override bool Equals (object? obj) => obj is ValueBasicBlockPair other && Equals (other); public override int GetHashCode () => HashUtils.Combine (Value.GetHashCode (), BasicBlockIndex); + + public static bool operator == (ValueBasicBlockPair left, ValueBasicBlockPair right) => left.Equals (right); + public static bool operator != (ValueBasicBlockPair left, ValueBasicBlockPair right) => !(left == right); } } diff --git a/src/tools/illink/src/linker/Mono.Linker.csproj b/src/tools/illink/src/linker/Mono.Linker.csproj index 6e6b5a002c308b..bb67a442d678ce 100644 --- a/src/tools/illink/src/linker/Mono.Linker.csproj +++ b/src/tools/illink/src/linker/Mono.Linker.csproj @@ -17,6 +17,8 @@ false $(NoWarn);CS8524 + + true diff --git a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/RequiresAssemblyFilesAnalyzerTests.cs b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/RequiresAssemblyFilesAnalyzerTests.cs index 6d4db46a46a452..89c8f461e3faf9 100644 --- a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/RequiresAssemblyFilesAnalyzerTests.cs +++ b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/RequiresAssemblyFilesAnalyzerTests.cs @@ -287,6 +287,10 @@ public void M() } """; return VerifyRequiresAssemblyFilesAnalyzer (src, + // (7,7): warning SYSLIB0044: 'AssemblyName.CodeBase' is obsolete: 'AssemblyName.CodeBase and AssemblyName.EscapedCodeBase are obsolete. Using them for loading an assembly is not supported.' + DiagnosticResult.CompilerWarning ("SYSLIB0044").WithSpan (7, 7, 7, 17).WithArguments ("System.Reflection.AssemblyName.CodeBase", "AssemblyName.CodeBase and AssemblyName.EscapedCodeBase are obsolete. Using them for loading an assembly is not supported."), + // (8,7): warning SYSLIB0044: 'AssemblyName.EscapedCodeBase' is obsolete: 'AssemblyName.CodeBase and AssemblyName.EscapedCodeBase are obsolete. Using them for loading an assembly is not supported.' + DiagnosticResult.CompilerWarning ("SYSLIB0044").WithSpan (8, 7, 8, 24).WithArguments ("System.Reflection.AssemblyName.EscapedCodeBase", "AssemblyName.CodeBase and AssemblyName.EscapedCodeBase are obsolete. Using them for loading an assembly is not supported."), // (7,7): warning IL3002: Using member 'System.Reflection.AssemblyName.CodeBase.get' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app. The code will return an empty string for assemblies embedded in a single-file app. VerifyCS.Diagnostic (DiagnosticId.RequiresAssemblyFiles).WithSpan (7, 7, 7, 17).WithArguments ("System.Reflection.AssemblyName.CodeBase.get", " The code will return an empty string for assemblies embedded in a single-file app.", ""), // (7,7): warning IL3000: 'System.Reflection.AssemblyName.CodeBase' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'. diff --git a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/TestCaseUtils.cs b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/TestCaseUtils.cs index 9c00b2773602c1..d24c939728730d 100644 --- a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/TestCaseUtils.cs +++ b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/TestCaseUtils.cs @@ -26,9 +26,9 @@ public abstract class TestCaseUtils public static readonly ReferenceAssemblies Net6PreviewAssemblies = new ReferenceAssemblies ( - "net7.0", - new PackageIdentity ("Microsoft.NETCore.App.Ref", "7.0.0-preview.5.22301.12"), - Path.Combine ("ref", "net7.0")) + "net8.0", + new PackageIdentity ("Microsoft.NETCore.App.Ref", "8.0.0-alpha.1.23060.19"), + Path.Combine ("ref", "net8.0")) .WithNuGetConfigFilePath (Path.Combine (TestCaseUtils.GetRepoRoot (), "NuGet.config")); private static ImmutableArray s_net6Refs; diff --git a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/Verifiers/CSharpAnalyzerVerifier`1.cs b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/Verifiers/CSharpAnalyzerVerifier`1.cs index 17e3a1fa27b7bf..32f60660d3fd7b 100644 --- a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/Verifiers/CSharpAnalyzerVerifier`1.cs +++ b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/Verifiers/CSharpAnalyzerVerifier`1.cs @@ -585,9 +585,7 @@ static bool IsMessageMatch (Diagnostic actual, ImmutableArray actualArgu public MatchQuality (int value) { - if (value < 0) { - throw new ArgumentOutOfRangeException (nameof (value)); - } + ArgumentOutOfRangeException.ThrowIfNegative (value); _value = value; } diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedInstructionSequenceAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedInstructionSequenceAttribute.cs index 35ead6966a4f62..101e1be0288cc1 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedInstructionSequenceAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedInstructionSequenceAttribute.cs @@ -10,8 +10,7 @@ public class ExpectedInstructionSequenceAttribute : BaseInAssemblyAttribute { public ExpectedInstructionSequenceAttribute (string[] opCodes) { - if (opCodes == null) - throw new ArgumentNullException (nameof (opCodes)); + ArgumentNullException.ThrowIfNull (opCodes); } } } \ No newline at end of file diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedInstructionSequenceOnMemberInAssemblyAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedInstructionSequenceOnMemberInAssemblyAttribute.cs index 899b979c5211e8..124bbab5bac753 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedInstructionSequenceOnMemberInAssemblyAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedInstructionSequenceOnMemberInAssemblyAttribute.cs @@ -12,12 +12,10 @@ public ExpectedInstructionSequenceOnMemberInAssemblyAttribute (string assemblyFi { if (string.IsNullOrEmpty (assemblyFileName)) throw new ArgumentNullException (nameof (assemblyFileName)); - if (type == null) - throw new ArgumentNullException (nameof (type)); + ArgumentNullException.ThrowIfNull (type); if (string.IsNullOrEmpty (memberName)) throw new ArgumentNullException (nameof (memberName)); - if (opCodes == null) - throw new ArgumentNullException (nameof (opCodes)); + ArgumentNullException.ThrowIfNull (opCodes); } public ExpectedInstructionSequenceOnMemberInAssemblyAttribute (string assemblyFileName, string typeName, string memberName, string[] opCodes) @@ -28,8 +26,7 @@ public ExpectedInstructionSequenceOnMemberInAssemblyAttribute (string assemblyFi throw new ArgumentNullException (nameof (typeName)); if (string.IsNullOrEmpty (memberName)) throw new ArgumentNullException (nameof (memberName)); - if (opCodes == null) - throw new ArgumentNullException (nameof (opCodes)); + ArgumentNullException.ThrowIfNull (opCodes); } } } \ No newline at end of file diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedLocalsSequenceAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedLocalsSequenceAttribute.cs index fdd3441b71f44f..2016d26a0dbd10 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedLocalsSequenceAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/ExpectedLocalsSequenceAttribute.cs @@ -10,14 +10,12 @@ public class ExpectedLocalsSequenceAttribute : BaseInAssemblyAttribute { public ExpectedLocalsSequenceAttribute (string[] types) { - if (types == null) - throw new ArgumentNullException (nameof (types)); + ArgumentNullException.ThrowIfNull (types); } public ExpectedLocalsSequenceAttribute (Type[] types) { - if (types == null) - throw new ArgumentNullException (nameof (types)); + ArgumentNullException.ThrowIfNull (types); } } } \ No newline at end of file diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/IgnoreTestCaseAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/IgnoreTestCaseAttribute.cs index 78fd0e45374232..a9b11ebd3f32b5 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/IgnoreTestCaseAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/IgnoreTestCaseAttribute.cs @@ -11,8 +11,7 @@ public class IgnoreTestCaseAttribute : Attribute public IgnoreTestCaseAttribute (string reason) { - if (reason == null) - throw new ArgumentNullException (nameof (reason)); + ArgumentNullException.ThrowIfNull (reason); } } } \ No newline at end of file diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptAttributeAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptAttributeAttribute.cs index 0b5943a5a1a5e8..e558f304720aa9 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptAttributeAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptAttributeAttribute.cs @@ -17,8 +17,7 @@ public KeptAttributeAttribute (string attributeName) public KeptAttributeAttribute (Type type) { - if (type == null) - throw new ArgumentNullException (nameof (type)); + ArgumentNullException.ThrowIfNull (type); } } } diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptAttributeOnFixedBufferTypeAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptAttributeOnFixedBufferTypeAttribute.cs index 0fc56741a8ca42..559e81bdad164c 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptAttributeOnFixedBufferTypeAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptAttributeOnFixedBufferTypeAttribute.cs @@ -16,8 +16,7 @@ public KeptAttributeOnFixedBufferTypeAttribute (string attributeName) public KeptAttributeOnFixedBufferTypeAttribute (Type type) { - if (type == null) - throw new ArgumentNullException (nameof (type)); + ArgumentNullException.ThrowIfNull (type); } } } \ No newline at end of file diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptBaseOnTypeInAssemblyAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptBaseOnTypeInAssemblyAttribute.cs index acac5d575bbcea..5d454d806eec93 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptBaseOnTypeInAssemblyAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptBaseOnTypeInAssemblyAttribute.cs @@ -10,8 +10,7 @@ public class KeptBaseOnTypeInAssemblyAttribute : BaseInAssemblyAttribute { public KeptBaseOnTypeInAssemblyAttribute (string assemblyFileName, Type type, string baseAssemblyFileName, Type baseType) { - if (type == null) - throw new ArgumentNullException (nameof (type)); + ArgumentNullException.ThrowIfNull (type); if (string.IsNullOrEmpty (assemblyFileName)) throw new ArgumentException ("Value cannot be null or empty.", nameof (assemblyFileName)); diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptBaseTypeAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptBaseTypeAttribute.cs index c4e4a24889542c..c98ad9abcbe39c 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptBaseTypeAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptBaseTypeAttribute.cs @@ -10,16 +10,13 @@ public sealed class KeptBaseTypeAttribute : KeptAttribute { public KeptBaseTypeAttribute (Type baseType) { - if (baseType == null) - throw new ArgumentNullException (nameof (baseType)); + ArgumentNullException.ThrowIfNull (baseType); } public KeptBaseTypeAttribute (Type baseType, params object[] typeArguments) { - if (baseType == null) - throw new ArgumentNullException (nameof (baseType)); - if (typeArguments == null) - throw new ArgumentNullException (nameof (typeArguments)); + ArgumentNullException.ThrowIfNull (baseType); + ArgumentNullException.ThrowIfNull (typeArguments); } } } \ No newline at end of file diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptExportedTypeAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptExportedTypeAttribute.cs index 76dbe921c94572..2e4ba1903e1a7a 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptExportedTypeAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptExportedTypeAttribute.cs @@ -13,8 +13,7 @@ public class KeptExportedTypeAttribute : KeptAttribute { public KeptExportedTypeAttribute (Type type) { - if (type is null) - throw new ArgumentNullException (nameof (type)); + ArgumentNullException.ThrowIfNull (type); } } } diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptInitializerData.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptInitializerData.cs index 25b8c8261f16ce..9b98ef46e4515c 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptInitializerData.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptInitializerData.cs @@ -15,8 +15,7 @@ public KeptInitializerData () public KeptInitializerData (int occurrenceIndexInBody) { - if (occurrenceIndexInBody < 0) - throw new ArgumentOutOfRangeException (nameof (occurrenceIndexInBody)); + ArgumentOutOfRangeException.ThrowIfNegative (occurrenceIndexInBody); } } } \ No newline at end of file diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptInterfaceAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptInterfaceAttribute.cs index 85279abcd83f6d..abbf5784e99bfc 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptInterfaceAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptInterfaceAttribute.cs @@ -11,16 +11,13 @@ public class KeptInterfaceAttribute : KeptAttribute public KeptInterfaceAttribute (Type interfaceType) { - if (interfaceType == null) - throw new ArgumentNullException (nameof (interfaceType)); + ArgumentNullException.ThrowIfNull (interfaceType); } public KeptInterfaceAttribute (Type interfaceType, params object[] typeArguments) { - if (interfaceType == null) - throw new ArgumentNullException (nameof (interfaceType)); - if (typeArguments == null) - throw new ArgumentNullException (nameof (typeArguments)); + ArgumentNullException.ThrowIfNull (interfaceType); + ArgumentNullException.ThrowIfNull (typeArguments); } } } \ No newline at end of file diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptInterfaceOnTypeInAssemblyAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptInterfaceOnTypeInAssemblyAttribute.cs index 2741439facc88d..88bfd654ad75c3 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptInterfaceOnTypeInAssemblyAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptInterfaceOnTypeInAssemblyAttribute.cs @@ -10,8 +10,7 @@ public class KeptInterfaceOnTypeInAssemblyAttribute : BaseInAssemblyAttribute { public KeptInterfaceOnTypeInAssemblyAttribute (string assemblyFileName, Type type, string interfaceAssemblyFileName, Type interfaceType) { - if (type == null) - throw new ArgumentNullException (nameof (type)); + ArgumentNullException.ThrowIfNull (type); if (string.IsNullOrEmpty (assemblyFileName)) throw new ArgumentException ("Value cannot be null or empty.", nameof (assemblyFileName)); diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptMemberInAssemblyAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptMemberInAssemblyAttribute.cs index b8e38f5788c051..a756d8d24704f5 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptMemberInAssemblyAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptMemberInAssemblyAttribute.cs @@ -13,20 +13,16 @@ public KeptMemberInAssemblyAttribute (string assemblyFileName, Type type, params { if (string.IsNullOrEmpty (assemblyFileName)) throw new ArgumentNullException (nameof (assemblyFileName)); - if (type == null) - throw new ArgumentNullException (nameof (type)); - if (memberNames == null) - throw new ArgumentNullException (nameof (memberNames)); + ArgumentNullException.ThrowIfNull (type); + ArgumentNullException.ThrowIfNull (memberNames); } public KeptMemberInAssemblyAttribute (string assemblyFileName, string typeName, params string[] memberNames) { if (string.IsNullOrEmpty (assemblyFileName)) throw new ArgumentNullException (nameof (assemblyFileName)); - if (typeName == null) - throw new ArgumentNullException (nameof (typeName)); - if (memberNames == null) - throw new ArgumentNullException (nameof (memberNames)); + ArgumentNullException.ThrowIfNull (typeName); + ArgumentNullException.ThrowIfNull (memberNames); } public string ExpectationAssemblyName { get; set; } diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptOverrideAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptOverrideAttribute.cs index 62bfd0c157947e..3c02278ea91429 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptOverrideAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptOverrideAttribute.cs @@ -19,8 +19,7 @@ public class KeptOverrideAttribute : KeptAttribute public KeptOverrideAttribute (Type typeWithOverriddenMethod) { - if (typeWithOverriddenMethod == null) - throw new ArgumentNullException (nameof (typeWithOverriddenMethod)); + ArgumentNullException.ThrowIfNull (typeWithOverriddenMethod); TypeWithOverriddenMethodDeclaration = typeWithOverriddenMethod; } } diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptReferencesInAssemblyAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptReferencesInAssemblyAttribute.cs index 0265b9f3a40d9f..e046c3935df9bf 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptReferencesInAssemblyAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptReferencesInAssemblyAttribute.cs @@ -13,8 +13,7 @@ public KeptReferencesInAssemblyAttribute (string assemblyFileName, string[] expe if (string.IsNullOrEmpty (assemblyFileName)) throw new ArgumentNullException (nameof (assemblyFileName)); - if (expectedReferenceAssemblyNames == null) - throw new ArgumentNullException (nameof (expectedReferenceAssemblyNames)); + ArgumentNullException.ThrowIfNull (expectedReferenceAssemblyNames); } } } \ No newline at end of file diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptSecurityAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptSecurityAttribute.cs index 05519377252dc6..828bc4b64a0c3c 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptSecurityAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptSecurityAttribute.cs @@ -16,8 +16,7 @@ public KeptSecurityAttribute (string attributeName) public KeptSecurityAttribute (Type type) { - if (type == null) - throw new ArgumentNullException (nameof (type)); + ArgumentNullException.ThrowIfNull (type); } } } diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptTypeInAssemblyAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptTypeInAssemblyAttribute.cs index 5be0adc4aa1089..a9eb31c5bc81a0 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptTypeInAssemblyAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptTypeInAssemblyAttribute.cs @@ -10,8 +10,7 @@ public class KeptTypeInAssemblyAttribute : BaseInAssemblyAttribute { public KeptTypeInAssemblyAttribute (string assemblyFileName, Type type) { - if (type == null) - throw new ArgumentNullException (nameof (type)); + ArgumentNullException.ThrowIfNull (type); if (string.IsNullOrEmpty (assemblyFileName)) throw new ArgumentException ("Value cannot be null or empty.", nameof (assemblyFileName)); } diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedInterfaceOnTypeInAssemblyAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedInterfaceOnTypeInAssemblyAttribute.cs index 70465fc3d6035f..a733a9a1800865 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedInterfaceOnTypeInAssemblyAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedInterfaceOnTypeInAssemblyAttribute.cs @@ -10,8 +10,7 @@ public class RemovedInterfaceOnTypeInAssemblyAttribute : BaseInAssemblyAttribute { public RemovedInterfaceOnTypeInAssemblyAttribute (string assemblyFileName, Type type, string interfaceAssemblyFileName, Type interfaceType) { - if (type == null) - throw new ArgumentNullException (nameof (type)); + ArgumentNullException.ThrowIfNull (type); if (string.IsNullOrEmpty (assemblyFileName)) throw new ArgumentException ("Value cannot be null or empty.", nameof (assemblyFileName)); diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedMemberInAssemblyAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedMemberInAssemblyAttribute.cs index fe0deb6374aaf2..bd54db71ba8113 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedMemberInAssemblyAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedMemberInAssemblyAttribute.cs @@ -13,20 +13,16 @@ public RemovedMemberInAssemblyAttribute (string assemblyFileName, Type type, par { if (string.IsNullOrEmpty (assemblyFileName)) throw new ArgumentNullException (nameof (assemblyFileName)); - if (type == null) - throw new ArgumentNullException (nameof (type)); - if (memberNames == null) - throw new ArgumentNullException (nameof (memberNames)); + ArgumentNullException.ThrowIfNull (type); + ArgumentNullException.ThrowIfNull (memberNames); } public RemovedMemberInAssemblyAttribute (string assemblyFileName, string typeName, params string[] memberNames) { if (string.IsNullOrEmpty (assemblyFileName)) throw new ArgumentNullException (nameof (assemblyFileName)); - if (typeName == null) - throw new ArgumentNullException (nameof (typeName)); - if (memberNames == null) - throw new ArgumentNullException (nameof (memberNames)); + ArgumentNullException.ThrowIfNull (typeName); + ArgumentNullException.ThrowIfNull (memberNames); } } } diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedTypeInAssemblyAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedTypeInAssemblyAttribute.cs index 079ba5d1f0b7d2..fe98db51bfc0fd 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedTypeInAssemblyAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedTypeInAssemblyAttribute.cs @@ -10,8 +10,7 @@ public class RemovedTypeInAssemblyAttribute : BaseInAssemblyAttribute { public RemovedTypeInAssemblyAttribute (string assemblyFileName, Type type) { - if (type == null) - throw new ArgumentNullException (nameof (type)); + ArgumentNullException.ThrowIfNull (type); if (string.IsNullOrEmpty (assemblyFileName)) throw new ArgumentException ("Value cannot be null or empty.", nameof (assemblyFileName)); } diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/TestCaseRequirementsAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/TestCaseRequirementsAttribute.cs index 9e766c9ce05c67..caf60a23abe0fd 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/TestCaseRequirementsAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Assertions/TestCaseRequirementsAttribute.cs @@ -10,8 +10,7 @@ public class TestCaseRequirementsAttribute : BaseExpectedLinkedBehaviorAttribute { public TestCaseRequirementsAttribute (TestRunCharacteristics targetFrameworkCharacteristics, string reason) { - if (reason == null) - throw new ArgumentNullException (nameof (reason)); + ArgumentNullException.ThrowIfNull (reason); } } } diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupCompileAfterAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupCompileAfterAttribute.cs index 71f9f7a3854bb5..a81898225225b0 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupCompileAfterAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupCompileAfterAttribute.cs @@ -13,8 +13,7 @@ public class SetupCompileAfterAttribute : BaseMetadataAttribute { public SetupCompileAfterAttribute (string outputName, string[] sourceFiles, string[] references = null, string[] defines = null, object[] resources = null, string additionalArguments = null, string compilerToUse = null, bool addAsReference = true, bool removeFromLinkerInput = false) { - if (sourceFiles == null) - throw new ArgumentNullException (nameof (sourceFiles)); + ArgumentNullException.ThrowIfNull (sourceFiles); if (string.IsNullOrEmpty (outputName)) throw new ArgumentException ("Value cannot be null or empty.", nameof (outputName)); diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupCompileBeforeAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupCompileBeforeAttribute.cs index 0021300c8403ec..73e5c69c20ca05 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupCompileBeforeAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupCompileBeforeAttribute.cs @@ -13,8 +13,7 @@ public class SetupCompileBeforeAttribute : BaseMetadataAttribute { public SetupCompileBeforeAttribute (string outputName, string[] sourceFiles, string[] references = null, string[] defines = null, object[] resources = null, string additionalArguments = null, string compilerToUse = null, bool addAsReference = true, bool removeFromLinkerInput = false, string outputSubFolder = null) { - if (sourceFiles == null) - throw new ArgumentNullException (nameof (sourceFiles)); + ArgumentNullException.ThrowIfNull (sourceFiles); if (string.IsNullOrEmpty (outputName)) throw new ArgumentException ("Value cannot be null or empty.", nameof (outputName)); @@ -35,8 +34,7 @@ public SetupCompileBeforeAttribute (string outputName, string[] sourceFiles, str public SetupCompileBeforeAttribute (string outputName, Type[] typesToIncludeSourceFor, string[] references = null, string[] defines = null, object[] resources = null, string additionalArguments = null, string compilerToUse = null, bool addAsReference = true, bool removeFromLinkerInput = false) { - if (typesToIncludeSourceFor == null) - throw new ArgumentNullException (nameof (typesToIncludeSourceFor)); + ArgumentNullException.ThrowIfNull (typesToIncludeSourceFor); if (string.IsNullOrEmpty (outputName)) throw new ArgumentException ("Value cannot be null or empty.", nameof (outputName)); diff --git a/src/tools/illink/test/Mono.Linker.Tests/Extensions/NiceIO.cs b/src/tools/illink/test/Mono.Linker.Tests/Extensions/NiceIO.cs index ffc24695eb8035..4fde1084de42da 100644 --- a/src/tools/illink/test/Mono.Linker.Tests/Extensions/NiceIO.cs +++ b/src/tools/illink/test/Mono.Linker.Tests/Extensions/NiceIO.cs @@ -47,8 +47,7 @@ public class NPath : IEquatable, IComparable public NPath (string path) { - if (path == null) - throw new ArgumentNullException (nameof (path)); + ArgumentNullException.ThrowIfNull (path); path = ParseDriveLetter (path, out _driveLetter); diff --git a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs index f5d4ad15a45867..3bc3625143382a 100644 --- a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs +++ b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/AssemblyChecker.cs @@ -325,7 +325,7 @@ void VerifyOverrides (MethodDefinition original, MethodDefinition linked) Assert.True (linked.DeclaringType.Interfaces.Select (i => i.InterfaceType).Contains (overriddenMethod.DeclaringType), $"Method {linked} overrides method {overriddenMethod}, but {linked.DeclaringType} does not implement interface {overriddenMethod.DeclaringType}"); } else { - TypeReference baseType = linked.DeclaringType; + TypeDefinition baseType = linked.DeclaringType; TypeReference overriddenType = overriddenMethod.DeclaringType; while (baseType is not null) { if (baseType.Equals (overriddenType)) diff --git a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/PathUtilities.cs b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/PathUtilities.cs index 4a02b50ac9097b..a0b87e6ad74805 100644 --- a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/PathUtilities.cs +++ b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/PathUtilities.cs @@ -14,7 +14,9 @@ public static class PathUtilities public const string ConfigDirectoryName = "Release"; #endif -#if NET7_0 +#if NET8_0 + public const string TFMDirectoryName = "net8.0"; +#elif NET7_0 public const string TFMDirectoryName = "net7.0"; #elif NET6_0 public const string TFMDirectoryName = "net6.0"; diff --git a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseCompiler.cs b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseCompiler.cs index e41c2b8e74618a..04f56ef3f3d037 100644 --- a/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseCompiler.cs +++ b/src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/TestCaseCompiler.cs @@ -106,7 +106,7 @@ protected virtual CompilerOptions CreateOptionsForSupportingAssembly (SetupCompi }; } - private IEnumerable CompileBeforeTestCaseAssemblies (NPath outputDirectory, NPath[] references, string[] defines, IList removeFromLinkerInputAssemblies) + private IEnumerable CompileBeforeTestCaseAssemblies (NPath outputDirectory, NPath[] references, string[] defines, List removeFromLinkerInputAssemblies) { foreach (var setupCompileInfo in _metadataProvider.GetSetupCompileAssembliesBefore ()) { NPath outputFolder; @@ -134,7 +134,7 @@ private IEnumerable CompileBeforeTestCaseAssemblies (NPath outputDirector } } - private void CompileAfterTestCaseAssemblies (NPath outputDirectory, NPath[] references, string[] defines, IList removeFromLinkerInputAssemblies) + private void CompileAfterTestCaseAssemblies (NPath outputDirectory, NPath[] references, string[] defines, List removeFromLinkerInputAssemblies) { foreach (var setupCompileInfo in _metadataProvider.GetSetupCompileAssembliesAfter ()) { var options = CreateOptionsForSupportingAssembly ( From 282f2b70fb8cd61d1d4fea59f93d8430186c2489 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 26 Jan 2023 11:56:31 -0800 Subject: [PATCH 4/5] Match SDK versions of MSBuild framework (dotnet/linker#3187) * Match SDK versions of MSBuild framework * Bump to match runtime versions Commit migrated from https://github.com/dotnet/linker/commit/053438e820da93ce7df9727a6dc0cc1432342e28 --- src/tools/illink/eng/Versions.props | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tools/illink/eng/Versions.props b/src/tools/illink/eng/Versions.props index a4efb9fe852717..4252ca9d092af7 100644 --- a/src/tools/illink/eng/Versions.props +++ b/src/tools/illink/eng/Versions.props @@ -14,10 +14,12 @@ 7.0.0-rtm.22507.1 $(MicrosoftNETSdkILPackageVersion) - + + 5.0.0 - 17.0.0-preview-21267-01 - 17.0.0-preview-21267-01 + 17.3.2 + 17.3.2 + 8.0.0-beta.23067.5 6.0.0-beta.21271.1 3.10.0-2.final From a14e2a8eab3bec3cddf5db912a547039aff48390 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 13:59:09 +0000 Subject: [PATCH 5/5] Update dependencies from https://github.com/dotnet/arcade build 20230127.1 (dotnet/linker#3195) [main] Update dependencies from dotnet/arcade Commit migrated from https://github.com/dotnet/linker/commit/c4b2869923dfd9a9f49799f6373ef34e622e8564 --- src/tools/illink/eng/Version.Details.xml | 8 ++++---- src/tools/illink/eng/Versions.props | 4 +--- src/tools/illink/global.json | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/tools/illink/eng/Version.Details.xml b/src/tools/illink/eng/Version.Details.xml index cca31d3301159c..18b3400883d5fd 100644 --- a/src/tools/illink/eng/Version.Details.xml +++ b/src/tools/illink/eng/Version.Details.xml @@ -3,14 +3,14 @@ - + https://github.com/dotnet/arcade - 3600aa80a01e90f38a7b86b9d7c1264e091aa5a8 + 691fd54681d10eef3c2681fceb8b09b9f9ba9bb0 - + https://github.com/dotnet/arcade - 3600aa80a01e90f38a7b86b9d7c1264e091aa5a8 + 691fd54681d10eef3c2681fceb8b09b9f9ba9bb0 https://github.com/dotnet/runtime diff --git a/src/tools/illink/eng/Versions.props b/src/tools/illink/eng/Versions.props index 4252ca9d092af7..a9a6bb49a3f550 100644 --- a/src/tools/illink/eng/Versions.props +++ b/src/tools/illink/eng/Versions.props @@ -14,13 +14,11 @@ 7.0.0-rtm.22507.1 $(MicrosoftNETSdkILPackageVersion) - 5.0.0 17.3.2 17.3.2 - - 8.0.0-beta.23067.5 + 8.0.0-beta.23077.1 6.0.0-beta.21271.1 3.10.0-2.final 4.5.0-1.22517.9 diff --git a/src/tools/illink/global.json b/src/tools/illink/global.json index c752cf9f674437..5c8cc5a92bd067 100644 --- a/src/tools/illink/global.json +++ b/src/tools/illink/global.json @@ -8,7 +8,7 @@ "dotnet": "8.0.100-alpha.1.23061.8" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23067.5", + "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23077.1", "Microsoft.FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", "Microsoft.NET.Sdk.IL": "7.0.0-rtm.22507.1" }