From 1bc6b78c8da9a96915f63bd22361c2f845815692 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 5 Apr 2022 05:04:43 +0000 Subject: [PATCH 1/8] Populate target framework versions for tasks, and generated nugets based .. on other properties, instead of hardcoding the values. --- Directory.Build.props | 6 ++++++ ...rosoft.NET.Runtime.WebAssembly.Sdk.pkgproj | 21 ++++++++++++++++++- .../Sdk/{Sdk.targets => Sdk.targets.in} | 4 ++-- src/tasks/Directory.Build.props | 11 ---------- 4 files changed, 28 insertions(+), 14 deletions(-) rename src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Sdk/Sdk/{Sdk.targets => Sdk.targets.in} (76%) delete mode 100644 src/tasks/Directory.Build.props diff --git a/Directory.Build.props b/Directory.Build.props index ea12ca71919bc1..2ec01ea57e6b7f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -68,6 +68,12 @@ net472 + + $(NetFrameworkToolCurrent) + + + + $(NetCoreAppToolCurrent) diff --git a/src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Sdk/Microsoft.NET.Runtime.WebAssembly.Sdk.pkgproj b/src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Sdk/Microsoft.NET.Runtime.WebAssembly.Sdk.pkgproj index 874775fe7e47f2..3116e9955cfcd3 100644 --- a/src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Sdk/Microsoft.NET.Runtime.WebAssembly.Sdk.pkgproj +++ b/src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Sdk/Microsoft.NET.Runtime.WebAssembly.Sdk.pkgproj @@ -9,7 +9,6 @@ - @@ -17,5 +16,25 @@ + + + $(IntermediateOutputPath)Sdk.targets + + + + <_ReplacementValue Include="TargetFrameworkForNETCoreTasks" Value="$(TargetFrameworkForNETCoreTasks)" /> + <_ReplacementValue Include="TargetFrameworkForNETFrameworkTasks" Value="$(TargetFrameworkForNETFrameworkTasks)" /> + + + + + + + + + diff --git a/src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Sdk/Sdk/Sdk.targets b/src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Sdk/Sdk/Sdk.targets.in similarity index 76% rename from src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Sdk/Sdk/Sdk.targets rename to src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Sdk/Sdk/Sdk.targets.in index 2c2959c87e53a4..0a6137cd8c4edd 100644 --- a/src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Sdk/Sdk/Sdk.targets +++ b/src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Sdk/Sdk/Sdk.targets.in @@ -1,8 +1,8 @@ - <_TasksDir Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tasks\net6.0\ - <_TasksDir Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tasks\net472\ + <_TasksDir Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tasks\${TargetFrameworkForNETCoreTasks}\ + <_TasksDir Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tasks\${TargetFrameworkForNETFrameworkTasks}\ $(_TasksDir)WasmAppBuilder.dll $(_TasksDir)WasmBuildTasks.dll diff --git a/src/tasks/Directory.Build.props b/src/tasks/Directory.Build.props deleted file mode 100644 index 887be3a86036fb..00000000000000 --- a/src/tasks/Directory.Build.props +++ /dev/null @@ -1,11 +0,0 @@ - - - - - net472 - - - - net6.0 - - From 892374e737a66a10bf3ec6e98366d769d2995f98 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 5 Apr 2022 05:19:47 +0000 Subject: [PATCH 2/8] Version substitution for MonoTargets nuget --- ...rosoft.NET.Runtime.MonoTargets.Sdk.pkgproj | 21 ++++++++++++++++++- ...sTasks.props => MonoTargetsTasks.props.in} | 4 ++-- 2 files changed, 22 insertions(+), 3 deletions(-) rename src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/{MonoTargetsTasks.props => MonoTargetsTasks.props.in} (81%) diff --git a/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Microsoft.NET.Runtime.MonoTargets.Sdk.pkgproj b/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Microsoft.NET.Runtime.MonoTargets.Sdk.pkgproj index a38b1d301e61d2..8d9e3dea06baf8 100644 --- a/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Microsoft.NET.Runtime.MonoTargets.Sdk.pkgproj +++ b/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Microsoft.NET.Runtime.MonoTargets.Sdk.pkgproj @@ -13,9 +13,28 @@ - + + + $(IntermediateOutputPath)MonoTargetsTasks.props + + + + <_ReplacementValue Include="TargetFrameworkForNETCoreTasks" Value="$(TargetFrameworkForNETCoreTasks)" /> + <_ReplacementValue Include="TargetFrameworkForNETFrameworkTasks" Value="$(TargetFrameworkForNETFrameworkTasks)" /> + + + + + + + + + diff --git a/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/MonoTargetsTasks.props b/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/MonoTargetsTasks.props.in similarity index 81% rename from src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/MonoTargetsTasks.props rename to src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/MonoTargetsTasks.props.in index 7fe32897283ba8..4ef325f421be72 100644 --- a/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/MonoTargetsTasks.props +++ b/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/MonoTargetsTasks.props.in @@ -1,7 +1,7 @@ - $(MSBuildThisFileDirectory)..\tasks\net6.0\MonoTargetsTasks.dll - $(MSBuildThisFileDirectory)..\tasks\net472\MonoTargetsTasks.dll + $(MSBuildThisFileDirectory)..\tasks\${TargetFrameworkForNETCoreTasks}\MonoTargetsTasks.dll + $(MSBuildThisFileDirectory)..\tasks\${TargetFrameworkForNETFrameworkTasks}\MonoTargetsTasks.dll From 5bc2e195998e509183ca66f223bca3eff23e0006 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 5 Apr 2022 05:21:25 +0000 Subject: [PATCH 3/8] Version substitution for MonoAOTCompiler nuget --- ...t.NET.Runtime.MonoAOTCompiler.Task.pkgproj | 21 ++++++++++++++++++- .../Sdk/Sdk.props | 7 ------- .../Sdk/Sdk.props.in | 7 +++++++ 3 files changed, 27 insertions(+), 8 deletions(-) delete mode 100644 src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Task/Sdk/Sdk.props create mode 100644 src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Task/Sdk/Sdk.props.in diff --git a/src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Task/Microsoft.NET.Runtime.MonoAOTCompiler.Task.pkgproj b/src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Task/Microsoft.NET.Runtime.MonoAOTCompiler.Task.pkgproj index 1cf00b6a1ede1e..e5a5b52244306c 100644 --- a/src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Task/Microsoft.NET.Runtime.MonoAOTCompiler.Task.pkgproj +++ b/src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Task/Microsoft.NET.Runtime.MonoAOTCompiler.Task.pkgproj @@ -8,9 +8,28 @@ - + + + $(IntermediateOutputPath)Sdk.props + + + + <_ReplacementValue Include="TargetFrameworkForNETCoreTasks" Value="$(TargetFrameworkForNETCoreTasks)" /> + <_ReplacementValue Include="TargetFrameworkForNETFrameworkTasks" Value="$(TargetFrameworkForNETFrameworkTasks)" /> + + + + + + + + + diff --git a/src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Task/Sdk/Sdk.props b/src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Task/Sdk/Sdk.props deleted file mode 100644 index a94224b1858fea..00000000000000 --- a/src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Task/Sdk/Sdk.props +++ /dev/null @@ -1,7 +0,0 @@ - - - $(MSBuildThisFileDirectory)..\tasks\net6.0\MonoAOTCompiler.dll - $(MSBuildThisFileDirectory)..\tasks\net472\MonoAOTCompiler.dll - - - diff --git a/src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Task/Sdk/Sdk.props.in b/src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Task/Sdk/Sdk.props.in new file mode 100644 index 00000000000000..bc14a619299e1e --- /dev/null +++ b/src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Task/Sdk/Sdk.props.in @@ -0,0 +1,7 @@ + + + $(MSBuildThisFileDirectory)..\tasks\${TargetFrameworkForNETCoreTasks}\MonoAOTCompiler.dll + $(MSBuildThisFileDirectory)..\tasks\${TargetFrameworkForNETFrameworkTasks}\MonoAOTCompiler.dll + + + From 426b4b19155d54a7f338140f4c87feec471b5d92 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 5 Apr 2022 08:03:37 +0000 Subject: [PATCH 4/8] sendhelixhelp.proj: Ensure that DotNetCliVersion gets overridden, as .. intended. This seems to have been broken by the condition being removed in https://github.com/dotnet/arcade/commit/cfdac3560f1c887780bac171df7c22f7805e6f40 from the `DotNetCliVersion` property, causing the value to always overridden again to `6.0.100`. And this breaks wasm aot/eat tests on helix: ``` /datadisks/disk1/work/A4EE08D9/p/build/wasm/WasmApp.Native.targets(569,5): error MSB4062: The "MonoAOTCompiler" task could not be loaded from the assembly /datadisks/disk1/work/A4EE08D9/p/build/MonoAOTCompiler/MonoAOTCompiler.dll. Could not load file or assembly 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. [/datadisks/disk1/work/A4EE08D9/w/B3AE0955/e/publish/ProxyProjectForAOTOnHelix.proj] /datadisks/disk1/work/A4EE08D9/p/build/wasm/WasmApp.Native.targets(569,5): error MSB4062: Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. ``` --- src/libraries/sendtohelixhelp.proj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index 5b4e1d4831f1ac..6ee54596840d48 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -143,11 +143,6 @@ sdk - - $([System.IO.File]::ReadAllText('$(RepoRoot)global.json')) - $([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '(%3F<="dotnet": ").*(%3F=")')) - - @@ -156,6 +151,11 @@ + + $([System.IO.File]::ReadAllText('$(RepoRoot)global.json')) + $([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '(%3F<="dotnet": ").*(%3F=")')) + + @(HelixPreCommand) $(HelixCommandPrefix) @(HelixCommandPrefixItem -> 'set "%(Identity)"', ' & ') From ac989bd68450bf11b8da6a878c68ff85e56fee64 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Tue, 5 Apr 2022 04:25:59 +0000 Subject: [PATCH 5/8] Fix build for net7.0 Fails with: ``` src/tests/tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcSocket.cs(27,35): error CS0108: 'IpcSocket.AcceptAsync(CancellationToken)' hides inherited member 'Socket.AcceptAsync(CancellationToken)'. Use the new keyword if hiding was intended. [/__w/1/s/src/tests/tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/Microsoft.Diagnostics.NETCore.Client.csproj] ``` --- .../DiagnosticsIpc/IpcSocket.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcSocket.cs b/src/tests/tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcSocket.cs index 27b0b07d683243..921ebc2dddb96b 100644 --- a/src/tests/tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcSocket.cs +++ b/src/tests/tracing/eventpipe/common/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcSocket.cs @@ -23,7 +23,7 @@ public IpcSocket(AddressFamily addressFamily, SocketType socketType, ProtocolTyp } // .NET 6 implements this method directly on Socket, but for earlier runtimes we need a polyfill -#if !NET6_0 +#if !NET6_0_OR_GREATER public async Task AcceptAsync(CancellationToken token) { using (token.Register(() => Close(0))) @@ -63,7 +63,7 @@ public virtual void Connect(EndPoint remoteEP, TimeSpan timeout) } // .NET 6 implements this method directly on Socket, but for earlier runtimes we need a polyfill -#if !NET6_0 +#if !NET6_0_OR_GREATER public async Task ConnectAsync(EndPoint remoteEP, CancellationToken token) { using (token.Register(() => Close(0))) From ef135b506cde9c1b84cc4e101f4be77634c72b06 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Thu, 7 Apr 2022 17:17:18 -0500 Subject: [PATCH 6/8] Fix some more target frameworks --- src/mono/wasm/build/WasmApp.InTree.props | 2 +- .../Microsoft.NET.Runtime.WebAssembly.Templates.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/wasm/build/WasmApp.InTree.props b/src/mono/wasm/build/WasmApp.InTree.props index ab70ccd739d44a..7f655768c8e737 100644 --- a/src/mono/wasm/build/WasmApp.InTree.props +++ b/src/mono/wasm/build/WasmApp.InTree.props @@ -5,7 +5,7 @@ AnyCPU false - $(NetCoreAppToolCurrent) + $(NetCoreAppCurrent) $([MSBuild]::NormalizeDirectory($(MonoProjectRoot), 'wasm', 'emsdk')) false true diff --git a/src/mono/wasm/templates/Microsoft.NET.Runtime.WebAssembly.Templates.csproj b/src/mono/wasm/templates/Microsoft.NET.Runtime.WebAssembly.Templates.csproj index 77f730d55b23db..dfe18d9b0042fe 100644 --- a/src/mono/wasm/templates/Microsoft.NET.Runtime.WebAssembly.Templates.csproj +++ b/src/mono/wasm/templates/Microsoft.NET.Runtime.WebAssembly.Templates.csproj @@ -8,7 +8,7 @@ Templates to create WebAssembly projects. dotnet-new;templates - net6.0 + $(NetCoreAppToolCurrent) true false From d76deb4d6b91e46c103115cfd3003cfae269c20e Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Thu, 7 Apr 2022 21:40:14 -0500 Subject: [PATCH 7/8] bump the workload sdk version --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index b5772aa508a4fe..704fbdaed09793 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -171,7 +171,7 @@ 2.0.4 4.12.0 2.14.3 - 7.0.100-preview.3.22151.18 + 7.0.100-preview.4.22207.2 1.1.2-beta1.22122.4 7.0.0-preview-20220331.1 From 953878ad5de8b1812a3b5350076614c39b9d4671 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Fri, 8 Apr 2022 01:14:57 -0400 Subject: [PATCH 8/8] Revert "sendhelixhelp.proj: Ensure that DotNetCliVersion gets overridden, as" This reverts commit 426b4b19155d54a7f338140f4c87feec471b5d92. Last update to Arcade's XHarnessRunner.targets unconditionally set DotNetCliVersion, to workaround which this commit was added. But the update in this PR changed DotNetCliPackageType to `aspnetcore-runtime`, which makes the version from global.json - `6.0.100` incorrect for aspnetcore. And the next upcoming update will set versions explicitly and change the DotNetCliPackageType back to `sdk`. Instead, revert this. And don't use version from global.json for now, instead relying on the version that xharnesrunner.targets sets. --- src/libraries/sendtohelix-wasm.targets | 2 +- src/libraries/sendtohelixhelp.proj | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libraries/sendtohelix-wasm.targets b/src/libraries/sendtohelix-wasm.targets index f376529b68ebb0..cdd77a64d0af62 100644 --- a/src/libraries/sendtohelix-wasm.targets +++ b/src/libraries/sendtohelix-wasm.targets @@ -97,7 +97,7 @@ true - true + true false diff --git a/src/libraries/sendtohelixhelp.proj b/src/libraries/sendtohelixhelp.proj index 6ee54596840d48..5b4e1d4831f1ac 100644 --- a/src/libraries/sendtohelixhelp.proj +++ b/src/libraries/sendtohelixhelp.proj @@ -143,6 +143,11 @@ sdk + + $([System.IO.File]::ReadAllText('$(RepoRoot)global.json')) + $([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '(%3F<="dotnet": ").*(%3F=")')) + + @@ -151,11 +156,6 @@ - - $([System.IO.File]::ReadAllText('$(RepoRoot)global.json')) - $([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '(%3F<="dotnet": ").*(%3F=")')) - - @(HelixPreCommand) $(HelixCommandPrefix) @(HelixCommandPrefixItem -> 'set "%(Identity)"', ' & ')