From 5ed1612ad8e283ae0e90849051a30751f0b36366 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 1 Feb 2023 04:37:27 +0000 Subject: [PATCH] Install workload manifests in sdk band version derived from the .. installer version. - This is only for running Wasm.Build.Tests Two new properties are added: - `SdkBandVersionForWorkload_ComputedFromInstaller`: this is based on the version derived from `dotnet --version`. `8.0.0-alpha.1.1234.1` becomes `8.0.0-alpha.1`, and is used as the path where the manifests get installed for testing: `sdk-manifests/$(SdkBandVersionForWorkload_ComputedFromInstaller)` - `SdkBandVersionForWorkload_FromRuntimeVersions`: this is the version band used for the packages generated. And simply rename of the earlier `$(SdkBandVersionForWorkload)`. --- eng/Versions.props | 2 +- eng/testing/tests.wasm.targets | 7 +--- eng/testing/workloads-testing.targets | 39 ++++++++++++++++++- ...ad.Mono.Toolchain.Current.Manifest.pkgproj | 5 ++- ...kload.Mono.Toolchain.net6.Manifest.pkgproj | 5 ++- ...kload.Mono.Toolchain.net7.Manifest.pkgproj | 5 ++- .../InstallWorkloadFromArtifacts.cs | 9 +++-- 7 files changed, 58 insertions(+), 14 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index c8ceefc22ab17..e6a8cb11f587a 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -12,7 +12,7 @@ preview 1 -$(PreReleaseVersionLabel).$(PreReleaseVersionIteration) - $(SdkBandVersion)$(WorkloadVersionSuffix) + $(SdkBandVersion)$(WorkloadVersionSuffix) $(MajorVersion).$(MinorVersion).0.0 diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets index 486be5fda5da5..d7a649d5650b2 100644 --- a/eng/testing/tests.wasm.targets +++ b/eng/testing/tests.wasm.targets @@ -341,20 +341,17 @@ + Version="$(PackageVersionForWorkloadManifests)" /> + Version="$(PackageVersionForWorkloadManifests)" /> diff --git a/eng/testing/workloads-testing.targets b/eng/testing/workloads-testing.targets index 9b32d976a75f6..cc7c243c6ba3b 100644 --- a/eng/testing/workloads-testing.targets +++ b/eng/testing/workloads-testing.targets @@ -11,11 +11,12 @@ <_SdkWithNoWorkloadStampPath>$([MSBuild]::NormalizePath($(_SdkWithNoWorkloadPath), '.version-for-none-$(SdkVersionForWorkloadTesting).stamp')) $(InstallWorkloadUsingArtifactsDependsOn); + _ProvisionDotNetForWorkloadTesting; + _GetDotNetVersion; _SetPackageVersionForWorkloadsTesting; _GetNuGetsToBuild; _PreparePackagesForWorkloadInstall; GetWorkloadInputs; - _ProvisionDotNetForWorkloadTesting; _InstallWorkloads @@ -85,6 +86,39 @@ + + + <_DotNetPath>$([MSBuild]::NormalizePath($(_SdkWithNoWorkloadPath), 'dotnet')) + <_DotNetPath Condition="$([MSBuild]::IsOSPlatform('windows'))">$(_DotNetPath).exe + <_DotNetVersionCommand>$(_DotNetPath) --version + + + + + + + + + + + + $(SdkBandVersion)$([System.Text.RegularExpressions.Regex]::Match($(_DotNetVersionOutput), `-[A-z]*[\.]*\d*`)) + + + + + + @@ -226,7 +260,8 @@ + + - Microsoft.NET.Workload.Mono.ToolChain.Current.Manifest-$(SdkBandVersionForWorkload) + Microsoft.NET.Workload.Mono.ToolChain.Current.Manifest-$(SdkBandVersionForWorkload_FromRuntimeVersions) diff --git a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.net6.Manifest/Microsoft.NET.Workload.Mono.Toolchain.net6.Manifest.pkgproj b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.net6.Manifest/Microsoft.NET.Workload.Mono.Toolchain.net6.Manifest.pkgproj index 73379967202e9..91ad9379b54d3 100644 --- a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.net6.Manifest/Microsoft.NET.Workload.Mono.Toolchain.net6.Manifest.pkgproj +++ b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.net6.Manifest/Microsoft.NET.Workload.Mono.Toolchain.net6.Manifest.pkgproj @@ -6,9 +6,12 @@ + + - Microsoft.NET.Workload.Mono.ToolChain.net6.Manifest-$(SdkBandVersionForWorkload) + Microsoft.NET.Workload.Mono.ToolChain.net6.Manifest-$(SdkBandVersionForWorkload_FromRuntimeVersions) diff --git a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.net7.Manifest/Microsoft.NET.Workload.Mono.Toolchain.net7.Manifest.pkgproj b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.net7.Manifest/Microsoft.NET.Workload.Mono.Toolchain.net7.Manifest.pkgproj index 2680753ae6cc2..af11a5c6a6059 100644 --- a/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.net7.Manifest/Microsoft.NET.Workload.Mono.Toolchain.net7.Manifest.pkgproj +++ b/src/mono/nuget/Microsoft.NET.Workload.Mono.Toolchain.net7.Manifest/Microsoft.NET.Workload.Mono.Toolchain.net7.Manifest.pkgproj @@ -6,9 +6,12 @@ + + - Microsoft.NET.Workload.Mono.ToolChain.net7.Manifest-$(SdkBandVersionForWorkload) + Microsoft.NET.Workload.Mono.ToolChain.net7.Manifest-$(SdkBandVersionForWorkload_FromRuntimeVersions) diff --git a/src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs b/src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs index 1e35ff833c67c..354d08a2d6657 100644 --- a/src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs +++ b/src/tasks/WorkloadBuildTasks/InstallWorkloadFromArtifacts.cs @@ -26,7 +26,10 @@ public class InstallWorkloadFromArtifacts : Task public ITaskItem[] InstallTargets { get; set; } = Array.Empty(); [Required, NotNull] - public string? VersionBand { get; set; } + public string? VersionBandForSdkManifestsDir { get; set; } + + [Required, NotNull] + public string? VersionBandForManifestPackages { get; set; } [Required, NotNull] public string? LocalNuGetsPath { get; set; } @@ -301,7 +304,7 @@ private bool InstallWorkloadManifest(ITaskItem workloadId, string name, string v // Multiple directories for a manifest, differing only in case causes // workload install to fail due to duplicate manifests! // This is applicable only on case-sensitive filesystems - string manifestVersionBandDir = Path.Combine(sdkDir, "sdk-manifests", VersionBand); + string manifestVersionBandDir = Path.Combine(sdkDir, "sdk-manifests", VersionBandForSdkManifestsDir); if (!Directory.Exists(manifestVersionBandDir)) { Log.LogMessage(MessageImportance.Low, $" Could not find {manifestVersionBandDir}. Creating it.."); @@ -310,7 +313,7 @@ private bool InstallWorkloadManifest(ITaskItem workloadId, string name, string v string outputDir = FindSubDirIgnoringCase(manifestVersionBandDir, name); - PackageReference pkgRef = new(Name: $"{name}.Manifest-{VersionBand}", + PackageReference pkgRef = new(Name: $"{name}.Manifest-{VersionBandForManifestPackages}", Version: version, OutputDir: outputDir, relativeSourceDir: "data");