Merged PR 743386: Add support for Windows SDK 10.0.22621.755

Related work items: #2110809
This commit is contained in:
Pasindu Gunasekara 🍣 2023-10-04 20:58:54 +00:00
Родитель 8c82c2b0c3
Коммит 56b18c98d9
11 изменённых файлов: 63 добавлений и 61 удалений

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

@ -6,7 +6,6 @@ If you are a Microsoft internal developer, the Internal variant is automatically
# Prerequesites # Prerequesites
## Windows ## Windows
* Windows 10 is the minimum requirement for BuildXL. You do not need to install [Visual Studio](https://visualstudio.microsoft.com/vs/) to get a working build, but it can be very helpful and is recommended for Windows development. * Windows 10 is the minimum requirement for BuildXL. You do not need to install [Visual Studio](https://visualstudio.microsoft.com/vs/) to get a working build, but it can be very helpful and is recommended for Windows development.
* You will also need to install the Windows development kit. When you build the repo, the build script will determine if you have a compatible version installed and provide an error message with a link if one needs to be installed
* (For the Public build) [Visual Studio 2019 Build Tools](https://visualstudio.microsoft.com/vs/older-downloads/#visual-studio-2019-and-other-products) build tools must be installed. Scroll down to the "Build Tools for Visual Studio" section, download and run the installer. Within the Visual Studio installer under "Individual Components", search for and install "MSVC (v142) - VS 2019 C++ x64/x86 Spectre-mitigated libs (v14.28-16.8)". If you get an error about the build tools not being found after this installation, try setting the MSVC_VERSION environment variable to the exact version that was installed under "%Programfiles(x86)%\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC". See [visualCpp.dsc](../../Public/Sdk/Experimental/Msvc/VisualCpp/visualCpp.dsc) for more details about how this path is resolved * (For the Public build) [Visual Studio 2019 Build Tools](https://visualstudio.microsoft.com/vs/older-downloads/#visual-studio-2019-and-other-products) build tools must be installed. Scroll down to the "Build Tools for Visual Studio" section, download and run the installer. Within the Visual Studio installer under "Individual Components", search for and install "MSVC (v142) - VS 2019 C++ x64/x86 Spectre-mitigated libs (v14.28-16.8)". If you get an error about the build tools not being found after this installation, try setting the MSVC_VERSION environment variable to the exact version that was installed under "%Programfiles(x86)%\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC". See [visualCpp.dsc](../../Public/Sdk/Experimental/Msvc/VisualCpp/visualCpp.dsc) for more details about how this path is resolved
## Linux ## Linux

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

@ -1,14 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
import {Transformer} from "Sdk.Transformers";
// This is an empty facade for a Microsoft internal package.
namespace Contents {
export declare const qualifier: {
};
@@public
export const all: StaticDirectory = Transformer.sealPartialDirectory(d`.`, []);
}

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

@ -1,6 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
module({
name: "Windows.Sdk"
});

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

@ -6,17 +6,22 @@ import * as Managed from "Sdk.Managed";
export declare const qualifier: { platform: "x86" | "x64"}; export declare const qualifier: { platform: "x86" | "x64"};
const version = "10.0.16299.0"; // CODESYNC: This version should be updated together with the version number of the Windows SDK nuget packages in config.dsc
// NOTE: this version is not strictly the same as the version number for the package. The first three numbers should be the same,
// but the final number maybe different.
const version = "10.0.22621.0";
const isWin = Context.getCurrentHost().os === "win"; const isWin = Context.getCurrentHost().os === "win";
const sdk = isWin ? getHeadersAndLibs() : undefined; const sdkHeaders = importFrom("Microsoft.Windows.SDK.cpp").Contents.all;
const sdkLibsX86 = importFrom("Microsoft.Windows.SDK.CPP.x86").Contents.all;
const sdkLibsX64 = importFrom("Microsoft.Windows.SDK.CPP.x64").Contents.all;
namespace UM { namespace UM {
@@public @@public
export const include: StaticDirectory = Transformer.reSealPartialDirectory(sdk, r`include/${version}/um`, "win"); export const include: StaticDirectory = Transformer.reSealPartialDirectory(sdkHeaders, r`c/Include/${version}/um`, "win");
@@public @@public
export const lib: StaticDirectory = Transformer.reSealPartialDirectory(sdk, r`lib/${version}/um/${qualifier.platform}`, "win"); export const lib: StaticDirectory = Transformer.reSealPartialDirectory(getArchitectureSpecificLibraries(), r`c/um/${qualifier.platform}`, "win");
@@public @@public
export const standardLibs: File[] = [ export const standardLibs: File[] = [
@ -32,30 +37,28 @@ namespace UM {
namespace Shared { namespace Shared {
@@public @@public
export const include: StaticDirectory = Transformer.reSealPartialDirectory(sdk, r`include/${version}/shared`, "win"); export const include: StaticDirectory = Transformer.reSealPartialDirectory(sdkHeaders, r`c/Include/${version}/shared`, "win");
} }
namespace Ucrt { namespace Ucrt {
@@public @@public
export const include: StaticDirectory = Transformer.reSealPartialDirectory(sdk, r`include/${version}/ucrt`, "win"); export const include: StaticDirectory = Transformer.reSealPartialDirectory(sdkHeaders, r`c/Include/${version}/ucrt`, "win");
@@public @@public
export const lib: StaticDirectory = Transformer.reSealPartialDirectory(sdk, r`lib/${version}/ucrt/${qualifier.platform}`, "win"); export const lib: StaticDirectory = Transformer.reSealPartialDirectory(getArchitectureSpecificLibraries(), r`c/ucrt/${qualifier.platform}`, "win");
} }
function getArchitectureSpecificLibraries() : StaticDirectory {
function getHeadersAndLibs() : StaticDirectory { if (!isWin) {
if (Environment.getFlag("[Sdk.BuildXL]microsoftInternal")) { return undefined;
// Internally in Microsoft we use a nuget package that contains the windows Sdk.
return importFrom("Windows.Sdk").Contents.all;
} }
const installedSdkLocation = d`${Context.getMount("ProgramFilesX86").path}/Windows Kits/10`; switch (qualifier.platform) {
const windowsH = f`${installedSdkLocation}/Include/${version}/um/Windows.h`; case "x86":
if (!File.exists(windowsH)) return sdkLibsX86;
{ case "x64":
Contract.fail(`Could not find the installed windows Sdk headers for version ${version}. File '${windowsH.toDiagnosticString()}' does not exist. Please install version ${version} from https://developer.microsoft.com/en-us/windows/downloads/sdk-archive. You don't need the full Sdk just the following features: 'Windows SDK for Desktop C++ x86 Apps', 'Windows SDK for Desktop C++ amd64 Apps' and its dependencies.`); return sdkLibsX64;
default:
Contract.fail(`Unknown platform for Windows SDK ${qualifier.platform}`);
} }
}
return Transformer.sealPartialDirectory(installedSdkLocation, globR(installedSdkLocation, "*.*"));
};

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

@ -19,9 +19,9 @@
// This spectre mitigation has been applied to detours, however this warning will continue to show up with /Wall enabled // This spectre mitigation has been applied to detours, however this warning will continue to show up with /Wall enabled
#pragma warning( disable : 5045) #pragma warning( disable : 5045)
// BuildXL should run on Win7+. // BuildXL should run on Win10+.
#include <WinSDKVer.h> #include <WinSDKVer.h>
#define _WIN32_WINNT _WIN32_WINNT_WIN7 #define _WIN32_WINNT _WIN32_WINNT_WIN10
#include <SDKDDKVer.h> #include <SDKDDKVer.h>
// In order to compile with /Wall (mega pedantic warnings), we need to turn off a few that the Windows SDK violates. // In order to compile with /Wall (mega pedantic warnings), we need to turn off a few that the Windows SDK violates.

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

@ -4,9 +4,9 @@
#pragma once #pragma once
#if !defined(MAC_OS_SANDBOX) && !defined(MAC_OS_LIBRARY) #if !defined(MAC_OS_SANDBOX) && !defined(MAC_OS_LIBRARY)
// BuildXL should run on Win7+. // BuildXL should run on Win10+.
#include <WinSDKVer.h> #include <WinSDKVer.h>
#define _WIN32_WINNT _WIN32_WINNT_WIN7 #define _WIN32_WINNT _WIN32_WINNT_WIN10
#include <SDKDDKVer.h> #include <SDKDDKVer.h>
#endif // !defined(MAC_OS) #endif // !defined(MAC_OS)

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

@ -228,7 +228,7 @@ NTSTATUS OpenFileWithNtCreateFile(
InitializeObjectAttributes(&objAttribs, &unicodeString, OBJ_CASE_INSENSITIVE, rootDirectory, NULL); InitializeObjectAttributes(&objAttribs, &unicodeString, OBJ_CASE_INSENSITIVE, rootDirectory, NULL);
const int allocSize = 2048; const int allocSize = 2048;
LARGE_INTEGER largeInteger = { 0 }; LARGE_INTEGER largeInteger = { { 0 } };
largeInteger.QuadPart = allocSize; largeInteger.QuadPart = allocSize;
IO_STATUS_BLOCK ioStatusBlock = { 0 }; IO_STATUS_BLOCK ioStatusBlock = { 0 };

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

@ -19,9 +19,9 @@
// This spectre mitigation has been applied to detours, however this warning will continue to show up with /Wall enabled // This spectre mitigation has been applied to detours, however this warning will continue to show up with /Wall enabled
#pragma warning( disable : 5045) #pragma warning( disable : 5045)
// BuildXL should run on Win7+. // BuildXL should run on Win10+.
#include <WinSDKVer.h> #include <WinSDKVer.h>
#define _WIN32_WINNT _WIN32_WINNT_WIN7 #define _WIN32_WINNT _WIN32_WINNT_WIN10
#include <SDKDDKVer.h> #include <SDKDDKVer.h>
// In order to compile with /Wall (mega pedantic warnings), we need to turn off a few that the Windows SDK violates. // In order to compile with /Wall (mega pedantic warnings), we need to turn off a few that the Windows SDK violates.

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

@ -2449,6 +2449,33 @@
} }
} }
}, },
{
"Component": {
"Type": "NuGet",
"NuGet": {
"Name": "Microsoft.Windows.SDK.CPP.x64",
"Version": "10.0.22621.755"
}
}
},
{
"Component": {
"Type": "NuGet",
"NuGet": {
"Name": "Microsoft.Windows.SDK.CPP.x86",
"Version": "10.0.22621.755"
}
}
},
{
"Component": {
"Type": "NuGet",
"NuGet": {
"Name": "Microsoft.Windows.SDK.cpp",
"Version": "10.0.22621.755"
}
}
},
{ {
"Component": { "Component": {
"Type": "NuGet", "Type": "NuGet",
@ -4267,15 +4294,6 @@
} }
} }
}, },
{
"Component": {
"Type": "NuGet",
"NuGet": {
"Name": "WindowsSdk.Corext",
"Version": "10.0.16299.1"
}
}
},
{ {
"Component": { "Component": {
"Type": "NuGet", "Type": "NuGet",

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

@ -393,6 +393,12 @@ config({
// Windows CoW on ReFS // Windows CoW on ReFS
{ id: "CopyOnWrite", version: "0.3.6" }, { id: "CopyOnWrite", version: "0.3.6" },
// Windows SDK
// CODESYNC: This version should be updated together with the version number in Public/Sdk/Experimental/Msvc/WindowsSdk/windowsSdk.dsc
{ id: "Microsoft.Windows.SDK.cpp", version: "10.0.22621.755", osSkip: [ "macOS", "unix" ] },
{ id: "Microsoft.Windows.SDK.CPP.x86", version: "10.0.22621.755", osSkip: [ "macOS", "unix" ] },
{ id: "Microsoft.Windows.SDK.CPP.x64", version: "10.0.22621.755", osSkip: [ "macOS", "unix" ] },
], ],
doNotEnforceDependencyVersions: true, doNotEnforceDependencyVersions: true,

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

@ -34,9 +34,6 @@ export const pkgs = isMicrosoftInternal ? [
{ id: "BuildXL.Tracing.AriaTenantToken", version: "1.0.0" }, { id: "BuildXL.Tracing.AriaTenantToken", version: "1.0.0" },
// Windows Sdk so microsoft dev's don't have to install it.
{ id: "WindowsSdk.Corext", version: "10.0.16299.1", alias: "Windows.Sdk", osSkip: [ "macOS", "unix" ] },
// Artifact packages and dependencies // Artifact packages and dependencies
{ id: "Microsoft.VisualStudio.Services.ArtifactServices.Shared", version: artifactNugetVersion, dependentPackageIdsToSkip: ["*"], dependentPackageIdsToIgnore: [ { id: "Microsoft.VisualStudio.Services.ArtifactServices.Shared", version: artifactNugetVersion, dependentPackageIdsToSkip: ["*"], dependentPackageIdsToIgnore: [
"Microsoft.BuildXL.Cache.Hashing", "Microsoft.BuildXL.Cache.Hashing",
@ -121,7 +118,6 @@ export const resolver = {
f`Private/InternalSdk/BuildXL.DeviceMap/module.config.dsc`, f`Private/InternalSdk/BuildXL.DeviceMap/module.config.dsc`,
f`Private/InternalSdk/CB.QTest/module.config.dsc`, f`Private/InternalSdk/CB.QTest/module.config.dsc`,
...addIf(isMicrosoftInternal, ...addIf(isMicrosoftInternal,
f`Private/InternalSdk/Windows.Sdk/module.config.dsc`,
f`Private/InternalSdk/InstrumentationFramework/module.config.dsc` f`Private/InternalSdk/InstrumentationFramework/module.config.dsc`
), ),