Merged PR 526559: Skip a bunch of NuGets when running on macOS

Skip a bunch of NuGets when running on macOS
This commit is contained in:
Aleksandar Milicevic 2020-01-03 15:45:22 +00:00
Родитель 5947af3e68
Коммит ea97ed948d
21 изменённых файлов: 66 добавлений и 106 удалений

Просмотреть файл

@ -1,7 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
module({
name: "VisualCppTools.Community.VS2017Layout",
nameResolutionSemantics: NameResolutionSemantics.implicitProjectReferences,
});

Просмотреть файл

@ -3,8 +3,7 @@
import {Transformer} from "Sdk.Transformers";
// This is an dummy facade for the VisualCppTools.Community.VS2017Layout package,
// it's used to avoid downloading the package on non-windows systems
// This is an empty facade for a Microsoft internal package.
namespace Contents {
export declare const qualifier: {
@ -12,7 +11,7 @@ namespace Contents {
@@public
export const all: StaticDirectory = Transformer.sealDirectory({
root: d`.`,
root: d`.`,
files: []
});
}

Просмотреть файл

@ -2,6 +2,13 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
module({
name: "Aria.Cpp.SDK",
name: "Aria.Cpp.SDK.win-x64",
nameResolutionSemantics: NameResolutionSemantics.implicitProjectReferences,
projects: [f`Aria.Cpp.SDK.win-x64.dsc`]
});
module({
name: "Aria.Cpp.SDK.osx-x64",
nameResolutionSemantics: NameResolutionSemantics.implicitProjectReferences,
projects: [f`Aria.Cpp.SDK.osx-x64.dsc`]
});

Просмотреть файл

@ -1,7 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
import {Transformer} from "Sdk.Transformers";
@@public
export const extracted = Transformer.reSealPartialDirectory(importFrom("Dotnet-Runtime").Contents.all, r`linux-x64`);

Просмотреть файл

@ -12,9 +12,3 @@ module({
nameResolutionSemantics: NameResolutionSemantics.implicitProjectReferences,
projects: [f`DotNet-Runtime.osx-x64.dsc`]
});
module({
name: "DotNet-Runtime.linux-x64",
nameResolutionSemantics: NameResolutionSemantics.implicitProjectReferences,
projects: [f`DotNet-Runtime.linux-x64.dsc`]
});

Просмотреть файл

@ -3,9 +3,6 @@
import {Artifact, Cmd, Tool, Transformer} from "Sdk.Transformers";
@@public
export const tool = getPowerShellTool();
/**
* Helper method to invoke some powershell commands
*/
@ -34,7 +31,7 @@ export function executeCommands(commands:string[], executeArgs: Transformer.Exec
return Transformer.execute(
Object.merge<Transformer.ExecuteArguments>({
tool: tool,
tool: getPowerShellTool(),
workingDirectory: d`.`,
arguments: arguments,
environmentVariables: [

Просмотреть файл

@ -22,10 +22,6 @@ namespace Helpers
pkgContents = importFrom("DotNet-Runtime.osx-x64").extracted;
executable = r`dotnet`;
break;
case "unix":
pkgContents = importFrom("DotNet-Runtime.linux-x64").extracted;
executable = r`dotnet`;
break;
default:
Contract.fail(`The current DotNetCore Runtime package doesn't support the current target runtime: ${host.os}. Esure you run on a supported OS -or- update the DotNet-Runtime package to have the version embdded.`);
}

Просмотреть файл

@ -10,7 +10,7 @@ export declare const qualifier : Managed.TargetFrameworks.All;
const qTestContents = importFrom("CB.QTest").Contents.all;
@@public
export const qTestTool: Transformer.ToolDefinition = {
export const qTestTool: Transformer.ToolDefinition = Context.getCurrentHost().os === "win" && {
exe: qTestContents.getFile(r`tools/DBS.QTest.exe`),
description: "SelfHost Dev Build QTest",
runtimeDirectoryDependencies: [

Просмотреть файл

@ -1,11 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
import {Transformer} from "Sdk.Transformers";
import {createPublicDotNetRuntime} from "DotNet-Runtime.Common";
const v3 = <StaticDirectory>importFrom("DotNet-Runtime.linux-x64.3.1.0").extracted;
const v2 = <StaticDirectory>importFrom("DotNet-Runtime.linux-x64.2.2.2").extracted;
@@public
export const extracted = createPublicDotNetRuntime(v3, v2);

Просмотреть файл

@ -5,7 +5,6 @@ import {Transformer} from "Sdk.Transformers";
import {createPublicDotNetRuntime} from "DotNet-Runtime.Common";
const v3 = <StaticDirectory>importFrom("DotNet-Runtime.osx-x64.3.1.0").extracted;
const v2 = <StaticDirectory>importFrom("DotNet-Runtime.osx-x64.2.2.2").extracted;
@@public
export const extracted = createPublicDotNetRuntime(v3, v2);
export const extracted = createPublicDotNetRuntime(v3, undefined);

Просмотреть файл

@ -2,10 +2,12 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
import {Transformer} from "Sdk.Transformers";
import * as BuildXLSdk from "Sdk.BuildXL";
import {createPublicDotNetRuntime} from "DotNet-Runtime.Common";
const v3 = <StaticDirectory>importFrom("DotNet-Runtime.win-x64.3.1.0").extracted;
const v2 = <StaticDirectory>importFrom("DotNet-Runtime.win-x64.2.2.2").extracted;
const isWinOs = Context.getCurrentHost().os === "win";
@@public
export const extracted = createPublicDotNetRuntime(v3, v2);
export const extracted = createPublicDotNetRuntime(
isWinOs ? <StaticDirectory>importFrom("DotNet-Runtime.win-x64.3.1.0").extracted : undefined,
isWinOs ? <StaticDirectory>importFrom("DotNet-Runtime.win-x64.2.2.2").extracted : undefined);

Просмотреть файл

@ -5,18 +5,22 @@ import {Transformer} from "Sdk.Transformers";
@@public
export function createPublicDotNetRuntime(v3Runtime : StaticDirectory, v2Runtime: StaticDirectory) : StaticDirectory {
const netCoreAppV2 = v2Runtime.contents.filter(file => file.path.isWithin(d`${v2Runtime.root}/shared`));
const netCoreAppV2 = v2Runtime !== undefined
? v2Runtime.contents.filter(file => file.path.isWithin(d`${v2Runtime.root}/shared`))
: [];
// We create a package that has dotnet executable and related SDK, plus the V2 SDK
const dotNetRuntimeRoot = Context.getNewOutputDirectory("DotNet-Runtime");
const sealDirectory = Transformer.sealDirectory(
return Transformer.sealDirectory(
dotNetRuntimeRoot,
[
...v3Runtime.contents.map(file => Transformer.copyFile(file, file.path.relocate(v3Runtime.root, dotNetRuntimeRoot))),
...netCoreAppV2.map(file => Transformer.copyFile(file, file.path.relocate(v2Runtime.root, dotNetRuntimeRoot)))
...(v3Runtime !== undefined
? v3Runtime.contents.map(file => Transformer.copyFile(file, file.path.relocate(v3Runtime.root, dotNetRuntimeRoot)))
: []),
...(v2Runtime !== undefined
? netCoreAppV2.map(file => Transformer.copyFile(file, file.path.relocate(v2Runtime.root, dotNetRuntimeRoot)))
: [])
]
);
return sealDirectory;
}

Просмотреть файл

@ -17,12 +17,6 @@ module({
projects: [f`DotNet-Runtime.osx-x64.dsc`]
});
module({
name: "DotNet-Runtime.linux-x64",
nameResolutionSemantics: NameResolutionSemantics.implicitProjectReferences,
projects: [f`DotNet-Runtime.linux-x64.dsc`]
});
module({
name: "DotNet-Runtime.Common",
nameResolutionSemantics: NameResolutionSemantics.implicitProjectReferences,

Просмотреть файл

@ -1120,7 +1120,8 @@ namespace BuildXL.FrontEnd.Nuget
var weakFingerprint = "nuget://" + string.Join("&", fingerprintParams);
var identity = PackageIdentity.Nuget(package.Id, package.Version, package.Alias);
var maybePackage = package.OsSkip.Contains(Host.Current.CurrentOS.GetDScriptValue())
var currentOs = Host.Current.CurrentOS.GetDScriptValue();
var maybePackage = package.OsSkip?.Contains(currentOs) == true
? PackageDownloadResult.EmptyStub(weakFingerprint, identity, layout.PackageFolder)
: await m_host.DownloadPackage(
weakFingerprint,

Просмотреть файл

@ -83,7 +83,7 @@ namespace Sandbox {
files: globR(d`Sandbox/Sandbox.xcodeproj`, "*")
});
const ariaPkg = importFrom("Aria.Cpp.SDK");
const ariaPkg = importFrom("Aria.Cpp.SDK.osx-x64");
const ariaXcconfig = Transformer.writeData({
outputPath: p`${Context.getNewOutputDirectory("xcconfig")}/Aria.xcconfig`,
contents: {

Просмотреть файл

@ -11,6 +11,9 @@ namespace BuildXL.Utilities.Configuration.Mutable
/// <nodoc />
public NugetPackage()
{
OsSkip = new List<string>();
DependentPackageIdsToSkip = new List<string>();
DependentPackageIdsToIgnore = new List<string>();
}
/// <nodoc />

Просмотреть файл

@ -16,7 +16,7 @@ namespace AriaNative {
const needNativeAria = Context.getCurrentHost().os === "win" && BuildXLSdk.Flags.isMicrosoftInternal;
const platform: "x86" | "x64" = "x64";
const AriaPkgContents = importFrom("Aria.Cpp.SDK").Contents.all;
const AriaPkgContents = importFrom("Aria.Cpp.SDK.win-x64").Contents.all;
const WindowsSdk = importFrom("WindowsSdk").withQualifier({platform: platform});
const VisualCpp = importFrom("VisualCpp").withQualifier({platform: platform});

Просмотреть файл

@ -14,7 +14,16 @@
"Component": {
"Type": "NuGet",
"NuGet": {
"Name": "Aria.Cpp.SDK",
"Name": "Aria.Cpp.SDK.osx-x64",
"Version": "8.5.6"
}
}
},
{
"Component": {
"Type": "NuGet",
"NuGet": {
"Name": "Aria.Cpp.SDK.win-x64",
"Version": "8.5.6"
}
}

Просмотреть файл

@ -30,9 +30,6 @@ config({
f`Public/Sdk/Public/Prelude/package.config.dsc`, // Prelude cannot be named module because it is a v1 module
f`Public/Sdk/Public/Transformers/package.config.dsc`, // Transformers cannot be renamed yet because office relies on the filename
...globR(d`Public/Sdk`, "module.config.dsc"),
...addIf(Context.getCurrentHost().os !== "win",
f`private/Facades/VisualCppTools.Community.VS2017Layout/module.config.dsc`
),
]
},
{
@ -74,9 +71,9 @@ config({
{ id: "RuntimeContracts", version: "0.1.9.1" },
{ id: "Microsoft.NETFramework.ReferenceAssemblies.net451", version: "1.0.0-alpha-5"},
{ id: "Microsoft.NETFramework.ReferenceAssemblies.net461", version: "1.0.0-alpha-5"},
{ id: "Microsoft.NETFramework.ReferenceAssemblies.net472", version: "1.0.0-alpha-5"},
{ id: "Microsoft.NETFramework.ReferenceAssemblies.net451", version: "1.0.0-alpha-5", osSkip: [ "macOS" ]},
{ id: "Microsoft.NETFramework.ReferenceAssemblies.net461", version: "1.0.0-alpha-5", osSkip: [ "macOS" ]},
{ id: "Microsoft.NETFramework.ReferenceAssemblies.net472", version: "1.0.0-alpha-5" },
{ id: "EntityFramework", version: "6.0.0" },
@ -138,7 +135,7 @@ config({
{ id: "NuGet.Versioning", version: "4.6.0" }, // Can't use the latest becuase nuget extracts to folder with metadata which we don't support yet.
// Cpp Sdk
...(Context.getCurrentHost().os === "win" ? [{ id: "VisualCppTools.Community.VS2017Layout", version: "14.11.25506"}] : []),
{ id: "VisualCppTools.Community.VS2017Layout", version: "14.11.25506", osSkip: [ "macOS" ] },
// ProjFS (virtual file system)
{ id: "Microsoft.Windows.ProjFS", version: "1.0.19079.1" },
@ -254,14 +251,14 @@ config({
{ id: "Microsoft.NETCore.DotNetAppHost", version: "2.2.0", alias: "Microsoft.NETCore.DotNetAppHost.220" },
// .NET Core win-x64 runtime deps
{ id: "Microsoft.NETCore.App.Host.win-x64", version: "3.1.0" },
{ id: "Microsoft.NETCore.App.Runtime.win-x64", version: "3.1.0" },
{ id: "runtime.win-x64.Microsoft.NETCore.DotNetHostResolver", version: "3.1.0" },
{ id: "runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy", version: "3.1.0" },
{ id: "Microsoft.NETCore.App.Host.win-x64", version: "3.1.0", osSkip: [ "macOS" ] },
{ id: "Microsoft.NETCore.App.Runtime.win-x64", version: "3.1.0", osSkip: [ "macOS" ] },
{ id: "runtime.win-x64.Microsoft.NETCore.DotNetHostResolver", version: "3.1.0", osSkip: [ "macOS" ] },
{ id: "runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy", version: "3.1.0", osSkip: [ "macOS" ] },
{ id: "runtime.win-x64.Microsoft.NETCore.DotNetAppHost", version: "2.2.0", alias: "runtime.win-x64.Microsoft.NETCore.DotNetAppHost.220" },
{ id: "runtime.win-x64.Microsoft.NETCore.DotNetHostResolver", version: "2.2.0", alias: "runtime.win-x64.Microsoft.NETCore.DotNetHostResolver.220" },
{ id: "runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy", version: "2.2.0", alias: "runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy.220" },
{ id: "runtime.win-x64.Microsoft.NETCore.DotNetAppHost", version: "2.2.0", alias: "runtime.win-x64.Microsoft.NETCore.DotNetAppHost.220", osSkip: [ "macOS" ] },
{ id: "runtime.win-x64.Microsoft.NETCore.DotNetHostResolver", version: "2.2.0", alias: "runtime.win-x64.Microsoft.NETCore.DotNetHostResolver.220", osSkip: [ "macOS" ] },
{ id: "runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy", version: "2.2.0", alias: "runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy.220", osSkip: [ "macOS" ] },
// .NET Core osx-x64 runtime deps
{ id: "Microsoft.NETCore.App.Host.osx-x64", version: "3.1.0" },
@ -401,8 +398,8 @@ config({
{ id: "System.Collections.Immutable", version: "1.5.0" },
{ id: "runtime.native.System", version: "4.3.0" },
{ id: "runtime.win7-x64.runtime.native.System.Data.SqlClient.sni", version: "4.3.0" },
{ id: "runtime.win7-x86.runtime.native.System.Data.SqlClient.sni", version: "4.3.0" },
{ id: "runtime.win7-x64.runtime.native.System.Data.SqlClient.sni", version: "4.3.0", osSkip: [ "macOS" ] },
{ id: "runtime.win7-x86.runtime.native.System.Data.SqlClient.sni", version: "4.3.0", osSkip: [ "macOS" ] },
{ id: "runtime.native.System.Data.SqlClient.sni", version: "4.3.0" },
{ id: "runtime.native.System.Net.Http", version: "4.3.0" },
{ id: "runtime.native.System.IO.Compression", version: "4.3.0" },
@ -463,8 +460,8 @@ config({
{ id: "BuildXL.Tools.AppHostPatcher", version: "1.0.0" },
// CoreRT
{ id: "runtime.osx-x64.Microsoft.DotNet.ILCompiler", version: "1.0.0-alpha-27527-01" },
{ id: "runtime.win-x64.Microsoft.DotNet.ILCompiler", version: "1.0.0-alpha-27527-01" },
{ id: "runtime.osx-x64.Microsoft.DotNet.ILCompiler", version: "1.0.0-alpha-27527-01", osSkip: [ "win" ] },
{ id: "runtime.win-x64.Microsoft.DotNet.ILCompiler", version: "1.0.0-alpha-27527-01", osSkip: [ "macOS" ] },
// Kusto SDK (for netstandard)
{ id: "Microsoft.Azure.Kusto.Cloud.Platform.Azure.NETStandard", version: "6.1.8",
@ -540,12 +537,6 @@ config({
hash: "VSO0:FCB44A9D07D3923DB197C05A710FEBBB060649555418A067E04EAE1A06CBCE4400",
archiveType: "tgz",
},
{
moduleName: "DotNet-Runtime.linux-x64.3.1.0",
url: "https://download.visualstudio.microsoft.com/download/pr/5d139dff-4ca0-4e0c-a68b-0976281d5b2d/d306f725466e058842faa25bf1b2f379/dotnet-runtime-3.1.0-linux-x64.tar.gz",
hash: "VSO0:BE98235AD947C48B4E5B0E428D263C488E4F16B3FD81AF9CB930B985341107CD00",
archiveType: "tgz",
},
// The following are needed for dotnet core MSBuild test deployments
{
moduleName: "DotNet-Runtime.win-x64.2.2.2",
@ -553,18 +544,6 @@ config({
hash: "VSO0:6BBAE77F9BA0231C90ABD9EA720FF886E8613CE8EF29D8B657AF201E2982829600",
archiveType: "zip",
},
{
moduleName: "DotNet-Runtime.osx-x64.2.2.2",
url: "https://download.visualstudio.microsoft.com/download/pr/d1f0dfb3-b6bd-42ae-895f-f149bf1d90ca/9b1fb91a9692fc31d6fc83e97caba4cd/dotnet-runtime-2.2.2-osx-x64.tar.gz",
hash: "VSO0:88B2B6E8CEF711E108FDE529E781F555516634CD442B3503B712D22947F0788700",
archiveType: "tgz",
},
{
moduleName: "DotNet-Runtime.linux-x64.2.2.2",
url: "https://download.visualstudio.microsoft.com/download/pr/97b97652-4f74-4866-b708-2e9b41064459/7c722daf1a80a89aa8c3dec9103c24fc/dotnet-runtime-2.2.2-linux-x64.tar.gz",
hash: "VSO0:6E5172671364C65B06C9940468A62BAF70EE27392CB2CA8B2C8BFE058CCD088300",
archiveType: "tgz",
},
// NodeJs
{
moduleName: "NodeJs.win-x64",

Просмотреть файл

@ -12,14 +12,15 @@ export const pkgs = isMicrosoftInternal ? [
// Runtime dependencies used for macOS deployments
{ id: "runtime.osx-x64.BuildXL", version: "3.0.99" },
{ id: "Aria.Cpp.SDK", version: "8.5.6" },
{ id: "Aria.Cpp.SDK.osx-x64", version: "8.5.6" },
{ id: "Aria.Cpp.SDK.win-x64", version: "8.5.6", osSkip: [ "macOS"] },
{ id: "CB.QTest", version: "19.11.27.124129" },
{ id: "CB.QTest", version: "19.11.27.124129", osSkip: [ "macOS" ] },
{ id: "BuildXL.Tracing.AriaTenantToken", version: "1.0.0" },
// Windows Sdk so microsoft dev's don't have to install it.
{ id: "WindowsSdk.Corext", version: "10.0.16299.1", alias: "Windows.Sdk" },
{ id: "WindowsSdk.Corext", version: "10.0.16299.1", alias: "Windows.Sdk", osSkip: [ "macOS" ] },
// Artifact packages and dependencies
{ id: "Microsoft.VisualStudio.Services.ArtifactServices.Shared", version: "17.150.28901-buildid9382555", dependentPackageIdsToSkip: ["*"], dependentPackageIdsToIgnore: ["BuildXL.Cache.Hashing"] },
@ -45,10 +46,10 @@ export const pkgs = isMicrosoftInternal ? [
// Internal pacakged version to avoid downloading from the web but the trusted stable internal feed:
{ id: "NodeJs", version: "13.3.0-noTest" },
{ id: "PowerShell.Core", version: "6.1.0" },
{ id: "PowerShell.Core", version: "6.1.0", osSkip: [ "macOS" ] },
// Combined runtimes
{ id: "Dotnet-Runtime", version: "5.0.3" },
{ id: "Dotnet-Runtime", version: "5.0.3", osSkip: ["macOS"] },
] : [