From 7d03a081095cdc14a6b0d672891b538e4a32cd11 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 1 Sep 2023 16:42:21 +0000 Subject: [PATCH 01/27] Remove dependencies on non-live illink --- eng/Version.Details.xml | 4 --- eng/Versions.props | 2 -- eng/illink.targets | 29 +------------------ eng/liveILLink.targets | 26 +++++++++++++++++ src/libraries/sendtohelix-mobile.targets | 4 +-- .../apple/build/AppleBuild.LocalBuild.props | 2 +- src/tests/Directory.Build.props | 2 -- src/tests/Directory.Build.targets | 1 + 8 files changed, 30 insertions(+), 40 deletions(-) create mode 100644 eng/liveILLink.targets diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index cb8cb16a6d497..418dfc7a6a060 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -314,10 +314,6 @@ 976c2ab862494ef05e2b61535a3d08e26f131145 - - https://github.com/dotnet/runtime - 976c2ab862494ef05e2b61535a3d08e26f131145 - https://github.com/dotnet/runtime 976c2ab862494ef05e2b61535a3d08e26f131145 diff --git a/eng/Versions.props b/eng/Versions.props index 8b6e9135f7bb5..229975e63dfb6 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -206,8 +206,6 @@ 1.1.2-beta1.23323.1 7.0.0-preview-20221010.1 - - 9.0.0-alpha.1.23426.3 0.11.4-alpha.23428.2 diff --git a/eng/illink.targets b/eng/illink.targets index 95dfef07654d0..0649c4f8818f2 100644 --- a/eng/illink.targets +++ b/eng/illink.targets @@ -1,36 +1,9 @@ - - <_ILLinkTasksSourceDir>$(ToolsProjectRoot)illink\src\ILLink.Tasks\ - $(ToolsProjectRoot)illink\src\ILLink.RoslynAnalyzer\build\Microsoft.NET.ILLink.Analyzers.props - - - - - - - TargetFramework=$(NetCoreAppToolCurrent) - TargetFramework=$(NetFrameworkToolCurrent) - - - - + true - - <_RequiresILLinkPack>false - $(ToolsILLinkDir)$(NetCoreAppToolCurrent)/ILLink.Tasks.dll _EmbedILLinkXmls;$(PrepareResourcesDependsOn) $(TargetsTriggeredByCompilation);ILLinkTrimAssembly diff --git a/eng/liveILLink.targets b/eng/liveILLink.targets new file mode 100644 index 0000000000000..461c26bb4f0cb --- /dev/null +++ b/eng/liveILLink.targets @@ -0,0 +1,26 @@ + + + + <_ILLinkTasksSourceDir>$(ToolsProjectRoot)illink\src\ILLink.Tasks\ + $(ToolsProjectRoot)illink\src\ILLink.RoslynAnalyzer\build\Microsoft.NET.ILLink.Analyzers.props + + + + + + + + + TargetFramework=$(NetCoreAppToolCurrent) + TargetFramework=$(NetFrameworkToolCurrent) + + + <_RequiresILLinkPack>false + $(ToolsILLinkDir)$(NetCoreAppToolCurrent)/ILLink.Tasks.dll + + + diff --git a/src/libraries/sendtohelix-mobile.targets b/src/libraries/sendtohelix-mobile.targets index 857077429fd8d..8bc9b527ac7d9 100644 --- a/src/libraries/sendtohelix-mobile.targets +++ b/src/libraries/sendtohelix-mobile.targets @@ -58,8 +58,6 @@ <_XHarnessAppleCustomCommand Condition="'$(NeedsiOSSDK)' == 'true'"> source build-apple-app.sh - - $([MSBuild]::NormalizeDirectory('$(NuGetPackageRoot)', 'microsoft.net.illink.tasks', '$(BundledNETCoreAppPackageVersion)')) @@ -79,7 +77,7 @@ Destination="build/BuildIntegration" /> - + diff --git a/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props b/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props index 7a2c308ccac3e..20130c384ec94 100644 --- a/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props +++ b/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props @@ -66,7 +66,7 @@ $(MicrosoftNetCoreAppRuntimePackLibDir) $(MicrosoftNetCoreAppRuntimePackNativeDir) $([MSBuild]::NormalizePath('$(BuildBaseDir)', 'microsoft.net.illink.tasks', 'build', 'Microsoft.NET.ILLink.targets')) - $([MSBuild]::NormalizePath('$(BuildBaseDir)', 'microsoft.net.illink.tasks', 'tools', '$(_NetCoreAppToolCurrent)', 'ILLink.Tasks.dll')) + $([MSBuild]::NormalizePath('$(BuildBaseDir)', 'microsoft.net.illink.tasks', '$(_NetCoreAppToolCurrent)', 'ILLink.Tasks.dll')) <_MonoAotCrossCompilerPath>$([MSBuild]::NormalizePath($(MonoAotCrossDir), 'mono-aot-cross')) <_MonoAotCrossCompilerPath Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">$(_MonoAotCrossCompilerPath).exe diff --git a/src/tests/Directory.Build.props b/src/tests/Directory.Build.props index 8ed0ec83f4065..2d73150fc5f94 100644 --- a/src/tests/Directory.Build.props +++ b/src/tests/Directory.Build.props @@ -2,8 +2,6 @@ Release - - true diff --git a/src/tests/Directory.Build.targets b/src/tests/Directory.Build.targets index 7402a015c3598..7b5759b920e58 100644 --- a/src/tests/Directory.Build.targets +++ b/src/tests/Directory.Build.targets @@ -524,6 +524,7 @@ + From 201713b9c4e4a1ca08c4fdbbd9751a1c05822d47 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 1 Sep 2023 17:40:27 +0000 Subject: [PATCH 02/27] Fix properties --- eng/liveILLink.targets | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/eng/liveILLink.targets b/eng/liveILLink.targets index 461c26bb4f0cb..6caedc8e681d0 100644 --- a/eng/liveILLink.targets +++ b/eng/liveILLink.targets @@ -7,6 +7,12 @@ + + + <_RequiresILLinkPack>false + $(ToolsILLinkDir)$(NetCoreAppToolCurrent)/ILLink.Tasks.dll + + TargetFramework=$(NetCoreAppToolCurrent) TargetFramework=$(NetFrameworkToolCurrent) - - <_RequiresILLinkPack>false - $(ToolsILLinkDir)$(NetCoreAppToolCurrent)/ILLink.Tasks.dll From 03940b26d08e9f81abb87945187c362c6beba882 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 1 Sep 2023 21:31:20 +0000 Subject: [PATCH 03/27] Remove KnownILLinkPack --- eng/targetingpacks.targets | 7 ------- 1 file changed, 7 deletions(-) diff --git a/eng/targetingpacks.targets b/eng/targetingpacks.targets index 2c34b5817b995..473eadc4cfa71 100644 --- a/eng/targetingpacks.targets +++ b/eng/targetingpacks.targets @@ -72,13 +72,6 @@ Condition="'@(KnownAppHostPack)' == '' or !@(KnownAppHostPack->AnyHaveMetadataValue('TargetFramework', '$(NetCoreAppCurrent)'))" /> - - - - $(NetCoreAppCurrent) - - - From a64cc2adbb4610e8553a2d35bd29804513b11c33 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 1 Sep 2023 22:41:29 +0000 Subject: [PATCH 04/27] Don't require illink analyzers for source generator projects Microsoft.Extensions.Options.SourceGeneration was enabling the single-file analyzer, but did not import illink.targets because it is not a source project. We could fix this by importing liveILLink.targets instead, but this introduces more problems with circular dependencies (generator projects depending on illink depending on generator projects). --- eng/Analyzers.targets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/Analyzers.targets b/eng/Analyzers.targets index a7955d74e9bdc..85734e5a1d31d 100644 --- a/eng/Analyzers.targets +++ b/eng/Analyzers.targets @@ -14,7 +14,8 @@ true + '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And + '$(IsGeneratorProject)' != 'true'">true From abc514f994a0443dbdba29c4307afd84fd07532d Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 5 Sep 2023 17:03:31 +0000 Subject: [PATCH 05/27] Only enable single-file analyzer for source projects This more closely matches the condition on the import of illink.targets. When EnableSingleFileAnalyzer is true, we should also import liveILLink.targets so that we get the live analyzer bits. Also address feedback about path separators. --- eng/Analyzers.targets | 2 +- eng/liveILLink.targets | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Analyzers.targets b/eng/Analyzers.targets index 85734e5a1d31d..5a9dfca127185 100644 --- a/eng/Analyzers.targets +++ b/eng/Analyzers.targets @@ -15,7 +15,7 @@ true + '$(IsSourceProject)' == 'true'">true diff --git a/eng/liveILLink.targets b/eng/liveILLink.targets index 6caedc8e681d0..5fdd0bf2307f0 100644 --- a/eng/liveILLink.targets +++ b/eng/liveILLink.targets @@ -10,7 +10,7 @@ <_RequiresILLinkPack>false - $(ToolsILLinkDir)$(NetCoreAppToolCurrent)/ILLink.Tasks.dll + $(ToolsILLinkDir)$(NetCoreAppToolCurrent)\ILLink.Tasks.dll From 597a012bfed4a7f31e7d91a66a4c6348a8419bbf Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 5 Sep 2023 17:10:55 +0000 Subject: [PATCH 06/27] Separate imports This will make it easier to use different conditions for the two. --- eng/illink.targets | 2 -- eng/testing/tests.mobile.targets | 1 + src/coreclr/Directory.Build.targets | 1 + src/libraries/Directory.Build.targets | 2 +- src/mono/Directory.Build.targets | 1 + 5 files changed, 4 insertions(+), 3 deletions(-) diff --git a/eng/illink.targets b/eng/illink.targets index 0649c4f8818f2..3636c029fc901 100644 --- a/eng/illink.targets +++ b/eng/illink.targets @@ -1,7 +1,5 @@ - - true _EmbedILLinkXmls;$(PrepareResourcesDependsOn) diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 589a3fb90753a..ae6df8a7d1d29 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -165,5 +165,6 @@ DependsOnTargets="InstallWorkloadUsingArtifacts" Condition="'$(InstallWorkloadForTesting)' == 'true'" /> + diff --git a/src/coreclr/Directory.Build.targets b/src/coreclr/Directory.Build.targets index 77095b48bfe2f..2a92ec9155fd6 100644 --- a/src/coreclr/Directory.Build.targets +++ b/src/coreclr/Directory.Build.targets @@ -27,6 +27,7 @@ + diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index acd5edc193262..b26bf1ef0f5c1 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -126,7 +126,7 @@ - + diff --git a/src/mono/Directory.Build.targets b/src/mono/Directory.Build.targets index fb807fd715fea..78c94138e1e69 100644 --- a/src/mono/Directory.Build.targets +++ b/src/mono/Directory.Build.targets @@ -2,5 +2,6 @@ + From e83a2a06ebeadc8577c9b9d97acbcffd13e8aab2 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 5 Sep 2023 17:16:35 +0000 Subject: [PATCH 07/27] Fix libraries build Some libraries test projects set PublishTrimmed, so they require the liveILLink.targets. --- src/libraries/Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index b26bf1ef0f5c1..899741c106975 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -126,7 +126,7 @@ - + From 32e13ab1664388726a83b01b0a6f5040ed374e0f Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 5 Sep 2023 17:44:35 +0000 Subject: [PATCH 08/27] Add _RequiresLiveILLink flag --- eng/liveILLink.targets | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/eng/liveILLink.targets b/eng/liveILLink.targets index 5fdd0bf2307f0..723401a324366 100644 --- a/eng/liveILLink.targets +++ b/eng/liveILLink.targets @@ -1,19 +1,32 @@ + + + + <_RequiresLiveILLink Condition="'$(_RequiresLiveILLink)' == '' And ( + '$(PublishAot)' == 'true' Or + '$(IsAotCompatible)' == 'true' Or '$(EnableAotAnalyzer)' == 'true' Or + '$(PublishTrimmed)' == 'true' Or + '$(IsTrimmable)' == 'true' Or '$(EnableTrimAnalyzer)' == 'true' Or + '$(EnableSingleFileAnalyzer)' == 'true')">true + + + <_ILLinkTasksSourceDir>$(ToolsProjectRoot)illink\src\ILLink.Tasks\ $(ToolsProjectRoot)illink\src\ILLink.RoslynAnalyzer\build\Microsoft.NET.ILLink.Analyzers.props - + - + <_RequiresILLinkPack>false $(ToolsILLinkDir)$(NetCoreAppToolCurrent)\ILLink.Tasks.dll - + Date: Tue, 5 Sep 2023 17:45:16 +0000 Subject: [PATCH 09/27] Revert "Fix libraries build" This reverts commit e83a2a06ebeadc8577c9b9d97acbcffd13e8aab2. --- src/libraries/Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index 899741c106975..b26bf1ef0f5c1 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -126,7 +126,7 @@ - + From 7a3362fb94c9c3d49d9571c699b04e08bcdf97ee Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 5 Sep 2023 17:45:24 +0000 Subject: [PATCH 10/27] Revert "Separate imports" This reverts commit 597a012bfed4a7f31e7d91a66a4c6348a8419bbf. --- eng/illink.targets | 2 ++ eng/testing/tests.mobile.targets | 1 - src/coreclr/Directory.Build.targets | 1 - src/libraries/Directory.Build.targets | 2 +- src/mono/Directory.Build.targets | 1 - 5 files changed, 3 insertions(+), 4 deletions(-) diff --git a/eng/illink.targets b/eng/illink.targets index 3636c029fc901..0649c4f8818f2 100644 --- a/eng/illink.targets +++ b/eng/illink.targets @@ -1,5 +1,7 @@ + + true _EmbedILLinkXmls;$(PrepareResourcesDependsOn) diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index ae6df8a7d1d29..589a3fb90753a 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -165,6 +165,5 @@ DependsOnTargets="InstallWorkloadUsingArtifacts" Condition="'$(InstallWorkloadForTesting)' == 'true'" /> - diff --git a/src/coreclr/Directory.Build.targets b/src/coreclr/Directory.Build.targets index 2a92ec9155fd6..77095b48bfe2f 100644 --- a/src/coreclr/Directory.Build.targets +++ b/src/coreclr/Directory.Build.targets @@ -27,7 +27,6 @@ - diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index b26bf1ef0f5c1..acd5edc193262 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -126,7 +126,7 @@ - + diff --git a/src/mono/Directory.Build.targets b/src/mono/Directory.Build.targets index 78c94138e1e69..fb807fd715fea 100644 --- a/src/mono/Directory.Build.targets +++ b/src/mono/Directory.Build.targets @@ -2,6 +2,5 @@ - From 679c0e1336bffc7afc9b258b2de7fd6134d4408d Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 5 Sep 2023 17:50:16 +0000 Subject: [PATCH 11/27] Set _RequiresLiveILLink in illink.targets --- eng/illink.targets | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eng/illink.targets b/eng/illink.targets index 0649c4f8818f2..c53e64e2523da 100644 --- a/eng/illink.targets +++ b/eng/illink.targets @@ -1,5 +1,11 @@ + + + <_RequiresLiveILLink>true + + From 12dd7dd263e27532fd6eced84f9e5f348f980098 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 5 Sep 2023 20:42:29 +0000 Subject: [PATCH 12/27] Don't restore KnownILLinkPack in trimming tests --- eng/testing/linker/project.csproj.template | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eng/testing/linker/project.csproj.template b/eng/testing/linker/project.csproj.template index 3916d05f77086..56dfb57d821f6 100644 --- a/eng/testing/linker/project.csproj.template +++ b/eng/testing/linker/project.csproj.template @@ -12,7 +12,10 @@ + + + <_RequiresILLinkPack>false $(ToolsILLinkDir)$(NetCoreAppToolCurrent)/ILLink.Tasks.dll From d99b2d613283ade91a41864293d98e53d1ca14b9 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 5 Sep 2023 21:42:25 +0000 Subject: [PATCH 13/27] Import liveILLink.targets in libraries projects This should let libraries projects (whether they are source or test projects) use the SDK's trimming properties with a live ILLink, enabling the ProjectReference only for those projects that need it. Because illink.targets also imports liveILLink.targets, this import is guarded by a property to ensure liveILLink.targets is only imported once on this path. --- eng/liveILLink.targets | 1 + src/libraries/Directory.Build.targets | 2 ++ 2 files changed, 3 insertions(+) diff --git a/eng/liveILLink.targets b/eng/liveILLink.targets index 723401a324366..7132411d19566 100644 --- a/eng/liveILLink.targets +++ b/eng/liveILLink.targets @@ -3,6 +3,7 @@ + <_ImportedLiveILLinkTargets>true <_RequiresLiveILLink Condition="'$(_RequiresLiveILLink)' == '' And ( diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index acd5edc193262..28873518c43c1 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -128,6 +128,8 @@ + + From e0279d2758875f590376796e6c3da2226fbcf351 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 5 Sep 2023 22:05:09 +0000 Subject: [PATCH 14/27] Fix import path --- src/libraries/Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index 28873518c43c1..c8535c5bf7c3b 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -129,7 +129,7 @@ - + From a2c519a85e292c2e023ce129e1197a4d484980c2 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 6 Sep 2023 17:21:01 +0000 Subject: [PATCH 15/27] Separate imports, PR feedback Avoid the need for an import guard by requiring liveILLink.targets to be imported separately from illink.targets. Also fix casing of MSBuild And in Analyzers.targets --- eng/Analyzers.targets | 4 ++-- eng/illink.targets | 2 -- eng/liveILLink.targets | 1 - eng/testing/tests.mobile.targets | 1 + src/coreclr/Directory.Build.targets | 1 + src/libraries/Directory.Build.targets | 3 +-- src/mono/Directory.Build.targets | 1 + 7 files changed, 6 insertions(+), 7 deletions(-) diff --git a/eng/Analyzers.targets b/eng/Analyzers.targets index 5a9dfca127185..53390cbe07a70 100644 --- a/eng/Analyzers.targets +++ b/eng/Analyzers.targets @@ -13,8 +13,8 @@ true diff --git a/eng/illink.targets b/eng/illink.targets index c53e64e2523da..d2c59852ed65c 100644 --- a/eng/illink.targets +++ b/eng/illink.targets @@ -6,8 +6,6 @@ <_RequiresLiveILLink>true - - true _EmbedILLinkXmls;$(PrepareResourcesDependsOn) diff --git a/eng/liveILLink.targets b/eng/liveILLink.targets index 7132411d19566..723401a324366 100644 --- a/eng/liveILLink.targets +++ b/eng/liveILLink.targets @@ -3,7 +3,6 @@ - <_ImportedLiveILLinkTargets>true <_RequiresLiveILLink Condition="'$(_RequiresLiveILLink)' == '' And ( diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 589a3fb90753a..f0ec3cb6ea45f 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -166,4 +166,5 @@ Condition="'$(InstallWorkloadForTesting)' == 'true'" /> + diff --git a/src/coreclr/Directory.Build.targets b/src/coreclr/Directory.Build.targets index 77095b48bfe2f..5cc5f96ebf282 100644 --- a/src/coreclr/Directory.Build.targets +++ b/src/coreclr/Directory.Build.targets @@ -28,5 +28,6 @@ + diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index c8535c5bf7c3b..5944a114639cc 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -128,8 +128,7 @@ - - + diff --git a/src/mono/Directory.Build.targets b/src/mono/Directory.Build.targets index fb807fd715fea..5ac7bc2647ece 100644 --- a/src/mono/Directory.Build.targets +++ b/src/mono/Directory.Build.targets @@ -3,4 +3,5 @@ + From ee2213ff3cd9f405ef8cab31e00330a8f88b5734 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 6 Sep 2023 17:39:23 +0000 Subject: [PATCH 16/27] Move liveILlink.targets import to top-level Directory.Build.targets --- Directory.Build.targets | 1 + eng/testing/tests.mobile.targets | 1 + src/coreclr/Directory.Build.targets | 9 +++++---- src/libraries/Directory.Build.targets | 4 ++-- src/mono/Directory.Build.targets | 7 ++++--- src/tools/illink/src/Directory.Build.props | 2 ++ 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index 933f4d7f4bf10..b3e8ad1bd15bb 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -10,6 +10,7 @@ + diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index f0ec3cb6ea45f..5e1c613327918 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -165,6 +165,7 @@ DependsOnTargets="InstallWorkloadUsingArtifacts" Condition="'$(InstallWorkloadForTesting)' == 'true'" /> + diff --git a/src/coreclr/Directory.Build.targets b/src/coreclr/Directory.Build.targets index 5cc5f96ebf282..dc618066e1860 100644 --- a/src/coreclr/Directory.Build.targets +++ b/src/coreclr/Directory.Build.targets @@ -1,4 +1,9 @@ + + + + + @@ -26,8 +31,4 @@ UseHardlinksIfPossible="false" /> - - - - diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index 5944a114639cc..0e7a120395e09 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -9,6 +9,8 @@ + + @@ -127,8 +129,6 @@ - - diff --git a/src/mono/Directory.Build.targets b/src/mono/Directory.Build.targets index 5ac7bc2647ece..6985a52a54058 100644 --- a/src/mono/Directory.Build.targets +++ b/src/mono/Directory.Build.targets @@ -1,7 +1,8 @@ - - + - + + + diff --git a/src/tools/illink/src/Directory.Build.props b/src/tools/illink/src/Directory.Build.props index 02794c1ded9f7..96ec663ea007e 100644 --- a/src/tools/illink/src/Directory.Build.props +++ b/src/tools/illink/src/Directory.Build.props @@ -3,5 +3,7 @@ enable + + false \ No newline at end of file From c42ad158f7e3a7d1c193b68dd9f4fac30cda0dec Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 6 Sep 2023 18:12:56 +0000 Subject: [PATCH 17/27] Clean up redundant setting --- src/tools/illink/src/ILLink.Tasks/ILLink.Tasks.csproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/tools/illink/src/ILLink.Tasks/ILLink.Tasks.csproj b/src/tools/illink/src/ILLink.Tasks/ILLink.Tasks.csproj index 1199101f63825..041a028209871 100644 --- a/src/tools/illink/src/ILLink.Tasks/ILLink.Tasks.csproj +++ b/src/tools/illink/src/ILLink.Tasks/ILLink.Tasks.csproj @@ -22,8 +22,6 @@ false false $(TargetsForTfmSpecificContentInPackage);AddBuildOutputToToolsPackage - - false + @@ -591,8 +593,6 @@ - - diff --git a/src/tools/illink/src/Directory.Build.props b/src/tools/illink/src/Directory.Build.props index 96ec663ea007e..04a78bf71d00f 100644 --- a/src/tools/illink/src/Directory.Build.props +++ b/src/tools/illink/src/Directory.Build.props @@ -6,4 +6,4 @@ false - \ No newline at end of file + From 6072a9a458ef279ff76dcdc58a55881787cd4bd2 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 6 Sep 2023 21:19:51 +0000 Subject: [PATCH 19/27] Try removing imports from tests.mobile.targets Mobile trimmingtests should already use the live illink with the logic in project.csproj.template. The import of illink.targets shouldn't be required, unless tests.mobile.targets are required for other test scenarios. This import was resulting in a double-import, and wasn't working because liveILLink needs ToolsILLinkDir to be set, but it's not set during the trimming test build. --- eng/testing/tests.mobile.targets | 3 --- 1 file changed, 3 deletions(-) diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 5e1c613327918..ecb4699eb0166 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -165,7 +165,4 @@ DependsOnTargets="InstallWorkloadUsingArtifacts" Condition="'$(InstallWorkloadForTesting)' == 'true'" /> - - - From 8cdd176de989b50f68e637133f2610c6d05c944d Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 6 Sep 2023 22:43:13 +0000 Subject: [PATCH 20/27] Keep ILC props/items before ILC targets import --- src/tests/Directory.Build.targets | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/tests/Directory.Build.targets b/src/tests/Directory.Build.targets index 0c0c4ce505e1a..e3587910b6c0c 100644 --- a/src/tests/Directory.Build.targets +++ b/src/tests/Directory.Build.targets @@ -524,21 +524,6 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + From a239c1ae25c8c0b4d443165f6e8b6262cddaf35f Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 7 Sep 2023 21:42:28 +0000 Subject: [PATCH 21/27] Move liveILLink.targets import back down The top-level import was causing ordering issues in src/libraries/Directory.Build.targets. The top-level targets were importing liveBuilds and liveILLink, but src/libraries/Directory.Build.targets needs to import (indirectly through eng/testing/tests.targets) the nativeaot targets after liveBuilds, but before liveILLink. Moving the import of liveILLink.targets back down allows more control of the import order. --- Directory.Build.targets | 1 - src/coreclr/Directory.Build.targets | 8 ++++---- src/libraries/Directory.Build.targets | 4 ++-- src/mono/Directory.Build.targets | 6 +++--- src/tests/Directory.Build.targets | 29 +++++++++++++-------------- 5 files changed, 23 insertions(+), 25 deletions(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index b3e8ad1bd15bb..933f4d7f4bf10 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -10,7 +10,6 @@ - diff --git a/src/coreclr/Directory.Build.targets b/src/coreclr/Directory.Build.targets index dc618066e1860..77a074271c126 100644 --- a/src/coreclr/Directory.Build.targets +++ b/src/coreclr/Directory.Build.targets @@ -1,9 +1,5 @@ - - - - @@ -31,4 +27,8 @@ UseHardlinksIfPossible="false" /> + + + + diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index 0e7a120395e09..5944a114639cc 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -9,8 +9,6 @@ - - @@ -129,6 +127,8 @@ + + diff --git a/src/mono/Directory.Build.targets b/src/mono/Directory.Build.targets index 6985a52a54058..f54aa3fa03b74 100644 --- a/src/mono/Directory.Build.targets +++ b/src/mono/Directory.Build.targets @@ -1,8 +1,8 @@ + + - - - + diff --git a/src/tests/Directory.Build.targets b/src/tests/Directory.Build.targets index e3587910b6c0c..19fa8d44fc389 100644 --- a/src/tests/Directory.Build.targets +++ b/src/tests/Directory.Build.targets @@ -524,6 +524,18 @@ + + + + + + + + + + + + + + - - - - - - - - - - - - - - From 59919ceae3dbda2215db1c07d1cf50a670f5570c Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 8 Sep 2023 16:38:35 +0000 Subject: [PATCH 22/27] Fix illink path This used to use the layout of the nuget package, but now we are using the layout of the ILLink.Tasks build output. --- src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props b/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props index 20130c384ec94..1b26d384c4b99 100644 --- a/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props +++ b/src/mono/msbuild/apple/build/AppleBuild.LocalBuild.props @@ -65,7 +65,7 @@ $([MSBuild]::NormalizeDirectory('$(BuildBaseDir)', 'aotsdk')) $(MicrosoftNetCoreAppRuntimePackLibDir) $(MicrosoftNetCoreAppRuntimePackNativeDir) - $([MSBuild]::NormalizePath('$(BuildBaseDir)', 'microsoft.net.illink.tasks', 'build', 'Microsoft.NET.ILLink.targets')) + $([MSBuild]::NormalizePath('$(BuildBaseDir)', 'microsoft.net.illink.tasks', '$(_NetCoreAppToolCurrent)', 'build', 'Microsoft.NET.ILLink.targets')) $([MSBuild]::NormalizePath('$(BuildBaseDir)', 'microsoft.net.illink.tasks', '$(_NetCoreAppToolCurrent)', 'ILLink.Tasks.dll')) <_MonoAotCrossCompilerPath>$([MSBuild]::NormalizePath($(MonoAotCrossDir), 'mono-aot-cross')) <_MonoAotCrossCompilerPath Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">$(_MonoAotCrossCompilerPath).exe From b442dbcb8ba3da61918c2f6753b3c3a18a48f159 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 3 Oct 2023 13:44:28 -0700 Subject: [PATCH 23/27] Apply suggestions from code review - Fix indentation - Only import liveILLink.targets in libraries when illink.targets is imported - Respect MSBuildRuntimeType for live ILLinkTasksAssembly override Co-authored-by: Viktor Hofer --- eng/liveILLink.targets | 4 +++- src/coreclr/Directory.Build.targets | 6 +++--- src/libraries/Directory.Build.targets | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/eng/liveILLink.targets b/eng/liveILLink.targets index 723401a324366..c6f4380f9d388 100644 --- a/eng/liveILLink.targets +++ b/eng/liveILLink.targets @@ -23,7 +23,9 @@ <_RequiresILLinkPack>false - $(ToolsILLinkDir)$(NetCoreAppToolCurrent)\ILLink.Tasks.dll + + $(ToolsILLinkDir)$(NetCoreAppToolCurrent)\ILLink.Tasks.dll + $(ToolsILLinkDir)$(NetFrameworkToolCurrent)\ILLink.Tasks.dll diff --git a/src/coreclr/Directory.Build.targets b/src/coreclr/Directory.Build.targets index 77a074271c126..1241d0bb5d79f 100644 --- a/src/coreclr/Directory.Build.targets +++ b/src/coreclr/Directory.Build.targets @@ -27,8 +27,8 @@ UseHardlinksIfPossible="false" /> - - - + + + diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index 5c7d860d432ac..db9d1eafda4a3 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -126,8 +126,10 @@ - - + + + + From be50c3575e8b68a4769e51febc3d5c5a5421cb5b Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 4 Oct 2023 05:23:13 +0000 Subject: [PATCH 24/27] Fix libs test project that sets PublishTrimmed --- .../System.Runtime.InteropServices.JavaScript.Tests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj index 13a08edcbf23b..c041e284561d5 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj @@ -6,6 +6,7 @@ $(WasmXHarnessArgs) --engine-arg=--expose-gc --web-server-use-cop true true + true false $(DefineConstants);DISABLE_LEGACY_JS_INTEROP From 2c163910f9c80cd0ccafc9230d1b2bf915a1daa3 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 4 Oct 2023 05:51:58 +0000 Subject: [PATCH 25/27] Revert "Fix libs test project that sets PublishTrimmed" This reverts commit be50c3575e8b68a4769e51febc3d5c5a5421cb5b. --- .../System.Runtime.InteropServices.JavaScript.Tests.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj index c041e284561d5..13a08edcbf23b 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System.Runtime.InteropServices.JavaScript.Tests.csproj @@ -6,7 +6,6 @@ $(WasmXHarnessArgs) --engine-arg=--expose-gc --web-server-use-cop true true - true false $(DefineConstants);DISABLE_LEGACY_JS_INTEROP From 96a663d4d2e094b80f3c7ffdb035aeeb866ec3eb Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 4 Oct 2023 05:56:05 +0000 Subject: [PATCH 26/27] Revert condition on liveILLink.targets import Various test configurations (wasm, nativeaot) rely on the live ILLink when running libraries tests. --- src/libraries/Directory.Build.targets | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index db9d1eafda4a3..5c7d860d432ac 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -126,10 +126,8 @@ - - - - + + From 9b9ed8dc04f9db266ca5597b383e9855d18450c0 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 5 Oct 2023 11:44:47 -0700 Subject: [PATCH 27/27] Skip nonexistent targets when copying native binaries This target isn't defined in the ILLink.Tasks.csproj ProjectReference. Try skipping nonexistent targets to fix this. --- src/tests/Directory.Build.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/Directory.Build.targets b/src/tests/Directory.Build.targets index c8fe419e8fef6..1b20f38df984d 100644 --- a/src/tests/Directory.Build.targets +++ b/src/tests/Directory.Build.targets @@ -264,6 +264,7 @@