From 3b2ef2d39fee8841ae0e3645670d4f0bbfe83676 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Mon, 27 Apr 2020 23:56:49 +0200 Subject: [PATCH 1/8] Remove GetTargetMachineInfo from runtime --- Build.proj | 1 - Directory.Build.props | 1 - eng/Configurations.props | 5 +- eng/pipelines/installer/jobs/base-job.yml | 1 - .../jobs/steps/build-linux-package.yml | 13 ---- eng/restore/runtimeprops.targets | 7 -- src/installer/Directory.Build.props | 13 ++-- 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 | 2 - .../dev/master-build-deb-rpm-docker.sh | 10 +-- .../installer.tasks/GetTargetMachineInfo.cs | 67 ------------------- .../installer.tasks/installer.tasks.csproj | 26 ------- 14 files changed, 13 insertions(+), 144 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 0ecff09e8552be..047ec19ac493d8 100644 --- a/Build.proj +++ b/Build.proj @@ -29,7 +29,6 @@ - @@ -38,6 +37,10 @@ + $([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier.ToString().ToLowerInvariant) + win-$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant) + $(RuntimeRID.Remove($(RuntimeRID.LastIndexOf('-')))) + OSX FreeBSD NetBSD diff --git a/eng/pipelines/installer/jobs/base-job.yml b/eng/pipelines/installer/jobs/base-job.yml index 97c16e5d30ffcd..54291ad3424064 100644 --- a/eng/pipelines/installer/jobs/base-job.yml +++ b/eng/pipelines/installer/jobs/base-job.yml @@ -448,7 +448,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 e9e342b618c1e8..c6ae12827dc776 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/restore/runtimeprops.targets b/eng/restore/runtimeprops.targets deleted file mode 100644 index 945d0830f8cc90..00000000000000 --- a/eng/restore/runtimeprops.targets +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/installer/Directory.Build.props b/src/installer/Directory.Build.props index b27aac58847ce6..b0f638fd0f5374 100644 --- a/src/installer/Directory.Build.props +++ b/src/installer/Directory.Build.props @@ -80,11 +80,8 @@ .exe - - - - $(HostMachineRid.Remove($(HostMachineRid.LastIndexOf('-'))))-$(TargetArchitecture) + + $(RuntimeOS)-$(TargetArchitecture) @@ -298,9 +295,9 @@ true + $(RuntimeOS.StartsWith('debian')) or + $(RuntimeOS.StartsWith('ubuntu')) or + $(RuntimeOS.StartsWith('linuxmint'))">true true diff --git a/src/installer/Directory.Build.targets b/src/installer/Directory.Build.targets index 20b134d708ce29..7a859d808b2295 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 e19dd327b12201..0dd8ca63aef311 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 da534ca005565e..e5928c59973151 100644 --- a/src/installer/test/Directory.Build.targets +++ b/src/installer/test/Directory.Build.targets @@ -121,12 +121,8 @@ - - - - - $(_HostRid) + $(RuntimeRID) $(MSBuildProjectName) $(ArtifactsDir)tests/$(Configuration)/ diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props index f79904eea5ae95..f9dd49df57fcc2 100644 --- a/src/libraries/Directory.Build.props +++ b/src/libraries/Directory.Build.props @@ -26,8 +26,6 @@ $(RepositoryEngineeringDir)LicenseHeader.txt - - 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 e96460ece185dc..feb9747aa718fa 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 67aa53b36ec139..00000000000000 --- 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 2ed742bb359556..97abeae3f7ca79 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> - - - - - - From a7c451127d0284430023b41e15eb5e26f4e6607b Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 28 Apr 2020 17:28:35 +0200 Subject: [PATCH 2/8] Update bootstrapped SDK --- eng/Configurations.props | 2 +- global.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Configurations.props b/eng/Configurations.props index f751028a8d3188..be0b9a35e12e02 100644 --- a/eng/Configurations.props +++ b/eng/Configurations.props @@ -37,7 +37,7 @@ - $([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier.ToString().ToLowerInvariant) + $([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier) win-$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant) $(RuntimeRID.Remove($(RuntimeRID.LastIndexOf('-')))) diff --git a/global.json b/global.json index 5e5af89b0a6276..30822c34f98e9d 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.20227.9", "allowPrerelease": true, "rollForward": "major" }, "tools": { - "dotnet": "5.0.100-preview.4.20202.8" + "dotnet": "5.0.100-preview.5.20227.9" }, "native-tools": { "cmake": "3.14.2", From e194a7be9c96f76d8390ba0323b27ea9fcad9127 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 28 Apr 2020 18:19:17 +0200 Subject: [PATCH 3/8] Remove unused prop --- src/installer/Directory.Build.props | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/installer/Directory.Build.props b/src/installer/Directory.Build.props index b0f638fd0f5374..ea93cd688e4bfa 100644 --- a/src/installer/Directory.Build.props +++ b/src/installer/Directory.Build.props @@ -29,10 +29,6 @@ $(InstallerProjectRoot)signing\ - - $(ArtifactsObjDir)HostMachineInfo.props - - .NETCoreApp $(NETCoreAppFrameworkIdentifier),Version=v$(NETCoreAppFrameworkVersion) From b216729231fa0dec21f3f0427ef3af18cded3b3a Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Wed, 29 Apr 2020 09:41:54 +0200 Subject: [PATCH 4/8] Rename RuntimeRID to HostRuntimeIdentifier --- eng/Configurations.props | 6 +++--- src/installer/test/Directory.Build.targets | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/Configurations.props b/eng/Configurations.props index be0b9a35e12e02..4635f68aed28ef 100644 --- a/eng/Configurations.props +++ b/eng/Configurations.props @@ -37,9 +37,9 @@ - $([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier) - win-$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant) - $(RuntimeRID.Remove($(RuntimeRID.LastIndexOf('-')))) + $([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier) + win-$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant) + $(HostRuntimeIdentifier.Remove($(HostRuntimeIdentifier.LastIndexOf('-')))) OSX FreeBSD diff --git a/src/installer/test/Directory.Build.targets b/src/installer/test/Directory.Build.targets index e5928c59973151..82a7c6d4e60100 100644 --- a/src/installer/test/Directory.Build.targets +++ b/src/installer/test/Directory.Build.targets @@ -122,7 +122,7 @@ - $(RuntimeRID) + $(HostRuntimeIdentifier) $(MSBuildProjectName) $(ArtifactsDir)tests/$(Configuration)/ From 6d0a0b4ee8ad5b4b69912afbacc7342b6b91e9f5 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Wed, 29 Apr 2020 09:44:32 +0200 Subject: [PATCH 5/8] Remove yml tmp copying --- eng/pipelines/libraries/build-job.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/eng/pipelines/libraries/build-job.yml b/eng/pipelines/libraries/build-job.yml index c28f1db03525b2..7180fbee270e55 100644 --- a/eng/pipelines/libraries/build-job.yml +++ b/eng/pipelines/libraries/build-job.yml @@ -145,12 +145,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 From c1c1ff8f0f8711962465139465e109f4ef80cc26 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Wed, 29 Apr 2020 09:48:44 +0200 Subject: [PATCH 6/8] Update SDK --- global.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index 30822c34f98e9d..fd9f9aa4a1a8f0 100644 --- a/global.json +++ b/global.json @@ -1,11 +1,11 @@ { "sdk": { - "version": "5.0.100-preview.5.20227.9", + "version": "5.0.100-preview.5.20228.8", "allowPrerelease": true, "rollForward": "major" }, "tools": { - "dotnet": "5.0.100-preview.5.20227.9" + "dotnet": "5.0.100-preview.5.20228.8" }, "native-tools": { "cmake": "3.14.2", From f81e1d34ea13cdbcd768c0c68f45bf1291cb882c Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Wed, 29 Apr 2020 16:38:11 +0200 Subject: [PATCH 7/8] Move RuntimeOS into libraries --- eng/Configurations.props | 1 - src/libraries/Directory.Build.props | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/eng/Configurations.props b/eng/Configurations.props index 4635f68aed28ef..90749696535849 100644 --- a/eng/Configurations.props +++ b/eng/Configurations.props @@ -39,7 +39,6 @@ $([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier) win-$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant) - $(HostRuntimeIdentifier.Remove($(HostRuntimeIdentifier.LastIndexOf('-')))) OSX FreeBSD diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props index f9dd49df57fcc2..ebca1d7fa96dc8 100644 --- a/src/libraries/Directory.Build.props +++ b/src/libraries/Directory.Build.props @@ -26,6 +26,10 @@ $(RepositoryEngineeringDir)LicenseHeader.txt + + $(HostRuntimeIdentifier.Remove($(HostRuntimeIdentifier.LastIndexOf('-')))) + + From 296a8f211f2b4b63d5187e1834bc3162f22d710d Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Wed, 29 Apr 2020 16:42:50 +0200 Subject: [PATCH 8/8] Fix RuntimeOS move --- src/installer/Directory.Build.props | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/installer/Directory.Build.props b/src/installer/Directory.Build.props index ea93cd688e4bfa..37929a9530eb5c 100644 --- a/src/installer/Directory.Build.props +++ b/src/installer/Directory.Build.props @@ -76,8 +76,8 @@ .exe - - $(RuntimeOS)-$(TargetArchitecture) + + $(HostRuntimeIdentifier.Remove($(HostRuntimeIdentifier.LastIndexOf('-'))))-$(TargetArchitecture) @@ -291,9 +291,9 @@ true + $(HostRuntimeIdentifier.StartsWith('debian')) or + $(HostRuntimeIdentifier.StartsWith('ubuntu')) or + $(HostRuntimeIdentifier.StartsWith('linuxmint'))">true true