Transition to .NETCore 3.0 for BuildXL (#298)

* Switch to .NetCoreApp3.0 as main .NETCore build target
This commit is contained in:
Kristijan Šimić 2019-05-14 16:54:06 +02:00 коммит произвёл GitHub
Родитель fff7cf0bf4
Коммит dd841725e5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
86 изменённых файлов: 558 добавлений и 304 удалений

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

@ -17,6 +17,8 @@ export const framework : Shared.Framework = (() => {
return importFrom("Sdk.Managed.Frameworks.Net472").framework;
case "netcoreapp2.2":
return importFrom("Sdk.Managed.Frameworks.NetCoreApp2.2").framework;
case "netcoreapp3.0":
return importFrom("Sdk.Managed.Frameworks.NetCoreApp3.0").framework;
case "netstandard2.0":
return importFrom("Sdk.Managed.Frameworks.NetStandard2.0").framework;
default:

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

@ -0,0 +1,56 @@
import {Artifact, Cmd, Transformer} from "Sdk.Transformers";
namespace Helpers
{
export declare const qualifier : {};
function getToolTemplate() : Transformer.ExecuteArgumentsComposible {
const host = Context.getCurrentHost();
Contract.assert(host.cpuArchitecture === "x64", "The current DotNetCore Runtime package only has x64 version of Node. Ensure this runs on a 64-bit OS -or- update PowerShell.Core package to have other architectures embedded and fix this logic");
let executable : RelativePath = undefined;
let pkgContents : StaticDirectory = undefined;
switch (host.os) {
case "win":
pkgContents = importFrom("DotNet-Runtime.win-x64").extracted;
executable = r`dotnet.exe`;
break;
case "macOS":
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.`);
}
return {
tool: {
exe: pkgContents.getFile(executable),
dependsOnCurrentHostOSDirectories: true,
},
dependencies: [
pkgContents,
]
};
}
const toolTemplate = getToolTemplate();
@@public
export function wrapInDotNetExeForCurrentOs(args: Transformer.ExecuteArguments) : Transformer.ExecuteArguments {
return Object.merge<Transformer.ExecuteArguments>(
args,
toolTemplate,
{
arguments: [
Cmd.argument(Artifact.input(args.tool.exe))
].prependWhenMerged()
});
}
}

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

@ -5,6 +5,7 @@ module({
name: "Sdk.Managed.Frameworks",
nameResolutionSemantics: NameResolutionSemantics.implicitProjectReferences,
projects: [
f`frameworks.dsc`
f`frameworks.dsc`,
f`helpers.dsc`
]
});

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

@ -21,15 +21,15 @@ function ignoredAssembly(file: File): boolean {
}
const windowsRuntimeFiles = [
...importFrom("runtime.win-x64.Microsoft.NETCore.App").Contents.all.getContent().filter(f => f.extension === a`.dll` && !ignoredAssembly(f)),
...importFrom("runtime.win-x64.Microsoft.NETCore.DotNetHostResolver").Contents.all.getContent().filter(f => f.extension === a`.dll`),
...importFrom("runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy").Contents.all.getContent().filter(f => f.extension === a`.dll`),
...importFrom("runtime.win-x64.Microsoft.NETCore.App.220").Contents.all.getContent().filter(f => f.extension === a`.dll` && !ignoredAssembly(f)),
...importFrom("runtime.win-x64.Microsoft.NETCore.DotNetHostResolver.220").Contents.all.getContent().filter(f => f.extension === a`.dll`),
...importFrom("runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy.220").Contents.all.getContent().filter(f => f.extension === a`.dll`),
];
const osxRuntimeFiles = [
...importFrom("runtime.osx-x64.Microsoft.NETCore.App").Contents.all.getContent().filter(f => macOSRuntimeExtensions(f) && !ignoredAssembly(f)),
...importFrom("runtime.osx-x64.Microsoft.NETCore.DotNetHostResolver").Contents.all.getContent().filter(f => macOSRuntimeExtensions(f)),
...importFrom("runtime.osx-x64.Microsoft.NETCore.DotNetHostPolicy").Contents.all.getContent().filter(f => macOSRuntimeExtensions(f)),
...importFrom("runtime.osx-x64.Microsoft.NETCore.App.220").Contents.all.getContent().filter(f => macOSRuntimeExtensions(f) && !ignoredAssembly(f)),
...importFrom("runtime.osx-x64.Microsoft.NETCore.DotNetHostResolver.220").Contents.all.getContent().filter(f => macOSRuntimeExtensions(f)),
...importFrom("runtime.osx-x64.Microsoft.NETCore.DotNetHostPolicy.220").Contents.all.getContent().filter(f => macOSRuntimeExtensions(f)),
];
@@public
@ -66,58 +66,8 @@ export const framework : Shared.Framework = {
};
function createDefaultAssemblies() : Shared.Assembly[] {
const pkgContents = importFrom("Microsoft.NETCore.App").withQualifier({targetFramework: "netcoreapp2.2"}).Contents.all;
const pkgContents = importFrom("Microsoft.NETCore.App.211").withQualifier({targetFramework: "netcoreapp2.2"}).Contents.all;
const netcoreAppPackageContents = pkgContents.contents;
const dlls = netcoreAppPackageContents.filter(file => file.hasExtension && file.extension === a`.dll`);
return dlls.map(file => Shared.Factory.createAssembly(pkgContents, file, "netcoreapp2.2", [], true));
}
function getToolTemplate() : Transformer.ExecuteArgumentsComposible {
const host = Context.getCurrentHost();
Contract.assert(host.cpuArchitecture === "x64", "The current DotNetCore Runtime package only has x64 version of Node. Ensure this runs on a 64-bit OS -or- update PowerShell.Core package to have other architectures embedded and fix this logic");
let executable : RelativePath = undefined;
let pkgContents : StaticDirectory = undefined;
switch (host.os) {
case "win":
pkgContents = importFrom("DotNet-Runtime.win-x64").extracted;
executable = r`dotnet.exe`;
break;
case "macOS":
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.`);
}
return {
tool: {
exe: pkgContents.getFile(executable),
dependsOnCurrentHostOSDirectories: true,
},
dependencies: [
pkgContents,
]
};
}
const toolTemplate = getToolTemplate();
@@public
export function wrapInDotNetExeForCurrentOs(args: Transformer.ExecuteArguments) : Transformer.ExecuteArguments {
return Object.merge<Transformer.ExecuteArguments>(
args,
toolTemplate,
{
arguments: [
Cmd.argument(Artifact.input(args.tool.exe))
].prependWhenMerged()
});
}

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

@ -0,0 +1,10 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
module({
name: "Sdk.Managed.Frameworks.NetCoreApp3.0",
nameResolutionSemantics: NameResolutionSemantics.implicitProjectReferences,
projects: [
f`netcoreapp3.0.dsc`,
]
});

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

@ -0,0 +1,73 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
import {Artifact, Cmd, Transformer} from "Sdk.Transformers";
import * as Shared from "Sdk.Managed.Shared";
import * as Deployment from "Sdk.Deployment";
import * as MacOS from "Sdk.MacOS";
export declare const qualifier: {targetFramework: "netcoreapp3.0"};
const defaultAssemblies: Shared.Assembly[] = createDefaultAssemblies();
function macOSRuntimeExtensions(file: File): boolean {
return file.extension === a`.dylib` || file.extension === a`.a` || file.extension === a`.dll`;
}
function ignoredAssembly(file: File): boolean {
// We skip deploying those files from the .NET Core package as we need those very assemblies from their dedicated package
// to compile our platform abstraction layer, which depends on datatypes present only in the dedicated packages
return file.name === a`System.Security.AccessControl.dll` || file.name === a`System.Security.Principal.Windows.dll`;
}
const windowsRuntimeFiles = [
...importFrom("runtime.win-x64.Microsoft.NETCore.App").Contents.all.getContent().filter(f => f.extension === a`.dll` && !ignoredAssembly(f)),
...importFrom("runtime.win-x64.Microsoft.NETCore.DotNetHostResolver").Contents.all.getContent().filter(f => f.extension === a`.dll`),
...importFrom("runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy").Contents.all.getContent().filter(f => f.extension === a`.dll`),
];
const osxRuntimeFiles = [
...importFrom("runtime.osx-x64.Microsoft.NETCore.App").Contents.all.getContent().filter(f => macOSRuntimeExtensions(f) && !ignoredAssembly(f)),
...importFrom("runtime.osx-x64.Microsoft.NETCore.DotNetHostResolver").Contents.all.getContent().filter(f => macOSRuntimeExtensions(f)),
...importFrom("runtime.osx-x64.Microsoft.NETCore.DotNetHostPolicy").Contents.all.getContent().filter(f => macOSRuntimeExtensions(f)),
];
@@public
export function runtimeContentProvider(runtimeVersion: Shared.RuntimeVersion): File[] {
switch (runtimeVersion)
{
case "osx-x64":
return osxRuntimeFiles;
case "win-x64":
default:
return windowsRuntimeFiles;
}
}
@@public
export const framework : Shared.Framework = {
targetFramework: qualifier.targetFramework,
supportedRuntimeVersion: "v3.0",
assemblyInfoTargetFramework: ".NETCoreApp,Version=v3.0",
assemblyInfoFrameworkDisplayName: ".NET Core App",
standardReferences: defaultAssemblies,
requiresPortablePdb: true,
runtimeConfigStyle: "runtimeJson",
runtimeFrameworkName: "Microsoft.NETCore.App",
runtimeConfigVersion: "3.0.0-preview5-27626-15",
// Deployment style for .NET Core applications currently defaults to self-contained
applicationDeploymentStyle: "selfContained",
runtimeContentProvider: runtimeContentProvider,
};
function createDefaultAssemblies() : Shared.Assembly[] {
const pkgContents = importFrom("Microsoft.NETCore.App").withQualifier({targetFramework: "netcoreapp3.0"}).Contents.all;
const netcoreAppPackageContents = pkgContents.contents;
const dlls = netcoreAppPackageContents.filter(file => file.hasExtension && file.extension === a`.dll`);
return dlls.map(file => Shared.Factory.createAssembly(pkgContents, file, "netcoreapp3.0", [], true));
}

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

@ -27,7 +27,7 @@ namespace Factory {
const xmlPath = binaryPath.changeExtension(".xml");
return {
binary: contents.getFile(binaryPath),
binary: contents.getFile(binaryPath),
pdb: contents.hasFile(pdbPath) ? contents.getFile(pdbPath) : undefined,
documentation: contents.hasFile(xmlPath) ? contents.getFile(xmlPath) : undefined,
deploy: Deployment.flattenBinary,

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

@ -5,7 +5,7 @@ import * as Deployment from "Sdk.Deployment";
@@public
export interface Framework {
/**
/**
* The minimum rumtime version supported.
* See: https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/startup/supportedruntime-element
*/
@ -55,7 +55,7 @@ namespace TargetFrameworks {
export type DesktopTargetFrameworks = "net451" | "net461" | "net472";
@@public
export type CoreClrTargetFrameworks = "netcoreapp2.2";
export type CoreClrTargetFrameworks = "netcoreapp2.2" | "netcoreapp3.0";
@@public
export type StandardTargetFrameworks = "netstandard2.0";
@ -85,14 +85,14 @@ namespace TargetFrameworks {
export interface CurrentMachineQualifier extends Qualifier {
configuration: "debug" | "release";
// TODO: Netstandard should handle its application deploy in the framework itself and not rely on BuildXLSdk specifics
targetFramework: "net472" | "netcoreapp2.2",
targetFramework: "net472" | "netcoreapp3.0",
targetRuntime: "win-x64" | "osx-x64",
}
@@public
export const currentMachineQualifier : CurrentMachineQualifier = {
configuration: "release",
targetFramework: Context.getCurrentHost().os === "win" ? "net472" : "netcoreapp2.2",
targetFramework: Context.getCurrentHost().os === "win" ? "net472" : "netcoreapp3.0",
targetRuntime: Context.getCurrentHost().os === "win" ? "win-x64" : "osx-x64",
};
}

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

@ -136,13 +136,16 @@ export function isBinary(item: Reference) : item is Binary {
@@public
export function isAssembly(item: Reference) : item is Assembly {
return item["name"] !== undefined &&
(item["compile"] !== undefined || item["runtime"] !== undefined) &&
item["contents"] === undefined; // Exclude nuget packages
(item["compile"] !== undefined || item["runtime"] !== undefined) &&
item["contents"] === undefined; // Exclude nuget packages
}
@@public
export function isManagedPackage(item: NugetPackage) : item is ManagedNugetPackage {
return item["compile"] !== undefined || item["runtime"] !== undefined || item["runtimeContent"] !== undefined || item["analyzers"] !== undefined;
export function isManagedPackage(item: any) : item is ManagedNugetPackage {
return item["compile"] !== undefined ||
item["runtime"] !== undefined ||
item["runtimeContent"] !== undefined ||
item["analyzers"] !== undefined;
}
@@public

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

@ -24,7 +24,7 @@ export function runConsoleTest(args: TestRunArguments): Result {
let testDeployment = args.testDeployment;
const tool : Transformer.ToolDefinition = Managed.Factory.createTool({
exe: qualifier.targetFramework === "netcoreapp2.2"
exe: qualifier.targetFramework === "netcoreapp3.0"
? testDeployment.contents.getFile(r`xunit.console.dll`)
// Using xunit executable from different folders depending on the target framework.
// This allow us to actually to run tests targeting different frameworks.
@ -38,7 +38,7 @@ export function runConsoleTest(args: TestRunArguments): Result {
const testClass = args.className || Environment.getStringValue("[UnitTest]Filter.testClass");
let arguments : Argument[] = CreateCommandLineArgument(testDeployment.primaryFile, args, testClass, testMethod);
let execArguments : Transformer.ExecuteArguments = {
tool: args.tool || tool,
tags: args.tags,
@ -46,20 +46,20 @@ export function runConsoleTest(args: TestRunArguments): Result {
dependencies: [
testDeployment.contents,
],
warningRegex: "^(?=a)b", // This is a never matching warning regex. StartOfLine followed by the next char must be 'a' (look ahead), and the next char must be a 'b'.
warningRegex: "^(?=a)b", // This is a never matching warning regex. StartOfLine followed by the next char must be 'a' (look ahead), and the next char must be a 'b'.
workingDirectory: testDeployment.contents.root,
retryExitCodes: Environment.getFlag("RetryXunitTests") ? [1] : [],
unsafe: args.untrackTestDirectory ? {untrackedScopes: [testDeployment.contents.root]} : undefined,
};
if (qualifier.targetFramework === "netcoreapp2.2") {
execArguments = importFrom("Sdk.Managed.Frameworks.NetCoreApp2.2").wrapInDotNetExeForCurrentOs(execArguments);
if (qualifier.targetFramework === "netcoreapp3.0") {
execArguments = importFrom("Sdk.Managed.Frameworks").Helpers.wrapInDotNetExeForCurrentOs(execArguments);
}
execArguments = Managed.TestHelpers.applyTestRunExecutionArgs(execArguments, args);
const result = Transformer.execute(execArguments);
return {
xmlFile: args.xmlFile && result.getOutputFile(args.xmlFile),
xmlV1File: args.xmlV1File && result.getOutputFile(args.xmlV1File),
@ -81,7 +81,7 @@ function runMultipleConsoleTests(args: TestRunArguments) : Result
runConsoleTest(args.override({
// disable breaking down in groups again
parallelGroups: undefined,
// Avoid double-writes
xmlFile: renameOutputFile(testGroup, args.xmlFile),
xmlV1File: renameOutputFile(testGroup, args.xmlV1File),

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

@ -16,10 +16,8 @@ export const framework : Managed.TestFramework = {
name: "XUnit",
};
const xunitNet451Qualifier: {targetFramework: "net451"} = {targetFramework: "net451"};
@@public
export const xunitReferences : Managed.Reference[] = qualifier.targetFramework === "netcoreapp2.2"
export const xunitReferences : Managed.Reference[] = qualifier.targetFramework === "netcoreapp3.0"
? [
importFrom("xunit.assert").pkg,
importFrom("xunit.abstractions").pkg,
@ -42,7 +40,7 @@ function processArguments(args: Managed.TestArguments): Managed.TestArguments {
args);
}
const netStandardFramework = importFrom("Sdk.Managed.Frameworks.NetCoreApp2.2").withQualifier({targetFramework: "netcoreapp2.2"}).framework;
const netStandardFramework = importFrom("Sdk.Managed.Frameworks.NetCoreApp3.0").withQualifier({targetFramework: "netcoreapp3.0"}).framework;
const xunitNetStandardRuntimeConfigFiles: File[] = Managed.RuntimeConfigFiles.createFiles(
netStandardFramework,
"xunit.console",
@ -53,7 +51,7 @@ const xunitNetStandardRuntimeConfigFiles: File[] = Managed.RuntimeConfigFiles.cr
// For the DotNetCore run we need to copy a bunch more files:
function additionalRuntimeContent(args: Managed.TestArguments) : Deployment.DeployableItem[] {
return qualifier.targetFramework !== "netcoreapp2.2" ? [] : [
return qualifier.targetFramework !== "netcoreapp3.0" ? [] : [
// Unfortunately xUnit console runner comes as a precompiled assembly for .NET Core, we could either go and pacakge it
// into a self-contained deployment or treat it as a framework-dependent deployment as intended, let's do the latter
...(args.framework === netStandardFramework

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

@ -2,6 +2,6 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<PlatformTarget>x64</PlatformTarget>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
</Project>

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

@ -4,11 +4,11 @@
import {Artifact, Cmd, Tool, Transformer} from "Sdk.Transformers";
import * as Shared from "Sdk.Managed.Shared";
const pkgContents = Context.getCurrentHost().os === "win"
const pkgContents = Context.getCurrentHost().os === "win"
? importFrom("Microsoft.Net.Compilers").Contents.all
: importFrom("Microsoft.NETCore.Compilers").Contents.all;
const cscTool = Context.getCurrentHost().os === "win"
const cscTool = Context.getCurrentHost().os === "win"
? r`tools/csc.exe`
: r`tools/bincore/csc.dll`;
@ -55,8 +55,8 @@ export function compile(inputArgs: Arguments) : Result {
const outputDirectory = Context.getNewOutputDirectory(args.out + "-csc");
const outputBinPath = outputDirectory.combine(args.out);
const outputPdbPath = (args.debugType || args.emitDebugInformation)
? (args.pdb ? p`${outputDirectory}/${args.pdb}` : outputBinPath.changeExtension(".pdb"))
const outputPdbPath = (args.debugType || args.emitDebugInformation)
? (args.pdb ? p`${outputDirectory}/${args.pdb}` : outputBinPath.changeExtension(".pdb"))
: undefined;
const outputDocPath = args.doc && p`${outputDirectory}/${args.doc}`;
const outputRefPath = args.emitReferenceAssembly ? p`${outputDirectory}/ref/${args.out}` : undefined;
@ -77,7 +77,7 @@ export function compile(inputArgs: Arguments) : Result {
Cmd.option("/langversion:", args.languageVersion),
// TODO: uncoment the following line and delete the line after it once a new LKG is published
// Cmd.option("/define:", args.defines ? args.defines.join(";") : undefined),
// Cmd.option("/define:", args.defines ? args.defines.join(";") : undefined),
...addIf((args.defines || []).length > 0, Cmd.rawArgument(`/define:"${args.defines.join(';')}"`)),
Cmd.option("/nowarn:", args.noWarnings ? args.noWarnings.map(n => n.toString()).join(",") : undefined),
@ -111,7 +111,7 @@ export function compile(inputArgs: Arguments) : Result {
Cmd.option("/test:", args.moduleName ? ("moduleName=" + args.moduleName) : undefined),
Cmd.option("/errorreport:", args.errorReport ? args.errorReport.toString() : undefined),
Cmd.flag("/deterministic", args.deterministic),
...(args.pathMap || []).map(entry =>
...(args.pathMap || []).map(entry =>
Cmd.option("/pathMap:", Cmd.join("", [Artifact.none(entry.key), "=", entry.value]))),
Cmd.option("/keyfile:", Artifact.input(args.keyFile)),
@ -127,6 +127,9 @@ export function compile(inputArgs: Arguments) : Result {
Cmd.options("/link:", Artifact.inputs(args.link)),
Cmd.options("/r:", Artifact.inputs(args.references && args.references.map(r => r.binary))),
...(args.aliasedReferences || []).map(r =>
Cmd.option(`/r:${r.alias}=`, Artifact.input(r.assembly.binary))),
Cmd.options("/lib:", Artifact.inputs(args.lib)),
Cmd.options("/analyzer:", Artifact.inputs(args.analyzers && args.analyzers.map(a => a.binary))),
Cmd.options("/additionalfile:", Artifact.inputs(args.additionalFiles || [])),
@ -157,7 +160,7 @@ export function compile(inputArgs: Arguments) : Result {
};
if (Context.getCurrentHost().os !== "win") {
cscExecuteArgs = importFrom("Sdk.Managed.Frameworks.NetCoreApp2.2").withQualifier({targetFramework: "netcoreapp2.2"}).wrapInDotNetExeForCurrentOs(cscExecuteArgs);
cscExecuteArgs = importFrom("Sdk.Managed.Frameworks").Helpers.wrapInDotNetExeForCurrentOs(cscExecuteArgs);
}
let executeResult = Transformer.execute(cscExecuteArgs);
@ -168,8 +171,8 @@ export function compile(inputArgs: Arguments) : Result {
outputDocPath && executeResult.getOutputFile(outputDocPath)
);
const referenceBinary = outputRefPath
? Shared.Factory.createBinaryFromFiles(executeResult.getOutputFile(outputRefPath))
const referenceBinary = outputRefPath
? Shared.Factory.createBinaryFromFiles(executeResult.getOutputFile(outputRefPath))
: undefined;
return {
@ -379,6 +382,6 @@ function toWarningLevelNumber(warningLevel: WarningLevel): number {
case "level 2": return 2;
case "level 3": return 3;
case "level 4": return 4;
default: return Contract.fail("Unexpected WarningLevel '" + warningLevel + "'.");
default: return Contract.fail("Unexpected WarningLevel '" + warningLevel + "'.");
}
}

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

@ -45,8 +45,8 @@ export const linkTimeLibraries: File[] =
export const compileTimeReferences: File[] = [
...pkgContents.contents.filter(f => f.name.extension === a`.dll` && f.path.parent.name !== a`tools`),
...(isMacOS ? netcoreAppPkgContents.getFiles([
r`runtimes/osx-x64/lib/netcoreapp2.2/SOS.NETCore.dll`,
r`runtimes/osx-x64/lib/netcoreapp2.2/System.Runtime.InteropServices.WindowsRuntime.dll`
r`runtimes/osx-x64/lib/netcoreapp3.0/SOS.NETCore.dll`,
r`runtimes/osx-x64/lib/netcoreapp3.0/System.Runtime.InteropServices.WindowsRuntime.dll`
]) : [
// TODO: references for Windows
])

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

@ -22,7 +22,7 @@ namespace ResGen.Lite
private static readonly AssemblyName s_toolAssemblyName = typeof(SourceCodeWriter).GetTypeInfo().Assembly.GetName();
/// <summary>
/// Writes a strongly typed helper class for the
/// Writes a strongly typed helper class for the
/// </summary>
public static void Write(string filePath, ResourceData data, string namespaceName, string className, bool isPublic, string languageName)
{
@ -30,7 +30,7 @@ namespace ResGen.Lite
try
{
// TextWriter from System.IO has problems unifying versions from nuget and BCL between net461, net472 and netcoreapp2.2.
// TextWriter from System.IO has problems unifying versions from nuget and BCL between net461, net472 and netcoreapp3.0.
// So using ToFullString instead of WriteTo.
var sourceFileText = sourceFile.NormalizeWhitespace().ToFullString();
File.WriteAllText(filePath, sourceFileText, Encoding.UTF8);
@ -181,8 +181,8 @@ namespace ResGen.Lite
generatedClass
)
: generator.CompilationUnit(
generator.NamespaceDeclaration(namespaceName,
generator.NamespaceImportDeclaration("System"),
generator.NamespaceDeclaration(namespaceName,
generator.NamespaceImportDeclaration("System"),
generatedClass)
);

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

@ -2,8 +2,12 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
import * as Shared from "Sdk.Managed.Shared";
import * as Csc from "Sdk.Managed.Tools.Csc";
namespace Helpers {
export declare const qualifier : Shared.TargetFrameworks.All;
/**
* Helper method that computes the compile closure based on a set of references.
* This helper is for tools that gets a set of managed referneces and need to have the list of binaries that are used for compile.
@ -77,7 +81,7 @@ namespace Helpers {
return results.toArray();
}
function computeTransitiveReferenceClosureHelper(ref: Shared.Reference, results: MutableSet<Shared.Binary>, visitedReferences: MutableSet<Shared.Reference>, compile?: boolean) {
function computeTransitiveReferenceClosureHelper(ref: Shared.Reference, results: MutableSet<Shared.Binary>, visitedReferences: MutableSet<Shared.Reference>, compile?: boolean) {
if (visitedReferences.contains(ref))
{
return;
@ -132,4 +136,43 @@ namespace Helpers {
return results.toArray();
};
/** TODO: Unofortunately the System.Interactive.Async package exposes IAsyncEnumerable in its own System.Generic.Collection namespace,
/* colliding with .NETCore 3.0 implementation of the same name. For the time being (hopefully once the package maintainers updated their deps),
/* we explicitly create an aliased reference for the code that depends on this.
**/
@@public
export function patchReferencesForSystemInteractiveAsync(references: Shared.Reference[]) : Csc.Arguments {
const needsSystemInteractiveAsync = references.some(ref =>
Shared.isManagedPackage(ref) && !Shared.isAssembly(ref) && ref.name.contains("System.Interactive.Async"));
if (needsSystemInteractiveAsync) {
return <Csc.Arguments> {
aliasedReferences: [{
alias: "Async",
assembly: Shared.Factory.createBinary(
importFrom("System.Interactive.Async").pkg.contents,
r`lib/${tfmTargetForSystemInteractiveAsyncPackage()}/System.Interactive.Async.dll`
)
}]
};
}
return <Csc.Arguments> {};
}
function tfmTargetForSystemInteractiveAsyncPackage() : string {
switch (qualifier.targetFramework) {
case "net451":
return "net45";
case "net461":
case "net472":
return"net46";
case "netcoreapp3.0":
case "netstandard2.0":
default:
return "netstandard1.3";
}
}
}

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

@ -113,7 +113,7 @@ export function assembly(args: Arguments, targetType: Csc.TargetType) : Result {
let appConfig = args.appConfig;
if (args.assemblyBindingRedirects) {
let bindigRedirectElements = args.assemblyBindingRedirects.map(bindingRedirect =>
let bindigRedirectElements = args.assemblyBindingRedirects.map(bindingRedirect =>
Xml.elem("dependentAssembly",
Xml.elem("assemblyIdentity",
Xml.attr("name", bindingRedirect.name),
@ -127,7 +127,7 @@ export function assembly(args: Arguments, targetType: Csc.TargetType) : Result {
));
// TODO: Figure out how to fail with good error if appConfig is not a sourcefile.
let configuration = appConfig
let configuration = appConfig
? Xml.read(f`${appConfig}`).nodes.filter(n => Xml.isElement(n) && Xml.nameEquals(n.name, "configuration"))[0] as Xml.Element
: Xml.elem("configuration",
Xml.elem("startup",
@ -139,16 +139,16 @@ export function assembly(args: Arguments, targetType: Csc.TargetType) : Result {
);
let patchedConfiguration = Xml.updateOrAddChildElement(
configuration,
"runtime",
configuration,
"runtime",
runtime => Xml.updateOrAddChildElement(
runtime,
Xml.name("assemblyBinding", "urn:schemas-microsoft-com:asm.v1"),
assemblyBinding =>
runtime,
Xml.name("assemblyBinding", "urn:schemas-microsoft-com:asm.v1"),
assemblyBinding =>
Xml.addNodes(assemblyBinding, bindigRedirectElements)
)
);
let updatedAppConfigPath = p`${Context.getNewOutputDirectory("assemblyBindingRedirects")}/app.config`;
appConfig = Xml.write(updatedAppConfigPath, Xml.doc(patchedConfiguration));
}
@ -186,16 +186,19 @@ export function assembly(args: Arguments, targetType: Csc.TargetType) : Result {
...(qualifier.targetFramework !== "net451" ? ["NET461Plus"] : []),
]
};
const references = [
...(args.references || []),
...framework.standardReferences,
];
if (args.tools && args.tools.csc) {
cscArgs = Object.merge(args.tools.csc, cscArgs);
}
let cscResult = Csc.compile(cscArgs);
cscArgs = Object.merge(Helpers.patchReferencesForSystemInteractiveAsync(references), cscArgs);
let references = [
...(args.references || []),
...framework.standardReferences,
];
let cscResult = Csc.compile(cscArgs);
let runtimeConfigFiles = undefined;
let runtimeContent = args.runtimeContent;
@ -392,7 +395,7 @@ export interface AssemblyBindingRedirect {
*/
name: string,
/**
/**
* The public key if the assembly to redirect is signed
*/
publicKeyToken?: string,
@ -401,7 +404,7 @@ export interface AssemblyBindingRedirect {
* The culture of the assembly to redirect. Typically this is 'neutral'.
*/
culture?: string,
/**
* The old version. This can be a range i.e. '0.0.0.0-1.3.0.0'
*/

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

@ -3,19 +3,11 @@
@@public
export const tplPackages = isDotNetCoreBuild ? [] : [importFrom("System.Threading.Tasks.Extensions").pkg];
/**
* Our nuget ingegration generates the wrong code for netcoreapp2.2 for System.Configuration.ConfigurationManager
* It should have added the netstandard2.0 version of the library for netcoreapp2.2 but because the config has
* a seperate group for netcoreapp2.2 our current logic mistakenly thinks there are no references to add for netcoreapp2.2
* We therefore temporary expose this assembly manually until we fix the nuget generation
**/
@@public
export const fluentAssertionsWorkaround = isDotNetCoreBuild
@@public
export const fluentAssertionsWorkaround = isDotNetCoreBuild
? [
importFrom("FluentAssertions").pkg,
importFrom("System.Configuration.ConfigurationManager").withQualifier({targetFramework: "netstandard2.0"}).pkg,
] : [
importFrom("FluentAssertions").pkg,
];
];

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

@ -97,7 +97,7 @@ export interface TestResult extends Managed.TestResult {
* Returns if the current qualifier is targeting .NET Core
*/
@@public
export const isDotNetCoreBuild : boolean = qualifier.targetFramework === "netcoreapp2.2" || qualifier.targetFramework === "netstandard2.0";
export const isDotNetCoreBuild : boolean = qualifier.targetFramework === "netcoreapp3.0" || qualifier.targetFramework === "netstandard2.0";
@@public
export const isFullFramework : boolean = qualifier.targetFramework === "net451" || qualifier.targetFramework === "net461" || qualifier.targetFramework === "net472";
@ -134,8 +134,8 @@ namespace Flags {
@@public
export const isQTestEnabled = isMicrosoftInternal && Environment.getFlag("[Sdk.BuildXL]useQTest");
/**
* Whether we are generating VS solution.
/**
* Whether we are generating VS solution.
* We are using this flag to filter out some deployment items that can cause race in the generated VS project files.
*/
@@public
@ -149,7 +149,7 @@ export const devKey = f`BuildXL.DevKey.snk`;
export const cacheRuleSet = f`BuildXl.Cache.ruleset`;
@@public
export const dotNetFramework = qualifier.targetFramework === "netcoreapp2.2"
export const dotNetFramework = isDotNetCoreBuild
? qualifier.targetRuntime
: qualifier.targetFramework;
@ -165,7 +165,7 @@ export function library(args: Arguments): Managed.Assembly {
{
csFiles = args.cacheOldNames.map(cacheOldName =>
Transformer.writeAllLines({
outputPath: p`${Context.getNewOutputDirectory("oldcache")}/cache.g.cs`,
outputPath: p`${Context.getNewOutputDirectory("oldcache")}/cache.g.cs`,
lines: [
`namespace Cache.${cacheOldName.namespace}`,
`{`,
@ -533,7 +533,7 @@ function processTestArguments(args: Managed.TestArguments) : Managed.TestArgumen
args = processArguments(args, "library");
let xunitSemaphoreLimit = Environment.hasVariable(envVarNamePrefix + "xunitSemaphoreCount") ? Environment.getNumberValue(envVarNamePrefix + "xunitSemaphoreCount") : 8;
let useQTest = Flags.isQTestEnabled && qualifier.targetFramework !== "netcoreapp2.2";
let useQTest = Flags.isQTestEnabled && qualifier.targetFramework !== "netcoreapp3.0";
let testFramework = args.testFramework || (useQTest ? QTest.getFramework(XUnit.framework) : XUnit.framework);
args = Object.merge<Managed.TestArguments>({

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

@ -19,7 +19,7 @@ export interface FullFrameworkQualifier extends Qualifier {
@@public
export interface DefaultQualifier extends Qualifier {
configuration: "debug" | "release";
targetFramework: "net472" | "netcoreapp2.2";
targetFramework: "net472" | "netcoreapp3.0";
targetRuntime: "win-x64" | "osx-x64";
}
@ -29,7 +29,7 @@ export interface DefaultQualifier extends Qualifier {
@@public
export interface DefaultQualifierWithNet451 extends Qualifier {
configuration: "debug" | "release";
targetFramework: "net451" | "net461" | "net472" | "netcoreapp2.2";
targetFramework: "net451" | "net461" | "net472" | "netcoreapp3.0";
targetRuntime: "win-x64" | "osx-x64";
}
@ -40,7 +40,7 @@ export interface DefaultQualifierWithNet451 extends Qualifier {
@@public
export interface DefaultQualifierWithNet461 extends Qualifier {
configuration: "debug" | "release";
targetFramework: "net461" | "net472" | "netcoreapp2.2";
targetFramework: "net461" | "net472" | "netcoreapp3.0";
targetRuntime: "win-x64" | "osx-x64";
}
@ -50,13 +50,13 @@ export interface DefaultQualifierWithNet461 extends Qualifier {
@@public
export interface DefaultQualifierWithNet451AndNetStandard20 extends Qualifier {
configuration: "debug" | "release";
targetFramework: "net451" | "net461" | "net472" | "netcoreapp2.2" | "netstandard2.0";
targetFramework: "net451" | "net461" | "net472" | "netcoreapp3.0" | "netstandard2.0";
targetRuntime: "win-x64" | "osx-x64";
}
export interface AllSupportedQualifiers extends Qualifier {
configuration: "debug" | "release";
targetFramework: "net451" | "net461" | "net472" | "netcoreapp2.2" | "netstandard2.0";
targetFramework: "net451" | "net461" | "net472" | "netcoreapp3.0" | "netstandard2.0";
targetRuntime: "win-x64" | "osx-x64";
}
@ -72,7 +72,7 @@ export interface PlatformDependentQualifier extends Qualifier {
@@public
export interface NetCoreAppQualifier extends Qualifier {
configuration: "debug" | "release";
targetFramework: "netcoreapp2.2";
targetFramework: "netcoreapp3.0";
targetRuntime: "win-x64" | "osx-x64";
}

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

@ -62,7 +62,7 @@ namespace StandaloneTest {
` description: "${assemblyName} [${qualifier.configuration}, ${dotNetFramework}]",`,
` testAssembly: f\`${def.assembly.name}\`,`,
` untracked: ${def.untracked},`,
` wrapInDotNet: ${qualifier.targetFramework === "netcoreapp2.2"},`,
` wrapInDotNet: ${$.isDotNetCoreBuild},`,
` untrackTestDirectory: ${def.untrackTestDirectory},`,
StandaloneTestUtils.generateArrayProperty("parallelCategories", def.parallelCategories, indent, StandaloneTestUtils.quoteString),
StandaloneTestUtils.generateArrayProperty("limitCategories", def.limitCategories, indent, StandaloneTestUtils.quoteString),
@ -83,7 +83,7 @@ namespace StandaloneTest {
/**
* Deployment layout:
*
*
* tests/standaloneTest/unittests/[Configuration]/[Framework]
* [TestDlls]/
* ... Dlls ...
@ -95,14 +95,14 @@ namespace StandaloneTest {
const mainSpecName = "runUnitTest.dsc";
return {
contents: [
{
{
subfolder: testDefinition.subfolder,
contents: [
StandaloneTestUtils.writeFile(a`${mainSpecName}`, createSpecFile(testDefinition)),
StandaloneTestUtils.writeFile(
a`module.config.dsc`,
a`module.config.dsc`,
StandaloneTestUtils.createModuleConfig(
`${assemblyName}__${qualifier.configuration}__${dotNetFramework}`,
`${assemblyName}__${qualifier.configuration}__${dotNetFramework}`,
[mainSpecName])),
]
},
@ -122,8 +122,8 @@ namespace StandaloneTest {
@@public
export function deploy(
testDeployment: Deployment.OnDiskDeployment,
testFramework: Managed.TestFramework,
testDeployment: Deployment.OnDiskDeployment,
testFramework: Managed.TestFramework,
deploymentOptions?: Deployment.DeploymentOptions,
subfolder?: PathAtom,
parallelCategories?: string[],
@ -131,7 +131,7 @@ namespace StandaloneTest {
skipCategories?: string[],
untrackTestDirectory?: boolean,
testClasses?: string[]) {
if (!StandaloneTestUtils.shouldDeployStandaloneTest) return undefined;
return deployTestDefinition(createTestDeploymentDefinition(
testDeployment,

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

@ -40,7 +40,7 @@ export const defaultArgs: Arguments = {
outputFile: undefined,
references: [],
sources: [],
targetFramework: "netcoreapp2.2",
targetFramework: "netcoreapp3.0",
targetRuntime: "win-x64",
};

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

@ -4,7 +4,7 @@
import * as Managed from "Sdk.Managed";
import * as Deployment from "Sdk.Deployment";
export declare const qualifier: {targetFramework: "netcoreapp2.2" | "netstandard1.6" | "net472" | "net461" | "net451" | "net45" };
export declare const qualifier: {targetFramework: "netcoreapp3.0" | "netstandard1.6" | "net472" | "net461" | "net451" | "net45" };
const nativePackage = importFrom("RocksDbNative").pkg;
const managedPackage = importFrom("RocksDbSharpSigned").withQualifier({targetFramework: "net451"}).pkg;
@ -13,10 +13,10 @@ const managedPackage = importFrom("RocksDbSharpSigned").withQualifier({targetFra
export const pkg = managedPackage.override<Managed.ManagedNugetPackage>({
name: "RocksDbSharp",
version: nativePackage.version,
runtimeContent: {
contents: [ <Deployment.NestedDefinition>{
runtimeContent: {
contents: [ <Deployment.NestedDefinition>{
subfolder: r`native`,
contents: [ Deployment.createFromFilteredStaticDirectory(nativePackage.contents, r`build/native`) ] }
]
]
},
});

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

@ -4,7 +4,7 @@
import * as Deployment from "Sdk.Deployment";
export declare const qualifier : {
targetFramework: "netcoreapp2.2" | "net472" | "net461" | "net451",
targetFramework: "netcoreapp3.0" | "net472" | "net461" | "net451",
targetRuntime: "osx-x64" | "win-x64"
};
@ -14,7 +14,7 @@ const SQLiteCorePackageContents = importFrom("System.Data.SQLite.Core").Contents
function getInteropFile() : File {
switch (qualifier.targetFramework)
{
case "netcoreapp2.2":
case "netcoreapp3.0":
return SQLiteCorePackageContents.getFile(r`runtimes/${qualifier.targetRuntime}/native/netstandard2.0/SQLite.Interop.dll`);
case "net472":
return SQLiteCorePackageContents.getFile("build/net46/x64/SQLite.Interop.dll");

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

@ -5,7 +5,7 @@ import * as Managed from "Sdk.Managed";
export declare const qualifier: {
configuration: "debug" | "release";
targetFramework: "netcoreapp2.2" | "netstandard2.0" | "netstandard1.1" | "net472" | "net462" | "net461" | "net46" | "net452" | "net451" | "net45";
targetFramework: "netcoreapp3.0" | "netstandard2.0" | "netstandard1.1" | "net472" | "net462" | "net461" | "net46" | "net452" | "net451" | "net45";
};
/** Configures which asserts should be checked at runtime. */

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

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
export declare const qualifier: { targetFramework: "netcoreapp2.2" | "netstandard2.0" | "net451" | "net461" | "net472"};
export declare const qualifier: { targetFramework: "netcoreapp3.0" | "netstandard2.0" | "net451" | "net461" | "net472"};
import * as Managed from "Sdk.Managed";
@ -13,7 +13,7 @@ const package = importFrom("Microsoft.VisualStudio.LanguageServer.Protocol").wit
@@public
export const pkg: Managed.ManagedNugetPackage = (() => {
switch (qualifier.targetFramework) {
case "netcoreapp2.2":
case "netcoreapp3.0":
case "netstandard2.0":
case "net451":
case "net461":

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

@ -68,7 +68,16 @@ namespace BuildXL
mi.OsVersion = OperatingSystemHelper.GetOSVersion();
mi.ProcessorName = OperatingSystemHelper.GetProcessorName();
mi.ProcessorIdentifier = OperatingSystemHelper.GetProcessorIdentifier();
mi.EnvironmentVersion = Environment.Version.ToString(4);
try {
mi.EnvironmentVersion = Environment.Version.ToString(4);
}
catch (ArgumentException)
{
// Fallback for .NETCore3.0, which currently reports "3.0.0" only
mi.EnvironmentVersion = Environment.Version.ToString();
}
mi.InstalledMemoryMB = OperatingSystemHelper.GetPhysicalMemorySize().MB;
char currentDrive = Environment.CurrentDirectory[0];

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

@ -11,7 +11,7 @@ namespace IntegrationTest.BuildXL.Executable {
export declare const qualifier : {
configuration: "debug" | "release",
targetFramework: "net461" | "net472" | "netcoreapp2.2" | "netstandard2.0",
targetFramework: "net461" | "net472" | "netcoreapp3.0" | "netstandard2.0",
targetRuntime: "win-x64"
};

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

@ -330,7 +330,9 @@ namespace BuildXL.Cache.ContentStore.Distributed.NuCache
}
}
#pragma warning disable AsyncFixer02
_heartbeatTimer?.Dispose();
#pragma warning restore AsyncFixer02
if (EventStore != null)
{
@ -429,7 +431,7 @@ namespace BuildXL.Cache.ContentStore.Distributed.NuCache
}
else
{
// Stop receiving events.
// Stop receiving events.
result = EventStore.SuspendProcessing(context);
}
@ -440,7 +442,7 @@ namespace BuildXL.Cache.ContentStore.Distributed.NuCache
if (newRole == Role.Master)
{
// Only create a checkpoint if the machine is currently a master machine and was a master machine
// Only create a checkpoint if the machine is currently a master machine and was a master machine
if (ShouldSchedule(_configuration.Checkpoint.CreateCheckpointInterval, _lastCheckpointTime))
{
result = await CreateCheckpointAsync(context);
@ -453,7 +455,7 @@ namespace BuildXL.Cache.ContentStore.Distributed.NuCache
}
}
// Successfully, applied changes for role. Set it as the current role.
// Successfully, applied changes for role. Set it as the current role.
CurrentRole = newRole;
return result;

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

@ -895,7 +895,9 @@ namespace ContentStoreTest.Distributed.Sessions
contentHash,
Token).ShouldBeSuccess();
#pragma warning disable AsyncFixer02
openStreamResult.Stream.Dispose();
#pragma warning restore AsyncFixer02
});
}
@ -1172,7 +1174,7 @@ namespace ContentStoreTest.Distributed.Sessions
// Increment the time to ensure master lease expires
// then heartbeat worker first to ensure it steals the lease
// Master heartbeat trigger it to become a worker since the other
// machine will
// machine will
TestClock.UtcNow += masterLeaseExpiryTime;
TestClock.UtcNow += TimeSpan.FromMinutes(masterLeaseExpiryTime.TotalMinutes * 2);
await workerRedisStore.LocalLocationStore.HeartbeatAsync(context).ShouldBeSuccess();

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

@ -11,26 +11,28 @@ namespace GrpcTest {
},
skipTestRun: BuildXLSdk.restrictTestRunToDebugNet461OnWindows,
references: [
App.exe, // Tests launch the server, so this needs to be deployed.
Grpc.dll,
Test.dll,
Hashing.dll,
Library.dll,
Interfaces.dll,
UtilitiesCore.dll,
InterfacesTest.dll,
...addIf(BuildXLSdk.isFullFramework,
NetFx.System.Xml.dll,
NetFx.System.Xml.Linq.dll
),
...(BuildXLSdk.isDotNetCoreBuild
// TODO: This is to get a .Net Core build, but it may not pass tests
? [importFrom("System.Data.SQLite").withQualifier({targetFramework: "net461"}).pkg]
: [importFrom("System.Data.SQLite").pkg]
),
importFrom("Grpc.Core").pkg,
importFrom("Google.Protobuf").pkg,
Grpc.dll,
Interfaces.dll,
Hashing.dll,
UtilitiesCore.dll,
InterfacesTest.dll,
Library.dll,
Test.dll,
App.exe, // Tests launch the server, so this needs to be deployed.
...BuildXLSdk.fluentAssertionsWorkaround,
],
runtimeContent: [

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

@ -4,6 +4,7 @@
import * as Deployment from "Sdk.Deployment";
import * as ILRepack from "Sdk.Managed.Tools.ILRepack";
import * as Shared from "Sdk.Managed.Shared";
import * as NetCoreApp from "Sdk.Managed.Frameworks.NetCoreApp3.0";
namespace Interfaces {
export declare const qualifier : BuildXLSdk.DefaultQualifierWithNet451AndNetStandard20;
@ -13,9 +14,8 @@ namespace Interfaces {
assemblyName: "BuildXL.Cache.ContentStore.Interfaces",
sources: globR(d`.`, "*.cs"),
references: [
UtilitiesCore.dll,
Hashing.dll,
UtilitiesCore.dll,
...addIfLazy(BuildXLSdk.isFullFramework, () => [
NetFx.System.Runtime.Serialization.dll,
NetFx.System.Xml.dll,
@ -31,6 +31,6 @@ namespace Interfaces {
"BuildXL.Cache.ContentStore",
"BuildXL.Cache.ContentStore.Distributed",
"BuildXL.Cache.ContentStore.Interfaces.Test",
],
]
});
}

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System;
using System.Collections.Generic;
using System.Linq;
@ -9,6 +11,7 @@ using BuildXL.Cache.ContentStore.Interfaces.Results;
namespace BuildXL.Cache.ContentStore.Interfaces.Extensions
{
/// <summary>
/// Extension methods for Async Enumerables.
/// </summary>
@ -19,7 +22,7 @@ namespace BuildXL.Cache.ContentStore.Interfaces.Extensions
/// when there's a single call that produces the enumerable asynchronously followed by the items being enumerated.
/// The type is a resultbase to guarantee that the producer task will not throw.
/// </summary>
public static IAsyncEnumerable<T> CreateSingleProducerTaskAsyncEnumerable<T>(
public static Async::System.Collections.Generic.IAsyncEnumerable<T> CreateSingleProducerTaskAsyncEnumerable<T>(
Func<Task<IEnumerable<T>>> producerTaskFunc)
where T : ResultBase
{
@ -43,7 +46,7 @@ namespace BuildXL.Cache.ContentStore.Interfaces.Extensions
/// <summary>
/// Converts an enumerable of tasks to an async enumerable of task results
/// </summary>
public static IAsyncEnumerable<T> ToResultsAsyncEnumerable<T>(this IEnumerable<Task<T>> tasks)
public static Async::System.Collections.Generic.IAsyncEnumerable<T> ToResultsAsyncEnumerable<T>(this IEnumerable<Task<T>> tasks)
{
return AsyncEnumerable.CreateEnumerable(
() =>

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

@ -1054,7 +1054,9 @@ namespace BuildXL.Cache.ContentStore.InterfacesTest.FileSystem
using (var stream = await FileSystem.OpenAsync(
source, FileAccess.Write, FileMode.CreateNew, ShareDelete))
{
#pragma warning disable AsyncFixer02
stream.Dispose();
#pragma warning restore AsyncFixer02
}
}
}

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

@ -39,7 +39,7 @@ namespace BuildXL.Cache.ContentStore.InterfacesTest.Sessions
protected readonly ILogger Logger;
private readonly bool _canHibernate;
private bool _disposed;
/// <summary>
@ -276,7 +276,9 @@ namespace BuildXL.Cache.ContentStore.InterfacesTest.Sessions
{
// Open should not pin this content, allowing eviction on the next put.
var r = await session.OpenStreamAsync(context, contentHash, Token).ShouldBeSuccess();
#pragma warning disable AsyncFixer02
r.Stream.Dispose();
#pragma warning restore AsyncFixer02
// This put should succeed after the first content is evicted.
await session.PutRandomAsync(context, ContentHashType, false, MaxSize, Token).ShouldBeSuccess();

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

@ -28,7 +28,9 @@ namespace BuildXL.Cache.ContentStore.Extensions
if (dispose)
{
#pragma warning disable AsyncFixer02
stream.Dispose();
#pragma warning restore AsyncFixer02
}
return content.ToArray();

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

@ -158,7 +158,10 @@ namespace ContentStoreTest.Performance.Sessions
results.All(r => r.Succeeded).Should().BeTrue();
results.All(r => r.Stream != null).Should().BeTrue();
results.ForEach(r => r.Stream.Dispose());
results.ForEach(r =>
#pragma warning disable AsyncFixer02
r.Stream.Dispose());
#pragma warning restore AsyncFixer02
}
private async Task OpenStreamAsync(
@ -251,7 +254,10 @@ namespace ContentStoreTest.Performance.Sessions
session => Task.FromResult(0),
session => PutStreamAsync(session, streams, results));
streams.ForEach(s => s.Dispose());
streams.ForEach(s =>
#pragma warning disable AsyncFixer02
s.Dispose());
#pragma warning restore AsyncFixer02
results.All(r => r.Succeeded).Should().BeTrue();
}

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System;
using System.Collections.Generic;
using System.Diagnostics.ContractsLight;
@ -97,7 +99,7 @@ namespace BuildXL.Cache.MemoizationStore.Distributed.Sessions
}
/// <inheritdoc />
public IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts, UrgencyHint urgencyHint = UrgencyHint.Nominal)
public Async::System.Collections.Generic.IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts, UrgencyHint urgencyHint = UrgencyHint.Nominal)
{
return this.GetSelectorsAsAsyncEnumerable(context, weakFingerprint, cts, urgencyHint);
}

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
@ -236,7 +238,7 @@ namespace BuildXL.Cache.MemoizationStore.Distributed.Stores
}
/// <inheritdoc />
public IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context)
public Async::System.Collections.Generic.IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context)
{
return _innerICache.EnumerateStrongFingerprints(context);
}

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
@ -43,6 +45,6 @@ namespace BuildXL.Cache.MemoizationStore.Interfaces.Caches
/// <summary>
/// Asynchronously enumerates the known strong fingerprints.
/// </summary>
IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context);
Async::System.Collections.Generic.IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context);
}
}

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
@ -20,7 +22,7 @@ namespace BuildXL.Cache.MemoizationStore.Interfaces.Sessions
/// <summary>
/// Gets known selectors for a given weak fingerprint.
/// </summary>
IAsyncEnumerable<GetSelectorResult> GetSelectors(
Async::System.Collections.Generic.IAsyncEnumerable<GetSelectorResult> GetSelectors(
Context context,
Fingerprint weakFingerprint,
CancellationToken cts,

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System;
using System.Collections.Generic;
using System.Linq;
@ -54,7 +56,7 @@ namespace BuildXL.Cache.MemoizationStore.Interfaces.Sessions
/// <summary>
/// Enumerate known selectors for a given weak fingerprint.
/// </summary>
public static IAsyncEnumerable<GetSelectorResult> GetSelectorsAsAsyncEnumerable(
public static Async::System.Collections.Generic.IAsyncEnumerable<GetSelectorResult> GetSelectorsAsAsyncEnumerable(
this IReadOnlyMemoizationSessionWithLevelSelectors session,
Context context,
Fingerprint weakFingerprint,
@ -71,7 +73,7 @@ namespace BuildXL.Cache.MemoizationStore.Interfaces.Sessions
/// <summary>
/// Enumerates a given <paramref name="enumerable"/> until the predicate <paramref name="predicate"/> returns true.
/// </summary>
private static IAsyncEnumerable<T> StopAfter<T>(this IAsyncEnumerable<T> enumerable, Func<T, bool> predicate)
private static Async::System.Collections.Generic.IAsyncEnumerable<T> StopAfter<T>(this Async::System.Collections.Generic.IAsyncEnumerable<T> enumerable, Func<T, bool> predicate)
{
return AsyncEnumerable.CreateEnumerable(
() =>
@ -103,7 +105,7 @@ namespace BuildXL.Cache.MemoizationStore.Interfaces.Sessions
});
}
private static IAsyncEnumerable<GetSelectorResult> ToSelectorResults(Result<LevelSelectors> levelResult)
private static Async::System.Collections.Generic.IAsyncEnumerable<GetSelectorResult> ToSelectorResults(Result<LevelSelectors> levelResult)
{
IEnumerable<GetSelectorResult> selectorResults;
if (!levelResult)
@ -118,7 +120,7 @@ namespace BuildXL.Cache.MemoizationStore.Interfaces.Sessions
return selectorResults.ToAsyncEnumerable();
}
private static IAsyncEnumerable<Result<LevelSelectors>> GetLevelSelectorsEnumerableAsync(
private static Async::System.Collections.Generic.IAsyncEnumerable<Result<LevelSelectors>> GetLevelSelectorsEnumerableAsync(
this IReadOnlyMemoizationSessionWithLevelSelectors session,
Context context,
Fingerprint weakFingerprint,

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System;
using System.Collections.Generic;
using System.Diagnostics.ContractsLight;
@ -85,14 +87,14 @@ namespace BuildXL.Cache.MemoizationStore.Interfaces.Sessions
public virtual async Task<BoolResult> StartupAsync(Context context)
{
StartupStarted = true;
var startupContentResult = await _contentReadOnlySession.StartupAsync(context).ConfigureAwait(false);
if (!startupContentResult.Succeeded)
{
StartupCompleted = true;
return new BoolResult(startupContentResult, "Content session startup failed");
}
var startupMemoizationResult = await _memoizationReadOnlySession.StartupAsync(context).ConfigureAwait(false);
if (!startupMemoizationResult.Succeeded)
{
@ -180,7 +182,7 @@ namespace BuildXL.Cache.MemoizationStore.Interfaces.Sessions
/// <inheritdoc />
public IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts, UrgencyHint urgencyHint = UrgencyHint.Nominal)
public Async::System.Collections.Generic.IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts, UrgencyHint urgencyHint = UrgencyHint.Nominal)
{
return this.GetSelectorsAsAsyncEnumerable(context, weakFingerprint, cts, urgencyHint);
}

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System.Collections.Generic;
using System.Threading.Tasks;
using BuildXL.Cache.ContentStore.Interfaces.Results;
@ -49,6 +51,6 @@ namespace BuildXL.Cache.MemoizationStore.Interfaces.Stores
/// <summary>
/// Asynchronously enumerates the known strong fingerprints.
/// </summary>
IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context);
Async::System.Collections.Generic.IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context);
}
}

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System.Collections.Generic;
using System.IO;
using System.Threading;
@ -55,7 +57,7 @@ namespace BuildXL.Cache.MemoizationStore.InterfacesTest.Results
}
/// <inheritdoc />
public IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts, UrgencyHint urgencyHint = UrgencyHint.Nominal)
public Async::System.Collections.Generic.IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts, UrgencyHint urgencyHint = UrgencyHint.Nominal)
{
throw new System.NotImplementedException();
}

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System;
using System.Collections.Generic;
using System.Linq;
@ -63,7 +65,7 @@ namespace BuildXL.Cache.MemoizationStore.Service
}
/// <nodoc />
public IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context)
public Async::System.Collections.Generic.IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context)
{
return AsyncEnumerable.Empty<StructResult<StrongFingerprint>>();
}

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
@ -81,7 +83,7 @@ namespace BuildXL.Cache.MemoizationStore.Service
}
/// <inheritdoc />
public IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts, UrgencyHint urgencyHint = UrgencyHint.Nominal)
public Async::System.Collections.Generic.IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts, UrgencyHint urgencyHint = UrgencyHint.Nominal)
{
return this.GetSelectorsAsAsyncEnumerable(context, weakFingerprint, cts, urgencyHint);
}

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System;
using System.Collections.Generic;
using System.Diagnostics.ContractsLight;
@ -311,7 +313,7 @@ namespace BuildXL.Cache.MemoizationStore.Sessions
}
/// <inheritdoc />
public IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context)
public Async::System.Collections.Generic.IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context)
{
return MemoizationStore.EnumerateStrongFingerprints(context);
}

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System.Collections.Generic;
using System.Diagnostics.ContractsLight;
using System.Threading;
@ -42,7 +44,7 @@ namespace BuildXL.Cache.MemoizationStore.Sessions
public string Name { get; }
/// <inheritdoc />
public IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts, UrgencyHint urgencyHint = UrgencyHint.Nominal)
public Async::System.Collections.Generic.IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts, UrgencyHint urgencyHint = UrgencyHint.Nominal)
{
return this.GetSelectorsAsAsyncEnumerable(context, weakFingerprint, cts, urgencyHint);
}

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System.Collections.Generic;
using System.Diagnostics.ContractsLight;
using System.Threading;
@ -42,7 +44,7 @@ namespace BuildXL.Cache.MemoizationStore.Sessions
public string Name { get; }
/// <inheritdoc />
public IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts, UrgencyHint urgencyHint = UrgencyHint.Nominal)
public Async::System.Collections.Generic.IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts, UrgencyHint urgencyHint = UrgencyHint.Nominal)
{
return this.GetSelectorsAsAsyncEnumerable(context, weakFingerprint, cts, urgencyHint);
}

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@ -91,7 +93,7 @@ namespace BuildXL.Cache.MemoizationStore.Stores
/// <summary>
/// Enumerate known selectors for a given weak fingerprint.
/// </summary>
internal IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts)
internal Async::System.Collections.Generic.IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts)
{
var result = GetSelectorsCore(context, weakFingerprint, cts);
if (result)
@ -164,7 +166,7 @@ namespace BuildXL.Cache.MemoizationStore.Stores
CancellationToken cts)
{
using (var cancellableContext = TrackShutdown(context, cts))
{
{
return await AddOrGetContentHashListCall.RunAsync(_tracer, cancellableContext, strongFingerprint, async () =>
{
using (await _lockSet.AcquireAsync(strongFingerprint.WeakFingerprint).ConfigureAwait(false))
@ -220,7 +222,7 @@ namespace BuildXL.Cache.MemoizationStore.Stores
}
/// <inheritdoc/>
public IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context)
public Async::System.Collections.Generic.IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context)
{
return _records.Select(record => new StructResult<StrongFingerprint>(record.StrongFingerprint)).ToAsyncEnumerable();
}

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System;
using System.Collections.Generic;
using System.Data.SQLite;
@ -321,7 +323,7 @@ namespace BuildXL.Cache.MemoizationStore.Stores
}
/// <inheritdoc />
public IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context)
public Async::System.Collections.Generic.IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context)
{
context.Debug($"{nameof(SQLiteMemoizationStore)}.{nameof(EnumerateStrongFingerprints)}({context.Id})");
return AsyncEnumerable.CreateEnumerable(
@ -389,7 +391,7 @@ namespace BuildXL.Cache.MemoizationStore.Stores
/// <summary>
/// Enumerate known selectors for a given weak fingerprint.
/// </summary>
internal IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts)
internal Async::System.Collections.Generic.IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts)
{
return AsyncEnumerableExtensions.CreateSingleProducerTaskAsyncEnumerable(() => getSelectorsCore());

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

@ -20,7 +20,7 @@ namespace Test {
...(BuildXLSdk.isDotNetCoreBuild
// TODO: This is to get a .Net Core build, but it may not pass tests
? [importFrom("System.Data.SQLite.Core").withQualifier({targetFramework: "net461"}).pkg]
// Gets around issue of 461 needed netstandard 2.0 lib
// Gets around issue of 461 needed netstandard 2.0 lib
: [importFrom("System.Data.SQLite.Core").pkg]
),
ContentStore.Hashing.dll,
@ -35,7 +35,6 @@ namespace Test {
Library.dll,
importFrom("BuildXL.Utilities").dll,
importFrom("System.Interactive.Async").pkg,
...BuildXLSdk.fluentAssertionsWorkaround,
],

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System;
using System.Collections.Generic;
using System.IO;
@ -181,7 +183,7 @@ namespace BuildXL.Cache.MemoizationStore.Test.Sessions
{
return RunCacheAndSessionTestAsync(async (cache, session, context) =>
{
IAsyncEnumerable<GetSelectorResult> enumerator = session.GetSelectors(context, Fingerprint.Random(), Token);
Async::System.Collections.Generic.IAsyncEnumerable<GetSelectorResult> enumerator = session.GetSelectors(context, Fingerprint.Random(), Token);
await enumerator.ToList(CancellationToken.None);
long counter = await GetCounterValue("GetSelectorsCall", cache, context);
counter.Should().Be(1);

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@ -295,7 +297,7 @@ namespace BuildXL.Cache.MemoizationStore.Test.Performance.Sessions
foreach (var weakFingerprint in weakFingerprints)
{
var getSelectorsEnumerator = session.GetSelectors(context, weakFingerprint, Token);
IAsyncEnumerator<GetSelectorResult> enumerator = getSelectorsEnumerator.GetEnumerator();
Async::System.Collections.Generic.IAsyncEnumerator<GetSelectorResult> enumerator = getSelectorsEnumerator.GetEnumerator();
while (await enumerator.MoveNext(CancellationToken.None))
{
GetSelectorResult result = enumerator.Current;

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System;
using System.Collections.Generic;
using System.IO;
@ -190,7 +192,7 @@ namespace BuildXL.Cache.MemoizationStore.Test.Sessions
{
}
public IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context)
public Async::System.Collections.Generic.IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context)
{
throw new NotImplementedException();
}
@ -245,7 +247,7 @@ namespace BuildXL.Cache.MemoizationStore.Test.Sessions
}
/// <inheritdoc />
public IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts, UrgencyHint urgencyHint = UrgencyHint.Nominal)
public Async::System.Collections.Generic.IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts, UrgencyHint urgencyHint = UrgencyHint.Nominal)
{
return this.GetSelectorsAsAsyncEnumerable(context, weakFingerprint, cts, urgencyHint);
}
@ -256,7 +258,7 @@ namespace BuildXL.Cache.MemoizationStore.Test.Sessions
GetSelectorsParams.Add(weakFingerprint);
return Task.FromResult(Result.Success(new LevelSelectors(new Selector[0], hasMore: false)));
}
public Task<BoolResult> IncorporateStrongFingerprintsAsync(Context context, IEnumerable<Task<StrongFingerprint>> strongFingerprints, CancellationToken cts, UrgencyHint urgencyHint = UrgencyHint.Nominal)
{
IncorporateStringFingerprintsAsyncParams.Add(strongFingerprints);

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System;
using System.Collections.Generic;
using System.Threading;
@ -94,7 +96,7 @@ namespace BuildXL.Cache.MemoizationStore.Test.Sessions
public Task<GetStatsResult> GetStatsAsync(Context context) => _client.GetStatsAsync(context);
/// <inheritdoc />
public IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context) => _client.EnumerateStrongFingerprints(context);
public Async::System.Collections.Generic.IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context) => _client.EnumerateStrongFingerprints(context);
private static void SetThreadPoolSizes()
{

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
@ -95,7 +97,7 @@ namespace BuildXL.Cache.MemoizationStore.Vsts
_cacheNamespace = cacheNamespace;
_buildCacheHttpClientFactory = buildCacheHttpClientFactory;
_tracer = new BuildCacheCacheTracer(logger, nameof(BuildCacheCache));
_backingContentStore = new BackingContentStore(
fileSystem, backingContentStoreHttpClientFactory, timeToKeepUnreferencedContent, _tracer.ContentSessionTracer, downloadBlobsThroughBlobStore, useDedupStore);
@ -402,7 +404,7 @@ namespace BuildXL.Cache.MemoizationStore.Vsts
public Guid Id { get; private set; }
/// <inheritdoc />
public IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context)
public Async::System.Collections.Generic.IAsyncEnumerable<StructResult<StrongFingerprint>> EnumerateStrongFingerprints(Context context)
{
return AsyncEnumerable.Empty<StructResult<StrongFingerprint>>();
}

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

@ -1,6 +1,8 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
extern alias Async;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@ -380,7 +382,7 @@ namespace BuildXL.Cache.MemoizationStore.Vsts
public bool ShutdownStarted { get; private set; }
/// <inheritdoc />
public IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts, UrgencyHint urgencyHint = UrgencyHint.Nominal)
public Async::System.Collections.Generic.IAsyncEnumerable<GetSelectorResult> GetSelectors(Context context, Fingerprint weakFingerprint, CancellationToken cts, UrgencyHint urgencyHint = UrgencyHint.Nominal)
{
return this.GetSelectorsAsAsyncEnumerable(context, weakFingerprint, cts, urgencyHint);
}

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

@ -1,9 +1,9 @@
{
"runtimeOptions": {
"tfm": "netcoreapp2.0",
"tfm": "netcoreapp3.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "2.0.0"
"version": "3.0.0-preview5-27626-15"
}
}
}

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

@ -105,7 +105,10 @@ namespace BuildXL.Cache.Analyzer
}
long length = possibleStream.Result.Length;
#pragma warning disable AsyncFixer02
possibleStream.Result.Dispose();
#pragma warning restore AsyncFixer02
return new Tuple<CasHash, long>(casHash, length);
}

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

@ -14,7 +14,7 @@ namespace Deployment {
]
};
const frameworkSpecificPart = qualifier.targetFramework === "netcoreapp2.2"
const frameworkSpecificPart = BuildXLSdk.isDotNetCoreBuild
? qualifier.targetRuntime
: qualifier.targetFramework;

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

@ -29,7 +29,7 @@ namespace Ide {
{
file: importFrom("BuildXL.Ide").withQualifier({
configuration: qualifier.configuration,
targetFramework:"netcoreapp2.2",
targetFramework:"netcoreapp3.0",
targetRuntime: "osx-x64"}
).LanguageService.Server.vsix,
targetFileName: a`BuildXL.vscode.osx.vsix`,

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

@ -33,7 +33,7 @@ namespace NugetPackages {
id: `${packageNamePrefix}.win-x64`,
deployment: BuildXL.withQualifier({
configuration: qualifier.configuration,
targetFramework: "netcoreapp2.2",
targetFramework: "netcoreapp3.0",
targetRuntime: "win-x64"
}).deployment,
});
@ -42,7 +42,7 @@ namespace NugetPackages {
id: `${packageNamePrefix}.osx-x64`,
deployment: BuildXL.withQualifier({
configuration: qualifier.configuration,
targetFramework: "netcoreapp2.2",
targetFramework: "netcoreapp3.0",
targetRuntime: "osx-x64"
}).deployment,
});
@ -93,7 +93,7 @@ namespace NugetPackages {
id: `${packageNamePrefix}.Tools.SandboxExec.osx-x64`,
deployment: Tools.SandboxExec.withQualifier({
configuration: qualifier.configuration,
targetFramework: "netcoreapp2.2",
targetFramework: "netcoreapp3.0",
targetRuntime: "osx-x64"
}).deployment
});
@ -103,7 +103,7 @@ namespace NugetPackages {
id: `${packageNamePrefix}.Tools.Orchestrator.osx-x64`,
deployment: Tools.Orchestrator.withQualifier({
configuration: qualifier.configuration,
targetFramework: "netcoreapp2.2",
targetFramework: "netcoreapp3.0",
targetRuntime: "osx-x64"
}).deployment
});

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

@ -6,7 +6,7 @@ import * as Deployment from "Sdk.Deployment";
import * as BuildXLSdk from "Sdk.BuildXL";
namespace Tests.Osx {
export declare const qualifier : {configuration: "debug" | "release", targetFramework: "netcoreapp2.2", targetRuntime: "osx-x64"};
export declare const qualifier : {configuration: "debug" | "release", targetFramework: "netcoreapp3.0", targetRuntime: "osx-x64"};
const sharedBinFolderName = a`shared_bin`;
@ -225,7 +225,7 @@ namespace Tests.Osx {
function writeFile(fileName: PathAtom, content: string): DerivedFile {
return Transformer.writeAllText({
outputPath: p`${Context.getNewOutputDirectory("mac-tests")}/${fileName}`,
outputPath: p`${Context.getNewOutputDirectory("mac-tests")}/${fileName}`,
text: content
});
}

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

@ -20,7 +20,7 @@ namespace BuildXL {
...(qualifier.targetFramework !== "net472" ? [] : [
importFrom("BuildXL.Cache.ContentStore").VfsApplication.exe,
]),
// analyzers
importFrom("BuildXL.Tools").Execution.Analyzer.exe,
importFrom("BuildXL.Tools").BxlScriptAnalyzer.exe,
@ -42,13 +42,13 @@ namespace BuildXL {
subfolder: r`bxp-server`,
contents: [
importFrom("BuildXL.Explorer").Server.withQualifier(
Object.merge<BuildXLSdk.NetCoreAppQualifier>(qualifier, {targetFramework: "netcoreapp2.2"})
Object.merge<BuildXLSdk.NetCoreAppQualifier>(qualifier, {targetFramework: "netcoreapp3.0"})
).exe
]
} ] ),
{
subfolder: r`MsBuildGraphBuilder`,
contents: qualifier.targetFramework === "netcoreapp2.2" ? [] : [
contents: BuildXLSdk.isDotNetCoreBuild ? [] : [
// If the current qualifier is full framework, this tool has to be built with 472
importFrom("BuildXL.Tools").MsBuildGraphBuilder.withQualifier(
Object.merge<(typeof qualifier) & {targetFramework: "net472"}>(qualifier, {targetFramework: "net472"})).exe
@ -86,7 +86,7 @@ namespace BuildXL {
]
};
const frameworkSpecificPart = qualifier.targetFramework === "netcoreapp2.2"
const frameworkSpecificPart = BuildXLSdk.isDotNetCoreBuild
? qualifier.targetRuntime
: qualifier.targetFramework;

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

@ -11,12 +11,12 @@ namespace Cache.NugetPackages {
const Net451ContentStore = importFrom("BuildXL.Cache.ContentStore").withQualifier({ configuration: qualifier.configuration, targetFramework: "net451", targetRuntime: "win-x64" });
const Net461ContentStore = importFrom("BuildXL.Cache.ContentStore").withQualifier({ configuration: qualifier.configuration, targetFramework: "net461", targetRuntime: "win-x64" });
const Net472ContentStore = importFrom("BuildXL.Cache.ContentStore").withQualifier({ configuration: qualifier.configuration, targetFramework: "net472", targetRuntime: "win-x64" });
const WinX64ContentStore = importFrom("BuildXL.Cache.ContentStore").withQualifier({ configuration: qualifier.configuration, targetFramework: "netcoreapp2.2", targetRuntime: "win-x64" });
const WinX64ContentStore = importFrom("BuildXL.Cache.ContentStore").withQualifier({ configuration: qualifier.configuration, targetFramework: "netcoreapp3.0", targetRuntime: "win-x64" });
const Net451MemoizationStore = importFrom("BuildXL.Cache.MemoizationStore").withQualifier({ configuration: qualifier.configuration, targetFramework: "net451", targetRuntime: "win-x64" });
const Net461MemoizationStore = importFrom("BuildXL.Cache.MemoizationStore").withQualifier({ configuration: qualifier.configuration, targetFramework: "net461", targetRuntime: "win-x64" });
const Net472MemoizationStore = importFrom("BuildXL.Cache.MemoizationStore").withQualifier({ configuration: qualifier.configuration, targetFramework: "net472", targetRuntime: "win-x64" });
const WinX64MemoizationStore = importFrom("BuildXL.Cache.MemoizationStore").withQualifier({ configuration: qualifier.configuration, targetFramework: "netcoreapp2.2", targetRuntime: "win-x64" });
const WinX64MemoizationStore = importFrom("BuildXL.Cache.MemoizationStore").withQualifier({ configuration: qualifier.configuration, targetFramework: "netcoreapp3.0", targetRuntime: "win-x64" });
const Net461DistributedCacheHost = importFrom("BuildXL.Cache.DistributedCache.Host").withQualifier({ configuration: qualifier.configuration, targetFramework: "net461", targetRuntime: "win-x64" });

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

@ -42,7 +42,7 @@ namespace Tools {
contents: [
importFrom("BuildXL.Tools").withQualifier({
configuration: qualifier.configuration,
targetFramework: "netcoreapp2.2",
targetFramework: "netcoreapp3.0",
targetRuntime: qualifier.targetRuntime
}).Orchestrator.exe
],

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

@ -840,7 +840,7 @@ namespace BuildXL.Processes
Tracing.Logger.Log.PipProcessStartExternalTool(m_loggingContext, m_pip.SemiStableHash, m_pip.GetDescription(m_context), externalSandboxedProcessExecutor.ExecutablePath);
process = await ExternalSandboxedProcess.StartAsync(
info,
info,
spi => new ExternalToolSandboxedProcess(spi, externalSandboxedProcessExecutor));
}
else
@ -925,7 +925,9 @@ namespace BuildXL.Processes
finally
{
m_activeProcess = null;
#pragma warning disable AsyncFixer02
cancellationTokenRegistration.Dispose();
#pragma warning restore AsyncFixer02
process.Dispose();
}
@ -950,7 +952,7 @@ namespace BuildXL.Processes
/// These various validations that the detours communication channel
/// </summary>
private SandboxedProcessPipExecutionResult ValidateDetoursCommunication(
SandboxedProcessPipExecutionResult result,
SandboxedProcessPipExecutionResult result,
int lastMessageCount,
bool isMessageSemaphoreCountCreated)
{
@ -1557,8 +1559,8 @@ namespace BuildXL.Processes
}
// TODO: named semaphores are not supported in NetStandard2.0
if (m_sandboxConfig.AdminRequiredProcessExecutionMode == AdminRequiredProcessExecutionMode.Internal
&& checkMessageCount
if (m_sandboxConfig.AdminRequiredProcessExecutionMode == AdminRequiredProcessExecutionMode.Internal
&& checkMessageCount
&& !OperatingSystemHelper.IsUnixOS)
{
// Semaphore names don't allow '\\' chars.
@ -3123,7 +3125,7 @@ namespace BuildXL.Processes
var maybeResult = FileUtilities.TryProbePathExistence(path, followSymlink: false);
var existsAsFile = maybeResult.Succeeded && maybeResult.Result == PathExistence.ExistsAsFile;
// If file outputs are not redirected, this is simply file existence. Otherwise, we have
// If file outputs are not redirected, this is simply file existence. Otherwise, we have
// to check that the file is not a WCI tombstone, since this means the file is not really there.
return existsAsFile && !(fileOutputsAreRedirected && FileUtilities.IsWciTombstoneFile(path));
}

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

@ -913,7 +913,7 @@ namespace BuildXL.Scheduler.Artifacts
public async Task<FileContentInfo?> TryQuerySealedOrUndeclaredInputContentAsync(AbsolutePath path, string consumerDescription, bool allowUndeclaredSourceReads)
{
FileOrDirectoryArtifact declaredArtifact;
var isDynamicallyObservedSource = false;
if (!m_sealedFiles.TryGetValue(path, out FileArtifact sealedFile))
@ -927,7 +927,7 @@ namespace BuildXL.Scheduler.Artifacts
// No source seal directory found
return null;
}
else
else
{
// If undeclared source reads is enabled but the path does not exist, then we can just shortcut
// the query here. This matches the declared case when no static artifact is found that contains
@ -1247,7 +1247,7 @@ namespace BuildXL.Scheduler.Artifacts
string.Join(Environment.NewLine, unsealedFiles.Select(f => "\t" + f)));
}
}
}
else if (sealDirectoryKind.IsSourceSeal())
{
m_sealedSourceDirectories.TryAdd(directory.Path, directory);
@ -1321,8 +1321,8 @@ namespace BuildXL.Scheduler.Artifacts
// Directory artifact contents are not hashed since they will be hashed dynamically
// if the pip accesses them, so the file is the declared artifact
state.HashTasks.Add(TryQueryContentAsync(
file,
operationContext,
file,
operationContext,
declaredArtifact: file,
allowUndeclaredSourceReads));
}
@ -1715,10 +1715,10 @@ namespace BuildXL.Scheduler.Artifacts
/// <param name="dependentFileIndex">the index of a file (in the list of materialized files) which requires the materialization of this file as
/// a prerequisite (if any). This is used when restoring content into cache for a host materialized file (i.e. write file output).</param>
private void AddFileMaterialization(
PipArtifactsState state,
FileArtifact file,
bool? allowReadOnlyOverride,
AbsolutePath symlinkTarget,
PipArtifactsState state,
FileArtifact file,
bool? allowReadOnlyOverride,
AbsolutePath symlinkTarget,
int? dependentFileIndex = null)
{
bool shouldMaterializeSourceFile = (IsDistributedWorker && SourceFileMaterializationEnabled) || symlinkTarget.IsValid;
@ -1852,7 +1852,7 @@ namespace BuildXL.Scheduler.Artifacts
/// </summary>
/// <remarks>
/// Creating empty directories when they don't exist ensures the correctness of replaying pip outputs. Those existence of such directories may be needed
/// by downstream pips. Empty directories are not stored into the cache, but their paths are stored in the pip itself and are collected when we populate <see cref="PipArtifactsState"/>.
/// by downstream pips. Empty directories are not stored into the cache, but their paths are stored in the pip itself and are collected when we populate <see cref="PipArtifactsState"/>.
/// If the pip outputs are removed, then to replay the empty output directories in the next build, when we have a cache hit, those directories need to be created.
/// </remarks>
private async Task<bool> PrepareDirectoriesAsync(PipArtifactsState state, OperationContext operationContext)
@ -1914,7 +1914,7 @@ namespace BuildXL.Scheduler.Artifacts
destinationPath: directory.Path.ToString(Context.PathTable),
errorMessage: ex.LogEventMessage);
state.AddFailedDirectory(directory);
success = false;
m_dynamicDirectoryDeletionTasks[directory] = BoolTask.False;
@ -2028,7 +2028,10 @@ namespace BuildXL.Scheduler.Artifacts
if (possiblyStream.Succeeded)
{
#pragma warning disable AsyncFixer02
possiblyStream.Result.Dispose();
#pragma warning restore AsyncFixer02
possiblyPlaced =
new Possible<ContentMaterializationResult>(
new ContentMaterializationResult(
@ -2286,7 +2289,7 @@ namespace BuildXL.Scheduler.Artifacts
// the copy-file destination relies on the else-clause below where we try to get
// other file using TryGetFileArtifactForHash.
// If we don't store outputs to cache, then we should not include cache operation to determine
// if the content is available. However, we just checked, by TryDiscoverAsync above, that the content
// if the content is available. However, we just checked, by TryDiscoverAsync above, that the content
// is available with the expected content hash. Thus, we can safely say that the content is available.
isAvailable = true;
}
@ -2339,7 +2342,7 @@ namespace BuildXL.Scheduler.Artifacts
if (copySource.IsSourceFile)
{
// Reached a source file. Just abort rather than calling the host again.
// Reached a source file. Just abort rather than calling the host again.
break;
}
@ -2551,10 +2554,10 @@ namespace BuildXL.Scheduler.Artifacts
{
// Start the task to hash input
state.HashTasks.Add(TryQueryContentAsync(
file,
operationContext,
declaredArtifact: file,
pipInfo.UnderlyingPip.ProcessAllowsUndeclaredSourceReads,
file,
operationContext,
declaredArtifact: file,
pipInfo.UnderlyingPip.ProcessAllowsUndeclaredSourceReads,
verifyingHash: true));
}
else
@ -2852,7 +2855,7 @@ namespace BuildXL.Scheduler.Artifacts
if (possibleProbeResult.Result == PathExistence.ExistsAsFile)
{
Possible<ContentDiscoveryResult> possiblyDiscovered =
Possible<ContentDiscoveryResult> possiblyDiscovered =
await LocalDiskContentStore.TryDiscoverAsync(fileArtifact, artifactExpandedPath);
DiscoveredContentHashOrigin origin;
@ -3028,9 +3031,9 @@ namespace BuildXL.Scheduler.Artifacts
// the flag supressed a double write violation detection. So let's just warn
// and move on.
Logger.Log.FileArtifactContentMismatch(
m_host.LoggingContext,
fileArtifact.Path.ToString(Context.PathTable),
existingInfo.Hash.ToHex(),
m_host.LoggingContext,
fileArtifact.Path.ToString(Context.PathTable),
existingInfo.Hash.ToHex(),
fileMaterializationInfo.Hash.ToHex());
return false;
@ -3542,7 +3545,7 @@ namespace BuildXL.Scheduler.Artifacts
/// Files which failed to materialize
/// </summary>
private readonly List<(FileArtifact, ContentHash)> m_failedFiles = new List<(FileArtifact, ContentHash)>();
/// <summary>
/// Directories which failed to materialize
/// </summary>
@ -3626,7 +3629,7 @@ namespace BuildXL.Scheduler.Artifacts
m_failedFiles.Add((file, contentHash));
}
}
/// <summary>
/// Adds a failed directory
/// </summary>

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

@ -19,7 +19,7 @@ namespace Server {
references: [
...addIf(BuildXLSdk.isFullFramework,
// TODO: revisit this!
Managed.Factory.createBinary(importFrom("Microsoft.NETCore.App").Contents.all, r`ref/netcoreapp2.1/netstandard.dll`)
Managed.Factory.createBinary(importFrom("Microsoft.NETCore.App").Contents.all, r`ref/netcoreapp3.0/netstandard.dll`)
),
importFrom("BuildXL.Pips").dll,
@ -47,7 +47,7 @@ namespace Server {
importFrom("Microsoft.AspNetCore.Mvc.DataAnnotations").pkg,
importFrom("Microsoft.AspNetCore.Mvc.Formatters.Json").pkg,
importFrom("Microsoft.AspNetCore.Mvc.ViewFeatures").pkg,
importFrom("Microsoft.AspNetCore.Razor.Runtime").pkg,
importFrom("Microsoft.AspNetCore.Razor.Runtime").pkg,
importFrom("Microsoft.Extensions.Caching.Abstractions").pkg,
importFrom("Microsoft.Extensions.Caching.Memory").pkg,
importFrom("Microsoft.Extensions.Configuration").pkg,

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

@ -77,7 +77,11 @@ namespace BuildXL.FrontEnd.Script.RuntimeModel.AstBridge.Rules
// Failing when the number literal overflows
try
{
double.Parse(literal, NumberStyles.AllowDecimalPoint | NumberStyles.AllowExponent, s_numberFormatInfo);
var result = double.Parse(literal, NumberStyles.AllowDecimalPoint | NumberStyles.AllowExponent, s_numberFormatInfo);
if (Double.IsInfinity(result))
{
throw new OverflowException();
}
}
catch (OverflowException)
{

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

@ -37,7 +37,7 @@ namespace BuildXL.FrontEnd.Sdk
/// <nodoc/>
protected readonly PathTable m_pathTable;
/// <summary>
/// Mount names defined in the configuration (populated during construction).
@ -87,7 +87,7 @@ namespace BuildXL.FrontEnd.Sdk
}
stream = m_fileSystem.OpenText(AbsolutePath.Create(m_pathTable, physicalPath)).BaseStream;
return true;
}
@ -98,7 +98,10 @@ namespace BuildXL.FrontEnd.Sdk
if (TryGetFrontEndFile(path, "dummyFrontEnd", out stream))
{
var result = await FileContent.ReadFromAsync(stream);
#pragma warning disable AsyncFixer02
stream?.Dispose();
#pragma warning restore AsyncFixer02
return result;
}

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

@ -71,7 +71,9 @@ namespace BuildXL.FrontEnd.Script.Testing.Helper
if (TryGetFrontEndFile(path, "dummyFrontEnd", out stream))
{
var result = await FileContent.ReadFromAsync(stream);
#pragma warning disable AsyncFixer02
stream?.Dispose();
#pragma warning restore AsyncFixer02
return result;
}

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

@ -22,7 +22,7 @@ namespace TestGeneratorDeployment {
subfolder: a`MacOs`,
contents: $.withQualifier({
configuration: qualifier.configuration,
targetFramework: "netcoreapp2.2",
targetFramework: "netcoreapp3.0",
targetRuntime: "osx-x64"
}).TestGenerator.deploymentContents
}

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

@ -27,7 +27,7 @@ namespace BuildXL.FrontEnd.Utilities
string frontEnd,
FrontEndContext context,
FrontEndEngineAbstraction engine,
IReadOnlyCollection<AbsolutePath> explicitCandidates,
IReadOnlyCollection<AbsolutePath> explicitCandidates,
out IEnumerable<AbsolutePath> searchLocations,
Action onEmptyResult = null,
Action<string> onPathParseFailure = null)
@ -74,9 +74,9 @@ namespace BuildXL.FrontEnd.Utilities
/// beforeLaunch is invoked right before the process is launched
/// onResult is invoked after getting a successful result
/// </summary>>
public static async Task<SandboxedProcessResult> RunSandboxedToolAsync(FrontEndContext context,
string pathToTool,
string buildStorageDirectory,
public static async Task<SandboxedProcessResult> RunSandboxedToolAsync(FrontEndContext context,
string pathToTool,
string buildStorageDirectory,
FileAccessManifest fileAccessManifest,
string arguments,
string workingDirectory,
@ -125,9 +125,12 @@ namespace BuildXL.FrontEnd.Utilities
r =>
{
// Dispose the registration for the cancellation token once the process is done
#pragma warning disable AsyncFixer02
registration.Dispose();
#pragma warning restore AsyncFixer02
//
//
onResult?.Invoke();
return r.GetAwaiter().GetResult();
@ -146,7 +149,7 @@ namespace BuildXL.FrontEnd.Utilities
foreach (string environmentVariable in environment.Keys)
{
// Expose as much of the environment as we can -- use the ones overriden by the Engine
// Expose as much of the environment as we can -- use the ones overriden by the Engine
if (engine.TryGetBuildParameter(environmentVariable, frontEndName, out var value))
{
engineEnvironment[environmentVariable] = value;
@ -229,7 +232,7 @@ namespace BuildXL.FrontEnd.Utilities
// Two things are happening here: we want to register if the file is present or absent. Engine.FileExists takes
// care of that. And in the case the file exists, record the content.
// There are apparently some repos that create and delete files during graph construction :(
// So we cannot trust detours and check for IsNonexistent on the access itself. Even though there were read/write accesses on a given file,
// So we cannot trust detours and check for IsNonexistent on the access itself. Even though there were read/write accesses on a given file,
// the file may not exist at this point
if (engine.FileExists(path))
{

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

@ -63,7 +63,9 @@ namespace BuildXL.FrontEnd.Script.Debugger
{
if (stream != null)
{
#pragma warning disable AsyncFixer02
stream.Dispose();
#pragma warning restore AsyncFixer02
}
}
}

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

@ -8,6 +8,7 @@ using TypeScript.Net.Diagnostics;
using TypeScript.Net.Types;
using TypeScript.Net.Utilities;
using Diagnostic = Microsoft.VisualStudio.LanguageServer.Protocol.Diagnostic;
using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range;
namespace BuildXL.Ide.LanguageServer
{
@ -73,7 +74,7 @@ namespace BuildXL.Ide.LanguageServer
End = LineInfoExtensions.GetLineAndColumnBy(spec.End, spec, false).ToPosition(),
};
}
/// <nodoc />
public static Range ToRange(this ITextSpan textSpan, ISourceFile sourceFile)
{

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

@ -7,6 +7,7 @@ using Microsoft.VisualStudio.LanguageServer.Protocol;
using TypeScript.Net.Diagnostics;
using TypeScript.Net.Types;
using TypeScript.Net.Utilities;
using Range = Microsoft.VisualStudio.LanguageServer.Protocol.Range;
namespace BuildXL.Ide.LanguageServer
{

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

@ -20,7 +20,7 @@ namespace Tool.CreateZipPackage {
importFrom("BuildXL.Utilities").ToolSupport.dll,
],
defineConstants: [
...addIf(qualifier.targetFramework === "net472" || qualifier.targetFramework === "netcoreapp2.2", "FEATURE_EXTENDED_ATTR")
...addIf(qualifier.targetFramework === "net472" || BuildXLSdk.isDotNetCoreBuild, "FEATURE_EXTENDED_ATTR")
]
});

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

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<PlatformTarget>x64</PlatformTarget>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.7" />

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

@ -37,7 +37,7 @@ namespace TestProcess {
contents: [
$.withQualifier({
configuration: qualifier.configuration,
targetFramework: "netcoreapp2.2",
targetFramework: "netcoreapp3.0",
targetRuntime: "osx-x64"
}).testProcessExe,

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

@ -116,7 +116,9 @@ namespace Test.BuildXL.Ipc
Assert.False(client2PingResponseTask.IsCompleted);
// close client1 and wait for response to client2
#pragma warning disable AsyncFixer02
client1.Dispose();
#pragma warning restore AsyncFixer02
VerifyPingResponse(client2PingRequest, await client2PingResponseTask);
}
});

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

@ -17,7 +17,7 @@ if NOT DEFINED DBD_TESTGEN_COUNT (
)
if NOT DEFINED TEST_COMMITID (
set TEST_COMMITID=3a5fdc81d4d87a67fd519eb8dfd963e355139dcf
set TEST_COMMITID=201fb8470cc4a363705e1b4d721e98e5731346b0
)
set TEST_SOLUTION_ROOT=%ENLISTMENTROOT%\Out\Tests\SMDB

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

@ -78,7 +78,7 @@ config({
// Roslyn
{ id: "Microsoft.Net.Compilers", version: "3.0.0" },
{ id: "Microsoft.NETCore.Compilers", version: "2.10.0" },
{ id: "Microsoft.NETCore.Compilers", version: "3.1.0-beta3-final" },
{ id: "Microsoft.CodeAnalysis.Common", version: "2.10.0" },
{ id: "Microsoft.CodeAnalysis.CSharp", version: "2.10.0" },
{ id: "Microsoft.CodeAnalysis.VisualBasic", version: "2.10.0" },
@ -227,30 +227,48 @@ config({
{ id: "Validation", version: "2.3.7"},
// .NET Core Dependencies
{ id: "Microsoft.NETCore.App", version: "2.1.1" },
{ id: "NETStandard.Library", version: "2.0.3", tfm: ".NETStandard2.0"},
{ id: "Microsoft.NETCore.Platforms", version: "2.1.0", tfm: ".NETStandard2.0" },
{ id: "Microsoft.NETCore.DotNetHostPolicy", version: "2.1.1"},
{ id: "Microsoft.NETCore.App", version: "3.0.0-preview5-27626-15" },
{ id: "Microsoft.NETCore.App", version: "2.1.1", alias: "Microsoft.NETCore.App.211" },
{ id: "NETStandard.Library", version: "2.0.3", tfm: ".NETStandard2.0" },
{ id: "Microsoft.NETCore.Platforms", version: "3.0.0-preview5.19224.8" },
{ id: "Microsoft.NETCore.DotNetHostPolicy", version: "3.0.0-preview5-27626-15"},
{ id: "System.Security.Claims", version: "4.3.0" },
// .NET Core Self-Contained Deployment
{ id: "Microsoft.NETCore.DotNetHostResolver", version: "2.2.0" },
{ id: "Microsoft.NETCore.DotNetAppHost", version: "2.2.0" },
{ id: "runtime.win-x64.Microsoft.NETCore.DotNetAppHost", version: "2.2.0" },
{ id: "runtime.win-x64.Microsoft.NETCore.App", version: "2.2.0" },
{ id: "runtime.win-x64.Microsoft.NETCore.DotNetHostResolver", version: "2.2.0" },
{ id: "runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy", version: "2.2.0" },
{ id: "Microsoft.NETCore.DotNetHostResolver", version: "3.0.0-preview5-27626-15" },
{ id: "Microsoft.NETCore.DotNetHostResolver", version: "2.2.0", alias: "Microsoft.NETCore.DotNetHostResolver.220" },
{ id: "runtime.osx-x64.Microsoft.NETCore.DotNetAppHost", version: "2.2.0" },
{ id: "runtime.osx-x64.Microsoft.NETCore.App", version: "2.2.0" },
{ id: "runtime.osx-x64.Microsoft.NETCore.DotNetHostResolver", version: "2.2.0" },
{ id: "runtime.osx-x64.Microsoft.NETCore.DotNetHostPolicy", version: "2.2.0" },
{ id: "Microsoft.NETCore.DotNetAppHost", version: "3.0.0-preview5-27626-15" },
{ id: "Microsoft.NETCore.DotNetAppHost", version: "2.2.0", alias: "Microsoft.NETCore.DotNetAppHost.220" },
{ id: "System.Security.Principal.Windows", version: "4.5.1" },
{ id: "System.Security.AccessControl", version: "4.5.0", dependentPackageIdsToSkip: ["System.Security.Principal.Windows"] },
{ id: "System.Threading.AccessControl", version: "4.5.0" },
// .NET Core win-x64 runtime deps
{ id: "runtime.win-x64.Microsoft.NETCore.DotNetAppHost", version: "3.0.0-preview5-27626-15" },
{ id: "runtime.win-x64.Microsoft.NETCore.DotNetAppHost", version: "2.2.0", alias: "runtime.win-x64.Microsoft.NETCore.DotNetAppHost.220" },
// DotNetCore related
{ id: "runtime.win-x64.Microsoft.NETCore.App", version: "3.0.0-preview5-27626-15" },
{ id: "runtime.win-x64.Microsoft.NETCore.App", version: "2.2.0", alias: "runtime.win-x64.Microsoft.NETCore.App.220" },
{ id: "runtime.win-x64.Microsoft.NETCore.DotNetHostResolver", version: "3.0.0-preview5-27626-15" },
{ 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: "3.0.0-preview5-27626-15" },
{ id: "runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy", version: "2.2.0", alias: "runtime.win-x64.Microsoft.NETCore.DotNetHostPolicy.220" },
// .NET Core osx-x64 runtime deps
{ id: "runtime.osx-x64.Microsoft.NETCore.DotNetAppHost", version: "3.0.0-preview5-27626-15" },
{ id: "runtime.osx-x64.Microsoft.NETCore.DotNetAppHost", version: "2.2.0", alias: "runtime.osx-x64.Microsoft.NETCore.DotNetAppHost.220" },
{ id: "runtime.osx-x64.Microsoft.NETCore.App", version: "3.0.0-preview5-27626-15" },
{ id: "runtime.osx-x64.Microsoft.NETCore.App", version: "2.2.0", alias: "runtime.osx-x64.Microsoft.NETCore.App.220" },
{ id: "runtime.osx-x64.Microsoft.NETCore.DotNetHostResolver", version: "3.0.0-preview5-27626-15" },
{ id: "runtime.osx-x64.Microsoft.NETCore.DotNetHostResolver", version: "2.2.0", alias: "runtime.osx-x64.Microsoft.NETCore.DotNetHostResolver.220" },
{ id: "runtime.osx-x64.Microsoft.NETCore.DotNetHostPolicy", version: "3.0.0-preview5-27626-15" },
{ id: "runtime.osx-x64.Microsoft.NETCore.DotNetHostPolicy", version: "2.2.0", alias: "runtime.osx-x64.Microsoft.NETCore.DotNetHostPolicy.220" },
// DotNetCore related deps
{ id: "Microsoft.CSharp", version: "4.3.0" },
{ id: "Microsoft.Win32.Primitives", version: "4.3.0" },
{ id: "Microsoft.Win32.Registry", version: "4.3.0" },
@ -338,6 +356,7 @@ config({
{ id: "System.Runtime.Serialization.Json", version: "4.3.0" },
{ id: "System.Runtime.Serialization.Primitives", version: "4.3.0" },
{ id: "System.Runtime.Serialization.Xml", version: "4.3.0" },
{ id: "System.Security.AccessControl", version: "4.5.0", dependentPackageIdsToSkip: ["System.Security.Principal.Windows"] },
{ id: "System.Security.Cryptography.Algorithms", version: "4.3.0" },
{ id: "System.Security.Cryptography.Cng", version: "4.3.0" },
{ id: "System.Security.Cryptography.Csp", version: "4.3.0" },
@ -345,12 +364,14 @@ config({
{ id: "System.Security.Cryptography.Primitives", version: "4.3.0" },
{ id: "System.Security.Cryptography.X509Certificates", version: "4.3.0" },
{ id: "System.Security.Principal", version: "4.3.0" },
{ id: "System.Security.Principal.Windows", version: "4.5.1" },
{ id: "System.Security.SecureString", version: "4.3.0" },
{ id: "System.Text.Encoding", version: "4.3.0" },
{ id: "System.Text.Encoding.CodePages", version: "4.3.0" },
{ id: "System.Text.Encoding.Extensions", version: "4.3.0" },
{ id: "System.Text.RegularExpressions", version: "4.3.0" },
{ id: "System.Threading", version: "4.3.0" },
{ id: "System.Threading.AccessControl", version: "4.5.0" },
{ id: "System.Threading.Overlapped", version: "4.3.0" },
{ id: "System.Threading.Tasks", version: "4.3.0" },
{ id: "System.Threading.Tasks.Extensions", version: "4.3.0" },
@ -463,20 +484,20 @@ config({
// DotNet Core Runtime
{
moduleName: "DotNet-Runtime.win-x64",
url: "https://download.visualstudio.microsoft.com/download/pr/b10d0a68-b720-48ae-bab8-4ac39bd1b5d3/f32b8b41dff5c1488c2b915a007fc4a6/dotnet-runtime-2.2.2-win-x64.zip",
hash: "VSO0:6BBAE77F9BA0231C90ABD9EA720FF886E8613CE8EF29D8B657AF201E2982829600",
url: "https://download.visualstudio.microsoft.com/download/pr/9459ede1-e223-40c7-a4c5-2409e789121a/46d4eb6067bda9f412a472f7286ffd94/dotnet-runtime-3.0.0-preview5-27626-15-win-x64.zip",
hash: "VSO0:6DBFE7BC9FA24D33A46A3A0732164BD5A4F5984E8FCE091D305FA635CD876AA700",
archiveType: "zip",
},
{
moduleName: "DotNet-Runtime.osx-x64",
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",
url: "https://download.visualstudio.microsoft.com/download/pr/85024962-5dee-4f64-ab29-a903f3749f85/6178bfacc58f4d9a596b5e3facc767ab/dotnet-runtime-3.0.0-preview5-27626-15-osx-x64.tar.gz",
hash: "VSO0:C6AB5808D30BFF857263BC467FE8D818F35486763F673F79CA5A758727CEF3A900",
archiveType: "tgz",
},
{
moduleName: "DotNet-Runtime.linux-x64",
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",
url: "https://download.visualstudio.microsoft.com/download/pr/f15ad9ab-7bd2-4ff5-87b6-b1a08f062ea2/6fdd314c16c17ba22934cd0ac6b4d343/dotnet-runtime-3.0.0-preview5-27626-15-linux-x64.tar.gz",
hash: "VSO0:C6AB5808D30BFF857263BC467FE8D818F35486763F673F79CA5A758727CEF3A900",
archiveType: "tgz",
},
@ -506,7 +527,7 @@ config({
qualifiers: {
defaultQualifier: {
configuration: "debug",
targetFramework: Context.getCurrentHost().os === "win" ? "net472" : "netcoreapp2.2",
targetFramework: Context.getCurrentHost().os === "win" ? "net472" : "netcoreapp3.0",
targetRuntime: Context.getCurrentHost().os === "win" ? "win-x64" : "osx-x64",
},
namedQualifiers: {
@ -522,12 +543,12 @@ config({
},
DebugDotNetCore: {
configuration: "debug",
targetFramework: "netcoreapp2.2",
targetFramework: "netcoreapp3.0",
targetRuntime: "win-x64",
},
DebugDotNetCoreMac: {
configuration: "debug",
targetFramework: "netcoreapp2.2",
targetFramework: "netcoreapp3.0",
targetRuntime: "osx-x64",
},
@ -545,12 +566,12 @@ config({
ReleaseDotNetCore: {
configuration: "release",
targetFramework: "netcoreapp2.2",
targetFramework: "netcoreapp3.0",
targetRuntime: "win-x64",
},
ReleaseDotNetCoreMac: {
configuration: "release",
targetFramework: "netcoreapp2.2",
targetFramework: "netcoreapp3.0",
targetRuntime: "osx-x64",
},
}

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

@ -48,7 +48,9 @@ export const pkgs = isMicrosoftInternal ? [
// Internal pacakged version to avoid downloading from the web but the trusted stable internal feed:
{ id: "NodeJs", version: "8.12.0-noTest" },
{ id: "PowerShell.Core", version: "6.1.0" },
{ id: "Dotnet-Runtime", version: "2.2.2.1" },
// Combined runtimes
{ id: "Dotnet-Runtime", version: "5.0.0" },
] : [