From a1af15d229c44f72d639c686a66a621196fd4172 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Mon, 4 May 2020 11:45:15 +0200 Subject: [PATCH] Update SDK and remove RID calculation in favor of RuntimeInformation (#35538) * Remove GetTargetMachineInfo from runtime * Update bootstrapped SDK * Remove unused prop * Rename RuntimeRID to HostRuntimeIdentifier * Remove yml tmp copying * Update SDK * Move RuntimeOS into libraries * Fix RuntimeOS move --- Build.proj | 1 - Directory.Build.props | 1 - eng/Configurations.props | 4 +- eng/pipelines/installer/jobs/base-job.yml | 1 - .../installer/jobs/steps/build-linux-package.yml | 13 ----- eng/pipelines/libraries/build-job.yml | 6 -- eng/restore/runtimeprops.targets | 7 --- global.json | 4 +- src/installer/Directory.Build.props | 17 ++---- src/installer/Directory.Build.targets | 4 +- src/installer/pkg/Directory.Build.targets | 1 + src/installer/test/Directory.Build.targets | 6 +- src/libraries/Directory.Build.props | 4 +- .../scripts/dev/master-build-deb-rpm-docker.sh | 10 +--- .../tasks/installer.tasks/GetTargetMachineInfo.cs | 67 ---------------------- .../tasks/installer.tasks/installer.tasks.csproj | 26 --------- 16 files changed, 17 insertions(+), 155 deletions(-) delete mode 100644 eng/restore/runtimeprops.targets delete mode 100644 tools-local/tasks/installer.tasks/GetTargetMachineInfo.cs diff --git a/Build.proj b/Build.proj index 0ecff09e..047ec19 100644 --- a/Build.proj +++ b/Build.proj @@ -29,7 +29,6 @@ - @@ -38,6 +37,9 @@ + $([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier) + win-$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant) + OSX FreeBSD NetBSD diff --git a/eng/pipelines/installer/jobs/base-job.yml b/eng/pipelines/installer/jobs/base-job.yml index 51070d1..8a62e0b 100644 --- a/eng/pipelines/installer/jobs/base-job.yml +++ b/eng/pipelines/installer/jobs/base-job.yml @@ -460,7 +460,6 @@ jobs: # independent installers on this leg, but we need to do it somewhere.) - template: steps/build-linux-package.yml parameters: - buildTraversalBuildDependencies: true distroRid: ${{ packageBuild.imageRid }} image: ${{ packageBuild.image }} packageStepDescription: Runtime Deps, Runtime, Framework Packs installers diff --git a/eng/pipelines/installer/jobs/steps/build-linux-package.yml b/eng/pipelines/installer/jobs/steps/build-linux-package.yml index 3742e33..e0129cc 100644 --- a/eng/pipelines/installer/jobs/steps/build-linux-package.yml +++ b/eng/pipelines/installer/jobs/steps/build-linux-package.yml @@ -1,5 +1,4 @@ parameters: - buildTraversalBuildDependencies: false distroRid: null image: null outputRidArg: '' @@ -8,18 +7,6 @@ parameters: subsetArg: '' steps: -- ${{ if eq(parameters.buildTraversalBuildDependencies, true) }}: - - script: | - set -x - df -h - $(DockerRunMSBuild) ${{ parameters.image }} $(MSBuildScript) \ - --ci \ - /root/runtime/tools-local/tasks/installer.tasks/installer.tasks.csproj \ - /t:Restore /t:Build /t:CreateHostMachineInfoFile \ - $(CommonMSBuildArgs) \ - /bl:msbuild.${{ parameters.distroRid }}.traversaldependencies.binlog - displayName: ====== Build traversal build dependencies - ${{ parameters.distroRid }} - - script: | set -x df -h diff --git a/eng/pipelines/libraries/build-job.yml b/eng/pipelines/libraries/build-job.yml index 3859cbe..3f01453 100644 --- a/eng/pipelines/libraries/build-job.yml +++ b/eng/pipelines/libraries/build-job.yml @@ -157,12 +157,6 @@ jobs: targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/packages condition: and(succeeded(), eq(variables['_librariesBuildProducedPackages'], true)) - - task: CopyFiles@2 - displayName: Prepare tmp assets to publish - inputs: - sourceFolder: $(Build.SourcesDirectory)/artifacts/tmp - targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/tmp - - template: /eng/pipelines/common/upload-artifact-step.yml parameters: rootFolder: $(Build.ArtifactStagingDirectory)/artifacts diff --git a/eng/restore/runtimeprops.targets b/eng/restore/runtimeprops.targets deleted file mode 100644 index 945d083..0000000 --- a/eng/restore/runtimeprops.targets +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/global.json b/global.json index 5ee2d38..9870c2a 100644 --- a/global.json +++ b/global.json @@ -1,11 +1,11 @@ { "sdk": { - "version": "5.0.100-preview.4.20202.8", + "version": "5.0.100-preview.5.20228.8", "allowPrerelease": true, "rollForward": "major" }, "tools": { - "dotnet": "5.0.100-preview.4.20202.8" + "dotnet": "5.0.100-preview.5.20228.8" }, "native-tools": { "cmake": "3.14.2", diff --git a/src/installer/Directory.Build.props b/src/installer/Directory.Build.props index 5bd3158..db4b337 100644 --- a/src/installer/Directory.Build.props +++ b/src/installer/Directory.Build.props @@ -30,10 +30,6 @@ - $(ArtifactsObjDir)HostMachineInfo.props - - - .NETCoreApp $(NETCoreAppFrameworkIdentifier),Version=v$(NETCoreAppFrameworkVersion) .NET $(NETCoreAppFrameworkVersion) @@ -80,11 +76,8 @@ .exe - - - - $(HostMachineRid.Remove($(HostMachineRid.LastIndexOf('-'))))-$(TargetArchitecture) + + $(HostRuntimeIdentifier.Remove($(HostRuntimeIdentifier.LastIndexOf('-'))))-$(TargetArchitecture) @@ -302,9 +295,9 @@ true + $(HostRuntimeIdentifier.StartsWith('debian')) or + $(HostRuntimeIdentifier.StartsWith('ubuntu')) or + $(HostRuntimeIdentifier.StartsWith('linuxmint'))">true true diff --git a/src/installer/Directory.Build.targets b/src/installer/Directory.Build.targets index 20b134d..7a859d8 100644 --- a/src/installer/Directory.Build.targets +++ b/src/installer/Directory.Build.targets @@ -12,10 +12,8 @@ + - - - diff --git a/src/installer/pkg/Directory.Build.targets b/src/installer/pkg/Directory.Build.targets index e19dd32..0dd8ca6 100644 --- a/src/installer/pkg/Directory.Build.targets +++ b/src/installer/pkg/Directory.Build.targets @@ -112,6 +112,7 @@ + diff --git a/src/installer/test/Directory.Build.targets b/src/installer/test/Directory.Build.targets index da534ca..82a7c6d 100644 --- a/src/installer/test/Directory.Build.targets +++ b/src/installer/test/Directory.Build.targets @@ -121,12 +121,8 @@ - - - - - $(_HostRid) + $(HostRuntimeIdentifier) $(MSBuildProjectName) $(ArtifactsDir)tests/$(Configuration)/ diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props index 4540c81..94ea6b7 100644 --- a/src/libraries/Directory.Build.props +++ b/src/libraries/Directory.Build.props @@ -26,7 +26,9 @@ $(RepositoryEngineeringDir)LicenseHeader.txt - + + $(HostRuntimeIdentifier.Remove($(HostRuntimeIdentifier.LastIndexOf('-')))) + diff --git a/tools-local/scripts/dev/master-build-deb-rpm-docker.sh b/tools-local/scripts/dev/master-build-deb-rpm-docker.sh index e96460e..feb9747 100755 --- a/tools-local/scripts/dev/master-build-deb-rpm-docker.sh +++ b/tools-local/scripts/dev/master-build-deb-rpm-docker.sh @@ -62,18 +62,10 @@ package() { shift containerized "$image" bash -c " - eng/common/msbuild.sh \ - tools-local/tasks/installer.tasks/installer.tasks.csproj \ - /t:Restore /t:Build /t:CreateHostMachineInfoFile \ - /p:Configuration=Release \ - /p:TargetOS=Linux \ - /p:PortableBuild=false \ - /p:TargetArchitecture=x64 \ - /bl:artifacts/msbuild.$name.traversaldependencies.binlog; ./build.sh \ --ci \ + --subset installer /p:OfficialBuildId=20190101.1 \ - /p:Subset=Installer \ /p:UsePrebuiltPortableBinariesForInstallers=true \ /p:SharedFrameworkPublishDir=/work/artifacts/obj/linux-x64.Release/sharedFrameworkPublish/ \ /p:InstallerSourceOSPlatformConfig=linux-x64.Release \ diff --git a/tools-local/tasks/installer.tasks/GetTargetMachineInfo.cs b/tools-local/tasks/installer.tasks/GetTargetMachineInfo.cs deleted file mode 100644 index 67aa53b..0000000 --- a/tools-local/tasks/installer.tasks/GetTargetMachineInfo.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.Build.Framework; -using System.Runtime.InteropServices; - -namespace Microsoft.DotNet.Build.Tasks -{ - public class GetTargetMachineInfo : BuildTask - { - [Output] - public string TargetOS { get; set; } - - [Output] - public string TargetArch { get; set; } - - [Output] - public string RuntimeIdentifier { get; set; } - - public override bool Execute() - { - switch (RuntimeInformation.OSArchitecture) - { - case Architecture.X64: - TargetArch = "x64"; - break; - case Architecture.X86: - TargetArch = "x86"; - break; - case Architecture.Arm: - TargetArch = "arm"; - break; - case Architecture.Arm64: - TargetArch = "arm64"; - break; - } - - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - TargetOS = "Windows_NT"; - else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - TargetOS = "Linux"; - else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - TargetOS = "OSX"; - else if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD"))) - TargetOS = "FreeBSD"; - else if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD"))) - TargetOS = "NetBSD"; - - RuntimeIdentifier = Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.GetRuntimeIdentifier(); - - if (TargetArch == null) - { - Log.LogError("{0} is null", nameof(TargetArch)); - return false; - } - - if (TargetOS == null) - { - Log.LogError("{0} is null", nameof(TargetOS)); - return false; - } - - return true; - } - } -} diff --git a/tools-local/tasks/installer.tasks/installer.tasks.csproj b/tools-local/tasks/installer.tasks/installer.tasks.csproj index 0c8c3b9..356f22a 100644 --- a/tools-local/tasks/installer.tasks/installer.tasks.csproj +++ b/tools-local/tasks/installer.tasks/installer.tasks.csproj @@ -1,5 +1,4 @@ - netstandard2.0 $(TargetFrameworks);net46 @@ -14,7 +13,6 @@ - @@ -44,28 +42,4 @@ - - - - - - - - - -<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <HostMachineRid>$(HostMachineRid)</HostMachineRid> - </PropertyGroup> -</Project> - - - - - - -- 2.7.4