diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..040609f55 --- /dev/null +++ b/.clang-format @@ -0,0 +1,150 @@ +--- +# this file work is a derivative of onecoreuap/net/.clang-format +# https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md +# +Language: Cpp +# BasedOnStyle: LLVM +AccessModifierOffset: -4 +AlignAfterOpenBracket: AlwaysBreak +AlignConsecutiveAssignments: false +AlignEscapedNewlines: DontAlign +AlignOperands: true +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakTemplateDeclarations: true +BinPackArguments: false +BinPackParameters: false +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Custom +BraceWrapping: + AfterCaseLabel: true + AfterClass: true + AfterControlStatement: true + AfterEnum: true + AfterFunction: true + AfterNamespace: false + AfterStruct: true + AfterUnion: true + AfterExternBlock: false + BeforeCatch: true + BeforeElse: true + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: AfterColon +ColumnLimit: 130 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: true +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] +IncludeBlocks: Regroup +IncludeCategories: + - Regex: '^"(stdafx.h|pch.h|precomp.h)"$' + Priority: -1 +IndentCaseLabels: false +InsertBraces: true +IndentWidth: 4 +IndentWrappedFunctionNames: false +KeepEmptyLinesAtTheStartOfBlocks: true +MacroBlockBegin: '^BEGIN_COM_MAP$|^BEGIN_CONNECTION_POINT_MAP$|^BEGIN_HELPER_NODEMAP$|^BEGIN_MODULE$|^BEGIN_MSG_MAP$|^BEGIN_OBJECT_MAP$|^BEGIN_TEST_CLASS$|^BEGIN_TEST_METHOD$|^BEGIN_TEST_METHOD_PROPERTIES$' +MacroBlockEnd: '^END_COM_MAP$|^END_CONNECTION_POINT_MAP$|^END_HELPER_NODEMAP$|^END_MODULE$|^END_MSG_MAP$|^END_OBJECT_MAP$|^END_TEST_CLASS$|^END_TEST_METHOD$|^END_TEST_METHOD_PROPERTIES$' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: Inner +ObjCBlockIndentWidth: 2 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyExcessCharacter: 1 +PenaltyReturnTypeOnItsOwnLine: 1000 +PointerAlignment: Left +SortIncludes: false +SpaceAfterCStyleCast: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Cpp11 +StatementMacros: [ + _Acquires_exclusive_lock_, + _Acquires_lock_, + _Acquires_nonreentrant_lock_, + _Acquires_shared_lock_, + _Analysis_assume_smart_lock_acquired_, + _Analysis_assume_smart_lock_released_, + _Create_lock_level_, + _Detaches_lock_, + _Function_class_, + _Global_cancel_spin_lock_, + _Global_critical_region_, + _Global_interlock_, + _Global_priority_region_, + _Has_lock_kind_, + _Has_lock_level_, + _IRQL_always_function_max_, + _IRQL_always_function_min_, + _IRQL_raises_, + _IRQL_requires_, + _IRQL_requires_max_, + _IRQL_requires_min_, + _IRQL_requires_same_, + _IRQL_restores_, + _IRQL_restores_global_, + _IRQL_saves_, + _IRQL_saves_global_, + _Lock_level_order_, + _Moves_lock_, + _Must_inspect_result_, + _No_competing_thread_, + _Post_same_lock_, + _Post_writable_byte_size_, + _Pre_satisfies_, + _Releases_exclusive_lock_, + _Releases_lock_, + _Releases_nonreentrant_lock_, + _Releases_shared_lock_, + _Replaces_lock_, + _Requires_exclusive_lock_held_, + _Requires_lock_held_, + _Requires_lock_not_held_, + _Requires_no_locks_held_, + _Requires_shared_lock_held_, + _Ret_maybenull_, + _Ret_range_, + _Success_, + _Swaps_locks_, + _Use_decl_annotations_, + _When_, + RpcEndExcept, +] +TabWidth: 4 +TypenameMacros: [ + IFACEMETHOD, + STDMETHOD, +] +UseTab: Never +... + diff --git a/.config/configuration.vsEnterprise.winget b/.config/configuration.vsEnterprise.winget new file mode 100644 index 000000000..f81df2d5b --- /dev/null +++ b/.config/configuration.vsEnterprise.winget @@ -0,0 +1,45 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 +# Reference: https://github.com/microsoft/WSL/blob/master/doc/docs/dev-loop.md +# +# Usage: winget configure -f .config/configuration.vsEnterprise.winget +# +# Visual Studio 2022 Enterprise edition. For other editions use: +# .config/configuration.winget (Community, default) +# .config/configuration.vsProfessional.winget (Professional) +properties: + resources: + - resource: Microsoft.Windows.Settings/WindowsSettings + directives: + description: Enable Developer Mode (required for symbolic link support) + allowPrerelease: true + securityContext: elevated + settings: + DeveloperMode: true + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: cmake + directives: + description: Install CMake + securityContext: elevated + settings: + id: Kitware.CMake + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: vsPackage + directives: + description: Install Visual Studio 2022 Enterprise + securityContext: elevated + settings: + id: Microsoft.VisualStudio.2022.Enterprise + source: winget + - resource: Microsoft.VisualStudio.DSC/VSComponents + dependsOn: + - vsPackage + directives: + description: Install required VS workloads from .vsconfig + allowPrerelease: true + securityContext: elevated + settings: + productId: Microsoft.VisualStudio.Product.Enterprise + channelId: VisualStudio.17.Release + vsConfigFile: '${WinGetConfigRoot}\..\.vsconfig' + configurationVersion: 0.2.0 diff --git a/.config/configuration.vsProfessional.winget b/.config/configuration.vsProfessional.winget new file mode 100644 index 000000000..d9c700b4c --- /dev/null +++ b/.config/configuration.vsProfessional.winget @@ -0,0 +1,45 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 +# Reference: https://github.com/microsoft/WSL/blob/master/doc/docs/dev-loop.md +# +# Usage: winget configure -f .config/configuration.vsProfessional.winget +# +# Visual Studio 2022 Professional edition. For other editions use: +# .config/configuration.winget (Community, default) +# .config/configuration.vsEnterprise.winget (Enterprise) +properties: + resources: + - resource: Microsoft.Windows.Settings/WindowsSettings + directives: + description: Enable Developer Mode (required for symbolic link support) + allowPrerelease: true + securityContext: elevated + settings: + DeveloperMode: true + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: cmake + directives: + description: Install CMake + securityContext: elevated + settings: + id: Kitware.CMake + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: vsPackage + directives: + description: Install Visual Studio 2022 Professional + securityContext: elevated + settings: + id: Microsoft.VisualStudio.2022.Professional + source: winget + - resource: Microsoft.VisualStudio.DSC/VSComponents + dependsOn: + - vsPackage + directives: + description: Install required VS workloads from .vsconfig + allowPrerelease: true + securityContext: elevated + settings: + productId: Microsoft.VisualStudio.Product.Professional + channelId: VisualStudio.17.Release + vsConfigFile: '${WinGetConfigRoot}\..\.vsconfig' + configurationVersion: 0.2.0 diff --git a/.config/configuration.winget b/.config/configuration.winget new file mode 100644 index 000000000..25d1ef1d9 --- /dev/null +++ b/.config/configuration.winget @@ -0,0 +1,45 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 +# Reference: https://github.com/microsoft/WSL/blob/master/doc/docs/dev-loop.md +# +# Usage: winget configure -f .config/configuration.winget +# +# This is the default configuration (VS Community). For other editions use: +# .config/configuration.vsProfessional.winget +# .config/configuration.vsEnterprise.winget +properties: + resources: + - resource: Microsoft.Windows.Settings/WindowsSettings + directives: + description: Enable Developer Mode (required for symbolic link support) + allowPrerelease: true + securityContext: elevated + settings: + DeveloperMode: true + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: cmake + directives: + description: Install CMake + securityContext: elevated + settings: + id: Kitware.CMake + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: vsPackage + directives: + description: Install Visual Studio 2022 Community + securityContext: elevated + settings: + id: Microsoft.VisualStudio.2022.Community + source: winget + - resource: Microsoft.VisualStudio.DSC/VSComponents + dependsOn: + - vsPackage + directives: + description: Install required VS workloads from .vsconfig + allowPrerelease: true + securityContext: elevated + settings: + productId: Microsoft.VisualStudio.Product.Community + channelId: VisualStudio.17.Release + vsConfigFile: '${WinGetConfigRoot}\..\.vsconfig' + configurationVersion: 0.2.0 diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..6efaa68af --- /dev/null +++ b/.editorconfig @@ -0,0 +1,43 @@ +# EditorConfig — https://editorconfig.org +# Complements .clang-format for non-C++ files + +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.{cpp,h,hpp,c,idl}] +# C/C++ formatting is handled by .clang-format +indent_size = 4 + +[*.{yml,yaml}] +indent_size = 2 + +[*.{json,jsonc}] +indent_size = 2 + +[*.{md,markdown}] +trim_trailing_whitespace = false + +[*.py] +indent_size = 4 + +[*.{ps1,psm1,psd1}] +indent_size = 4 + +[*.{xml,resw,resx,props,targets,nuspec}] +indent_size = 2 + +[*.cmake] +indent_size = 4 + +[CMakeLists.txt] +indent_size = 4 + +[Makefile] +indent_style = tab diff --git a/.gdnsuppress b/.gdnsuppress new file mode 100644 index 000000000..00368c8e5 --- /dev/null +++ b/.gdnsuppress @@ -0,0 +1,326 @@ +{ + "hydrated": false, + "properties": { + "helpUri": "https://eng.ms/docs/microsoft-security/security/azure-security/cloudai-security-fundamentals-engineering/security-integration/guardian-wiki/microsoft-guardian/general/suppressions" + }, + "version": "1.0.0", + "suppressionSets": { + "default": { + "name": "default", + "createdDate": "2025-04-30 22:17:21Z", + "lastUpdatedDate": "2025-04-30 22:17:21Z" + } + }, + "results": { + "3d7d59d41a06e01093616033ddd4ecec1e8dcb65363768638eea6acb6d012b4e": { + "signature": "3d7d59d41a06e01093616033ddd4ecec1e8dcb65363768638eea6acb6d012b4e", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "aa145b1818ed203013a6267ca382110ec5ea9c1bf50a812964d4c7b5671224ec": { + "signature": "aa145b1818ed203013a6267ca382110ec5ea9c1bf50a812964d4c7b5671224ec", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "c5f15f6ef4ac3f1e82c31ae0f651ab0f1c8448e34824bf231dd2104cef70d9e5": { + "signature": "c5f15f6ef4ac3f1e82c31ae0f651ab0f1c8448e34824bf231dd2104cef70d9e5", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "e8eb99fd7876f9c79c0ff194de9e21cc77d63573a9b73ba1666778a247dcebff": { + "signature": "e8eb99fd7876f9c79c0ff194de9e21cc77d63573a9b73ba1666778a247dcebff", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "43df748a685bc9feca8cf04c518f57a82012d61665dca65d8a1fb652a55d9391": { + "signature": "43df748a685bc9feca8cf04c518f57a82012d61665dca65d8a1fb652a55d9391", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "fc58019c679cf3c469af5161b1f237f7552ee81c3d3ae29aff2d18fcceafe3e7": { + "signature": "fc58019c679cf3c469af5161b1f237f7552ee81c3d3ae29aff2d18fcceafe3e7", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "bedcd464fd4426dbd786cb09b7407100aa548dfff85d3c89e7fd79c8c2623391": { + "signature": "bedcd464fd4426dbd786cb09b7407100aa548dfff85d3c89e7fd79c8c2623391", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "06d5d116da395c14acda7a67c6530e675cc6d59593a94f37fbc2b91ce05380ca": { + "signature": "06d5d116da395c14acda7a67c6530e675cc6d59593a94f37fbc2b91ce05380ca", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "a93af66a96249e7041eee45e325c2548da917d4c6984e7cf67fa0c052a01a980": { + "signature": "a93af66a96249e7041eee45e325c2548da917d4c6984e7cf67fa0c052a01a980", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "2950fa4920cef845442e43dccfbdd49ca5935a1f0aa115c3b25bf5397d39bac7": { + "signature": "2950fa4920cef845442e43dccfbdd49ca5935a1f0aa115c3b25bf5397d39bac7", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "d747605a4cb9b5cbe7715f638b3909572302db204327120c50f712064c405380": { + "signature": "d747605a4cb9b5cbe7715f638b3909572302db204327120c50f712064c405380", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "be9c9eacd39f7740ac8794956f9133718e7bac4556a7a29ebdbcae5a1c762faf": { + "signature": "be9c9eacd39f7740ac8794956f9133718e7bac4556a7a29ebdbcae5a1c762faf", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "1af653b6acce89da21e37933f80d0686bf8a01aab386620533b42e06b55a3f26": { + "signature": "1af653b6acce89da21e37933f80d0686bf8a01aab386620533b42e06b55a3f26", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "5ba96332382fbe9cfb5c6baf51b5bd6e2644f1aa86c3fad66562dd648458f431": { + "signature": "5ba96332382fbe9cfb5c6baf51b5bd6e2644f1aa86c3fad66562dd648458f431", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "29432097a113f870ee7f86e585601fa1a6013f50b65893a359391ef47f996c73": { + "signature": "29432097a113f870ee7f86e585601fa1a6013f50b65893a359391ef47f996c73", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "352c2da0bfcde6f9f60c43359e7263b07247d26bff0343a369c8e3667c37fbe1": { + "signature": "352c2da0bfcde6f9f60c43359e7263b07247d26bff0343a369c8e3667c37fbe1", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "64bf4920e1b5b21e7312594ca9d95e3b48ac05a9cef507b21d91ba588a0ab08e": { + "signature": "64bf4920e1b5b21e7312594ca9d95e3b48ac05a9cef507b21d91ba588a0ab08e", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "720d1478e66c5f46670729c232d5afb787cdcc007f53e67d31edd4457e60967c": { + "signature": "720d1478e66c5f46670729c232d5afb787cdcc007f53e67d31edd4457e60967c", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "cf0a86680efb56a7eb351df85c51c6ad2e1ae64f108b8729ab7a9dd148d8312b": { + "signature": "cf0a86680efb56a7eb351df85c51c6ad2e1ae64f108b8729ab7a9dd148d8312b", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "3cedf840f8bdf45d29de68eedf06e3548fbdf86ebe3929c38b1be7babd790142": { + "signature": "3cedf840f8bdf45d29de68eedf06e3548fbdf86ebe3929c38b1be7babd790142", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "2e746764a2b4ee4971e2afded4c2dd99c5bf7647a5c8d9ae027d901caf7c5982": { + "signature": "2e746764a2b4ee4971e2afded4c2dd99c5bf7647a5c8d9ae027d901caf7c5982", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "04e31f322d76e5b2d92d36987ae5453b9d7b4eb1aba2e59f9956e088756eb3d3": { + "signature": "04e31f322d76e5b2d92d36987ae5453b9d7b4eb1aba2e59f9956e088756eb3d3", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "df6145ffc4e1301e28b405ec934470ab2346ac60ef1b5a806a470f6a86907141": { + "signature": "df6145ffc4e1301e28b405ec934470ab2346ac60ef1b5a806a470f6a86907141", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "53daee355a750916f6516911381cd31bfbb8de644cb0158a7bfb6456ffab163c": { + "signature": "53daee355a750916f6516911381cd31bfbb8de644cb0158a7bfb6456ffab163c", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "cf5679eb50b6062e91bab7a9a53aa2c356a41289192081f733e42c6def3abc96": { + "signature": "cf5679eb50b6062e91bab7a9a53aa2c356a41289192081f733e42c6def3abc96", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "9dac4ccae735c85dd3974f876f336accefa2f90f3cea74801bf4b148926bd132": { + "signature": "9dac4ccae735c85dd3974f876f336accefa2f90f3cea74801bf4b148926bd132", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "d05aa96a810d8140a0c2269e8d5e64b8b6db02652da6842547e1e1c4139096b5": { + "signature": "d05aa96a810d8140a0c2269e8d5e64b8b6db02652da6842547e1e1c4139096b5", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "cd0ad7bf2ffe4b3d068dc6c9731aa1d8f001250f30ebd3667a8982f03e72c879": { + "signature": "cd0ad7bf2ffe4b3d068dc6c9731aa1d8f001250f30ebd3667a8982f03e72c879", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "8415dbbf5b26dadc3e7d7f09b496a7f53452c60b67019bbb92c48dd1cd0f703a": { + "signature": "8415dbbf5b26dadc3e7d7f09b496a7f53452c60b67019bbb92c48dd1cd0f703a", + "alternativeSignatures": [ + "88c2fa648d6200a3832a1a4b6d568c43a9dd89e05e4032c4286450c4d3a9171d" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "20edc36496c8274a97fe9179b56fcc1b5aab4b7e0d6769c23e14181844f64f35": { + "signature": "20edc36496c8274a97fe9179b56fcc1b5aab4b7e0d6769c23e14181844f64f35", + "alternativeSignatures": [ + "14b018ac237bbbfe6304e73f454e190a2c60d335f249db0a9af6500eeae4808f" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + }, + "2652e38833372ca84eeebf1e9cd6145d4556e3851f7e698f95b5f01574cef372": { + "signature": "2652e38833372ca84eeebf1e9cd6145d4556e3851f7e698f95b5f01574cef372", + "alternativeSignatures": [ + "d705445d04087b944ab3e7777bce5c61a4efc64fc7be2953cf7ed8573321a87b" + ], + "memberOf": [ + "default" + ], + "createdDate": "2025-04-30 22:17:21Z" + } + } +} \ No newline at end of file diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..825f2afab --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,5 @@ +# File containing policy for file ownership + +# Reviewers for all files in the repository +* @microsoft/wsl-maintainers +* @microsoft/wslc-team \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/Bug_Report.yaml b/.github/ISSUE_TEMPLATE/Bug_Report.yaml new file mode 100644 index 000000000..f22b7a623 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Bug_Report.yaml @@ -0,0 +1,103 @@ +--- +name: "WSL - Bug Report" +description: Report a bug on Windows Subsystem for Linux +body: +- type: markdown + attributes: + value: | + Please [search for existing issues](https://github.com/microsoft/WSL/issues) before creating a new one. + If you'd like to create a new bug report, please [read the guidance here](https://github.com/Microsoft/WSL/blob/master/CONTRIBUTING.md) before getting started. This will save you time. + +- type: input + attributes: + label: Windows Version + description: | + Please run `cmd.exe /c ver` to get the build of Windows you are on. + placeholder: "Microsoft Windows [Version 10.0.19042.867]" + validations: + required: true + +- type: input + attributes: + label: WSL Version + description: | + If you are running Windows Subsystem for Linux from the Microsoft Store, please run `wsl.exe --version`. + Else `0.0.0.0` + placeholder: "0.0.0.0" + validations: + required: true + +- type: checkboxes + attributes: + label: Are you using WSL 1 or WSL 2? + description: | + Tell us whether the issue is on WSL 2 and/or WSL 1. You can tell by running `wsl -l -v`. + options: + - label: "WSL 2" + - label: "WSL 1" + +- type: input + attributes: + label: Kernel Version + description: | + Please tell us what version of the Linux kernel you are using, or if you are using a custom kernel. + You can run `wsl.exe --status` if that command is available to you, or by running `cat /proc/version` in your distro. + placeholder: "5.4.72" + validations: + required: false + +- type: input + attributes: + label: Distro Version + description: | + Please tell us what distro you are using (if applicable). + You can get additional information about the version where possible, e.g. on Debian / Ubuntu, run `lsb_release -r` + placeholder: "Ubuntu 16.04" + validations: + required: false + +- type: textarea + attributes: + label: Other Software + description: If you're reporting a bug involving WSL's interaction with other applications, please tell us. What applications? What versions? + placeholder: | + Docker Desktop (Windows), version 3.2.2 + traceroute, Version: 1:2.0.21-1 + Visual Studio Code 1.54.3 with Remote-WSL Extension 0.54.6 + MyCustomApplication + validations: + required: false + +- type: textarea + attributes: + label: Repro Steps + description: Please list out the steps to reproduce your bug. + placeholder: Your steps go here. Include relevant environmental variables or any other configuration. + validations: + required: true + +- type: textarea + attributes: + label: Expected Behavior + description: What were you expecting to see? Include any relevant examples or documentation links. + placeholder: If you want to include screenshots, paste them into the text area or follow up with a separate comment. + validations: + required: true + +- type: textarea + attributes: + label: Actual Behavior + description: What happened instead? + placeholder: Include the terminal output, straces of the failing command, etc. as necessary. + validations: + required: true + +- type: textarea + attributes: + label: Diagnostic Logs + description: | + Please provide additional diagnostics if needed. + See the [guidance](https://github.com/Microsoft/WSL/blob/master/CONTRIBUTING.md) for info on how to gather Feedback Hub logs, networking logs, and more. + placeholder: Your links to logs or other information go here. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 9d261388e..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -name: Bug report -about: Report a bug on Windows Subsystem for Linux -title: '' -labels: '' -assignees: '' - ---- - - - - -# Environment - -```none -Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd] -Your Distribution version: [On Debian or Ubuntu run `lsb_release -r` in WSL] -Whether the issue is on WSL 2 and/or WSL 1: [run `cat /proc/version` in WSL] -``` - -# Steps to reproduce - - - - - - -**WSL logs**: - -# Expected behavior - - - -# Actual behavior - - - - - diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index fce148a56..9e9c60e84 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,6 +1,6 @@ --- -name: Feature request -about: Suggest a feature for Windows Subsystem for Linux +name: Feature request / Contribution idea +about: Suggest a feature or improvement for the Windows Subsystem for Linux title: '' labels: 'feature' assignees: '' diff --git a/.github/actions/triage/action.yml b/.github/actions/triage/action.yml new file mode 100644 index 000000000..054678952 --- /dev/null +++ b/.github/actions/triage/action.yml @@ -0,0 +1,46 @@ +name: Run automated triage + + +inputs: + issue: + required: false + type: string + comment: + required: false + type: string + token: + required: false + type: string + previous_body: + required: false + type: string + +runs: + using: "composite" + steps: + - name: 'Run WTI' + shell: pwsh + env: + INPUT_COMMENT: "${{ inputs.comment }}" + INPUT_ISSUE: "${{ inputs.issue }}" + INPUT_TOKEN: "${{ inputs.token }}" + previous_body: "${{ inputs.previous_body }}" + run: | + $ErrorActionPreference = [System.Management.Automation.ActionPreference]::Stop + + $maybe_comment = @() + if (![string]::IsNullOrEmpty($env:INPUT_COMMENT)) + { + $maybe_comment = @("--comment", $env:INPUT_COMMENT) + } + + $maybe_previous_body = @() + if (![string]::IsNullOrEmpty("$env:previous_body")) + { + $env:previous_body | Out-File -Encoding utf8 "triage\previous_body.txt" + $maybe_previous_body = @("--previous-issue-body", "previous_body.txt") + } + + curl.exe -L https://github.com/OneBlue/wti/releases/download/v0.2/wti.exe -o triage/wti.exe + + cd triage && .\wti.exe --issue $env:INPUT_ISSUE --config config.yml --github-token $env:INPUT_TOKEN --ignore-tags @maybe_comment @maybe_previous_body \ No newline at end of file diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 000000000..bb16d6e62 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,395 @@ +# Windows Subsystem for Linux (WSL) + +**ALWAYS reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.** + +WSL is the Windows Subsystem for Linux - a compatibility layer for running Linux binary executables natively on Windows. This repository contains the core Windows components that enable WSL functionality. + +## Coding Conventions + +### Naming + +- **Classes/Structs**: `PascalCase` (e.g., `ConsoleProgressBar`, `DeviceHostProxy`) +- **Functions/Methods**: `PascalCase()` (e.g., `GetFamilyName()`, `MultiByteToWide()`) +- **Member variables**: `m_camelCase` (e.g., `m_isOutputConsole`, `m_outputHandle`) +- **Local variables**: `camelCase` (e.g., `distroGuidString`, `asyncResponse`) +- **Constants**: `c_camelCase` with `constexpr` (e.g., `constexpr size_t c_progressBarWidth = 58;`) +- **Namespaces**: lowercase with `::` nesting (e.g., `wsl::windows::common::registry`) +- **Enums**: `PascalCaseValue` (e.g., `LxssDistributionStateInstalled`) +- **Windows types**: Keep as-is (`LPCWSTR`, `HRESULT`, `DWORD`, `ULONG`, `GUID`) + +### Error Handling + +Use WIL (Windows Implementation Libraries) macros — **never** bare `if (FAILED(hr))`: +- `THROW_IF_FAILED(hr)` — throw on HRESULT failure +- `THROW_HR_IF(hr, condition)` — conditional throw +- `THROW_HR_IF_MSG(hr, condition, fmt, ...)` — conditional throw with message +- `THROW_IF_NULL_ALLOC(ptr)` — throw on null allocation +- `THROW_LAST_ERROR_IF(condition)` — throw last Win32 error +- `RETURN_IF_FAILED(hr)` — return HRESULT on failure (no throw) +- `RETURN_LAST_ERROR_IF_EXPECTED(condition)` — expected failure path +- `LOG_IF_FAILED(hr)` — log but don't throw +- `CATCH_LOG()` — catch and log exceptions + +For user-facing errors, set a localized message before throwing: +```cpp +THROW_HR_WITH_USER_ERROR(E_INVALIDARG, Localization::MessageConfigInvalidBoolean(name, value)); +``` + +At API boundaries (COM interfaces), return `HRESULT` with out params. Internal code throws exceptions. + +### Memory Management and RAII + +Use WIL smart pointers — **never** raw `CloseHandle()` or manual cleanup: +- `wil::unique_handle` — kernel handles +- `wil::com_ptr` — COM objects +- `wil::unique_hfile` — file handles +- `wil::unique_hkey` — registry keys +- `wil::unique_event` — events +- `wil::unique_hlocal_string` — HLOCAL strings +- `wil::unique_cotaskmem_string` — CoTaskMem strings + +For non-standard resource types, use `wil::unique_any`. + +For cleanup scopes, use `wil::scope_exit`: +```cpp +auto cleanup = wil::scope_exit([&] { registry::DeleteKey(LxssKey, guid.c_str()); }); +// ... work ... +cleanup.release(); // dismiss on success +``` + +### Synchronization + +Use `wil::srwlock` (Slim Reader/Writer locks) with SAL annotations: +```cpp +mutable wil::srwlock m_lock; +_Guarded_by_(m_lock) std::vector m_entries; +``` + +### Strings + +- `std::wstring` / `std::wstring_view` are dominant throughout the codebase +- Use `MultiByteToWide()` / `WideToMultiByte()` from `stringshared.h` for conversions +- Use `std::format()` for formatting (the repo defines `std::formatter` for wide-to-narrow support) +- The `STRING_TO_WIDE_STRING()` macro handles compile-time conversion + +### Copy/Move Semantics + +Use macros from `defs.h` to declare copy/move behavior: +```cpp +NON_COPYABLE(MyClass); +NON_MOVABLE(MyClass); +DEFAULT_MOVABLE(MyClass); +``` + +### Headers + +- Use `#pragma once` (no traditional `#ifndef` include guards) +- In Windows C++ components, every `.cpp` file must start with `#include "precomp.h"` +- Linux-side code (`src/linux/`) does not use precompiled headers +- Use `.h` for C-compatible headers, `.hpp` for C++-only headers +- Include order is enforced by `.clang-format` (precomp first, then system, then project) + +### Copyright Headers + +Use this single-line format for new files: +```cpp +// Copyright (C) Microsoft Corporation. All rights reserved. +``` + +Some older files use the block format (`/*++ Copyright (c) Microsoft. All rights reserved. ... --*/`). Match the surrounding files in the same directory when editing. + +### Localization + +- Use `wsl::shared::Localization::MessageXxx()` static methods for user-facing strings +- Use `EMIT_USER_WARNING(Localization::MessageXxx(...))` for non-fatal config warnings +- All new user-facing strings must have entries in `localization/strings/en-US/Resources.resw` +- In Resources.resw comments, use `{Locked="..."}` to prevent translation of `.wslconfig` property key names + +### Telemetry and Logging + +- `WSL_LOG(Name, ...)` — standard trace event +- `WSL_LOG_DEBUG(Name, ...)` — debug-only (compiled out in release via `if constexpr`) +- `WSL_LOG_TELEMETRY(Name, Tag, ...)` — metrics with privacy tag and version info +- Provider: `g_hTraceLoggingProvider`, initialized via `WslTraceLoggingInitialize()` + +### Platform Conditionals + +Prefer `constexpr` checks over `#ifdef` where possible: +```cpp +if constexpr (wsl::shared::Debug) { /* debug-only code */ } +if constexpr (wsl::shared::Arm64) { /* ARM64-specific code */ } +``` + +For compiler-specific code, use `#ifdef _MSC_VER` (Windows) / `#ifdef __GNUC__` (Linux). + +### Formatting + +Enforced by `.clang-format`: +- 130 character column limit +- 4-space indentation, no tabs +- Allman-style braces (opening brace on new line for classes, functions, structs, control statements) +- Left-aligned pointers (`int* ptr`, not `int *ptr`) +- `InsertBraces: true` — all control statements must have braces + +### IDL / COM Conventions + +When modifying service interfaces (`src/windows/service/inc/`): +- Interface attributes on separate lines: `[uuid(...), pointer_default(unique), object]` +- String params: `[in, unique] LPCWSTR` with `[string]` for marshaled strings +- Handle params: `[in, system_handle(sh_file)] HANDLE` +- User-facing errors: pass `[in, out] LXSS_ERROR_INFO* Error` +- **Adding methods to an existing interface is an ABI break** — create a new versioned interface with a new IID +- Custom error codes: `WSL_E_xxx` via `MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, WSL_E_BASE + N)` + +### Config File (.wslconfig) Conventions + +When adding settings to `src/shared/configfile/`: +- Format is `.gitconfig`-style INI: `[section]`, `key = value`, `#` comments, `\` line continuation +- Use the `ConfigKey` template class for type-safe parsing +- Supported types: `bool`, `int` (hex/octal), `std::string`, `std::wstring`, `MemoryString`, `MacAddress`, enum maps +- Report invalid values with `EMIT_USER_WARNING(Localization::MessageConfigXxx(...))` +- New settings require a corresponding localization string in Resources.resw + +## Repository Navigation + +### Key Directories +- `src/windows/` — Main Windows WSL service components +- `src/linux/` — Linux-side WSL components +- `src/shared/` — Shared code between Windows and Linux +- `test/windows/` — Windows-based tests (TAEF framework) +- `test/linux/unit_tests/` — Linux unit test suite +- `doc/` — Documentation source (MkDocs) +- `tools/` — Build and deployment scripts +- `distributions/` — Distribution validation and metadata +- `localization/` — Localized string resources + +### Namespace → Directory Map + +| Namespace | Location | +|---|---| +| `wsl::shared::` | `src/shared/` | +| `wsl::windows::common::` | `src/windows/common/` | +| `wsl::windows::service::` | `src/windows/service/exe/` | +| `wsl::core::` | `src/windows/service/exe/` | +| `wsl::core::networking::` | `src/windows/common/` + `src/windows/service/exe/` | +| `wsl::linux::` | `src/linux/init/` | + +### Key Files +- `src/shared/inc/defs.h` — Shared platform definitions (NON_COPYABLE, Debug, Arm64, etc.) +- `src/shared/inc/stringshared.h` — String conversion utilities +- `src/windows/common/WslTelemetry.h` — Telemetry macros +- `src/windows/common/ExecutionContext.h` — Error context and user-facing error macros +- `src/windows/service/inc/wslservice.idl` — Main service COM interface definitions +- `src/windows/service/inc/wslc.idl` — Container COM interface definitions +- `src/windows/inc/WslPluginApi.h` — Plugin API header +- `src/shared/configfile/configfile.h` — Config file parser +- `.clang-format` — Code formatting rules (130 col, 4-space indent, Allman braces) + +## Building and Deploying + +### Critical Platform Requirements +- **Full builds ONLY work on Windows** with Visual Studio and Windows SDK 26100 +- **DO NOT attempt to build the main WSL components on Linux** — they require Windows-specific APIs, MSBuild, and Visual Studio toolchain +- Many validation and development tasks CAN be performed on Linux (documentation, formatting, Python validation scripts) + +### Windows Build Requirements +- CMake >= 3.25 (`winget install Kitware.CMake`) +- Visual Studio with these components: + - Windows SDK 26100 + - MSBuild + - Universal Windows platform support for v143 build tools (X64 and ARM64) + - MSVC v143 - VS 2022 C++ ARM64 build tools (Latest + Spectre) (X64 and ARM64) + - C++ core features + - C++ ATL for latest v143 tools (X64 and ARM64) + - C++ Clang compiler for Windows + - .NET desktop development + - .NET WinUI app development tools +- Enable Developer Mode in Windows Settings OR run with Administrator privileges (required for symbolic link support) + +### Building WSL (Windows Only) +1. Clone the repository +2. Generate Visual Studio solution: `cmake .` +3. Build: `cmake --build . -- -m` OR open `wsl.sln` in Visual Studio + +Build parameters: +- `cmake . -A arm64` — Build for ARM64 +- `cmake . -DCMAKE_BUILD_TYPE=Release` — Release build +- `cmake . -DBUILD_BUNDLE=TRUE` — Build bundle MSIX package (requires ARM64 built first) + +### Deploying WSL (Windows Only) +- Install MSI: `bin\\\wsl.msi` +- OR use script: `powershell tools\deploy\deploy-to-host.ps1` +- For Hyper-V VM: `powershell tools\deploy\deploy-to-vm.ps1 -VmName -Username -Password ` + +## Testing + +### Writing Tests (TAEF Framework) + +Tests use TAEF. See `.github/copilot/test.md` for detailed patterns and macros. + +Key points: +- Use `WSL_TEST_CLASS(Name)` — not raw `BEGIN_TEST_CLASS` +- Use `VERIFY_*` macros for assertions (`VERIFY_ARE_EQUAL`, `VERIFY_IS_TRUE`, etc.) +- Skip macros: `WSL1_TEST_ONLY()`, `WSL2_TEST_ONLY()`, `SKIP_TEST_ARM64()` +- Test infrastructure is in `test/windows/Common.h` + +### Running Tests (Windows Only) + +**CRITICAL: ALWAYS build the ENTIRE project before running tests:** +```powershell +cmake --build . -- -m +bin\\\test.bat +``` + +**Why full build is required:** +- Tests depend on multiple components (libwsl.dll, wsltests.dll, wslservice.exe, etc.) +- Partial builds will cause test failures +- **DO NOT skip the full build step even if only one file changed** + +Test execution: +- Run all tests: `bin\\\test.bat` +- Run subset: `bin\\\test.bat /name:*UnitTest*` +- Run specific test: `bin\\\test.bat /name:::` +- WSL1 tests: Add `-Version 1` flag +- Fast mode (after first run): Add `-f` flag (requires `wsl --set-default test_distro`) +- **Requires Administrator privileges** + +Test debugging: +- Attach WinDbgX automatically: `/attachdebugger` +- Wait for debugger (manual attach): `/waitfordebugger` +- Break on failure: `/breakonfailure` +- Run in-process: `/inproc` + +### Linux Unit Tests (Linux Only) +- Location: `test/linux/unit_tests/` +- Build script: `test/linux/unit_tests/build_tests.sh` +- **Note**: Requires specific Linux build environment setup not covered in main build process + +## Cross-Platform Validation Tasks + +### Documentation (Works on Linux/Windows) +- Install tools: `pip install mkdocs-mermaid2-plugin mkdocs --break-system-packages` +- Build docs: `mkdocs build -f doc/mkdocs.yml` +- Output location: `doc/site/` +- **Note**: May show warnings about mermaid CDN access on restricted networks + +### Code Formatting and Validation +- Format all source (Windows, requires `cmake .` first): `.\FormatSource.ps1` +- Format check (Linux/cross-platform): `clang-format --dry-run --style=file ` +- Validate copyright headers: `python3 tools/devops/validate-copyright-headers.py` + - **Note**: Will report missing headers in generated/dependency files (`_deps/`), which is expected +- Validate localization: `python3 tools/devops/validate-localization.py` + - **Note**: Only works after Windows build (requires `localization/strings/en-US/Resources.resw`) + +### Distribution Validation (Limited on Linux) +- Validate distribution info: `python3 distributions/validate.py distributions/DistributionInfo.json` +- **Note**: May fail on Linux due to network restrictions accessing distribution URLs + +### Pre-commit Checklist +Always run before committing: +1. `.\FormatSource.ps1` to verify formatting on changed C++ files +2. `python3 tools/devops/validate-copyright-headers.py` (ignore `_deps/` warnings) +3. `mkdocs build -f doc/mkdocs.yml` if documentation changed +4. Full Windows build if core components changed + +**Note**: The `.gitignore` properly excludes build artifacts (`*.sln`, `*.dll`, `*.pdb`, `obj/`, `bin/`, etc.) — do not commit these files. + +## Frequently Used Commands + +### Windows Development +```powershell +# Initial setup +cmake . +cmake --build . -- -m + +# Deploy and test +powershell tools\deploy\deploy-to-host.ps1 +wsl --version + +# Run tests +bin\x64\debug\test.bat +``` + +### Cross-Platform Validation +```powershell +# Documentation +mkdocs build -f doc/mkdocs.yml + +# Code formatting (Windows) +.\FormatSource.ps1 + +# Copyright header validation (reports expected issues in _deps/) +python3 tools/devops/validate-copyright-headers.py + +# Distribution validation (may fail on networks without external access) +python3 distributions/validate.py distributions/DistributionInfo.json +``` + +## Debugging and Logging + +### ETL Tracing (Windows Only) +```powershell +# Collect traces +wpr -start diagnostics\wsl.wprp -filemode +# [reproduce issue] +wpr -stop logs.ETL + +# Available profiles: +# - WSL (default) - General WSL tracing +# - WSL-Storage - Enhanced storage tracing +# - WSL-Networking - Comprehensive networking tracing +# - WSL-HvSocket - HvSocket-specific tracing +# Example: wpr -start diagnostics\wsl.wprp!WSL -filemode +``` + +### Log Analysis Tools +- Use WPA (Windows Performance Analyzer) for ETL traces +- Key providers: `Microsoft.Windows.Lxss.Manager`, `Microsoft.Windows.Subsystem.Lxss` + +### Debug Console (Linux) +Add to `%USERPROFILE%\.wslconfig`: +```ini +[wsl2] +debugConsole=true +``` + +### Common Debugging Commands +- Debug shell: `wsl --debug-shell` +- Collect WSL logs: `powershell diagnostics\collect-wsl-logs.ps1` +- Network logs: `powershell diagnostics\collect-wsl-logs.ps1 -LogProfile networking` + +## Timing and Timeout Guidelines + +**NEVER CANCEL these operations — always wait for completion:** + +| Operation | Typical Duration | Minimum Timeout | +|---|---|---| +| Full Windows build | 20-45 minutes | 60+ minutes | +| Full test suite | 30-60 minutes | 90+ minutes | +| Unit test subset | 5-15 minutes | 30+ minutes | +| Documentation build | ~0.5 seconds | 5+ minutes | +| Distribution validation | 2-5 minutes | 15+ minutes | + +## CI/CD Integration + +### GitHub Actions +- **distributions.yml** — Validates distribution metadata (Linux) +- **documentation.yml** — Builds and deploys docs (Linux) +- **modern-distributions.yml** — Tests modern distribution support + +## Development Environment Setup + +### Windows (Full Development) +1. Install Visual Studio with required components (listed above) +2. Install CMake 3.25+ +3. Enable Developer Mode +4. Clone repository +5. Run `cmake .` to generate solution + +### Linux (Documentation/Validation Only) +1. Install Python 3.8+ +2. Install docs tools: `pip install mkdocs-mermaid2-plugin mkdocs` +3. Clone repository +4. Run validation commands as needed + +Remember: **This is a Windows-focused project**. While some tasks can be performed on Linux, full WSL development requires Windows with Visual Studio. \ No newline at end of file diff --git a/.github/copilot/commit.md b/.github/copilot/commit.md new file mode 100644 index 000000000..93a68b0b6 --- /dev/null +++ b/.github/copilot/commit.md @@ -0,0 +1,8 @@ +## Commit Message Guidelines for WSL + +This repo has no strict commit message format. Follow these general practices: + +- Write a concise summary under 72 characters +- Use imperative mood ("Fix crash" not "Fixed crash") +- Reference GitHub issues with `(#123)` or `Fixes #123` +- Add a body paragraph for non-obvious changes explaining *why* diff --git a/.github/copilot/review.md b/.github/copilot/review.md new file mode 100644 index 000000000..b49dd0ebb --- /dev/null +++ b/.github/copilot/review.md @@ -0,0 +1,23 @@ +## Code Review Guidelines for WSL + +When reviewing code, enforce the conventions in `.github/copilot-instructions.md`. Focus especially on these high-risk areas: + +### ABI Safety (Critical) +- **Flag** new methods added to existing COM interfaces without a new versioned interface/IID +- **Flag** changed struct layouts in IDL files +- **Flag** changes to `WSLPluginHooksV1` or `WSLPluginAPIV1` structs (public API) + +### Resource Safety +- **Flag** raw `CloseHandle()`, `delete`, `free()`, or manual resource cleanup — require WIL smart pointers +- **Flag** missing `NON_COPYABLE()` / `NON_MOVABLE()` on classes that hold resources +- **Flag** lock usage without `_Guarded_by_()` SAL annotations + +### User-Facing Changes +- **Flag** hardcoded English strings — require `Localization::MessageXxx()` and Resources.resw entry +- **Flag** new `.wslconfig` settings without corresponding Resources.resw localization string +- **Flag** silent fallback on invalid config values — require `EMIT_USER_WARNING()` + +### Error Handling +- **Flag** bare `if (FAILED(hr))` — require WIL macros +- **Flag** silently swallowed errors — require `CATCH_LOG()` or `LOG_IF_FAILED()` +- **Flag** telemetry events missing privacy data tags diff --git a/.github/copilot/test.md b/.github/copilot/test.md new file mode 100644 index 000000000..99ca47399 --- /dev/null +++ b/.github/copilot/test.md @@ -0,0 +1,96 @@ +## Test Generation Guidelines for WSL + +When generating tests for this repository, follow these patterns: + +### Framework +Tests use TAEF (Test Authoring and Execution Framework). Always include `"Common.h"`. + +### Test Class Structure +```cpp +#include "Common.h" + +namespace MyFeatureTests +{ +class MyFeatureTests +{ + WSL_TEST_CLASS(MyFeatureTests) + + TEST_CLASS_SETUP(TestClassSetup) + { + VERIFY_ARE_EQUAL(LxsstuInitialize(FALSE), TRUE); + return true; + } + + TEST_CLASS_CLEANUP(TestClassCleanup) + { + LxsstuUninitialize(FALSE); + return true; + } + + TEST_METHOD(DescriptiveTestName) + { + // Test implementation + } +}; +} +``` + +### Key Rules +- Use `WSL_TEST_CLASS(Name)` — never raw `BEGIN_TEST_CLASS` +- Setup/cleanup methods must `return true` on success +- Use `VERIFY_*` macros for assertions — never `assert()` or exceptions for test validation + +### Assertion Macros +- `VERIFY_ARE_EQUAL(expected, actual)` — value equality +- `VERIFY_ARE_NOT_EQUAL(a, b)` — value inequality +- `VERIFY_IS_TRUE(condition)` — boolean check +- `VERIFY_IS_FALSE(condition)` — negative boolean check +- `VERIFY_IS_NULL(ptr)` — null check +- `VERIFY_IS_NOT_NULL(ptr)` — non-null check +- `VERIFY_WIN32_BOOL_SUCCEEDED(expr)` — Win32 BOOL result +- `VERIFY_SUCCEEDED(hr)` — HRESULT success + +### Logging in Tests +- `LogInfo(fmt, ...)` — informational messages +- `LogError(fmt, ...)` — error messages +- `LogWarning(fmt, ...)` — warnings +- `LogPass(fmt, ...)` — explicit pass messages +- `LogSkipped(fmt, ...)` — skip messages + +### Conditional Skipping +Add skip macros at the start of a test method body when the test only applies to certain environments: +```cpp +TEST_METHOD(Wsl2SpecificTest) +{ + WSL2_TEST_ONLY(); + // ... test code ... +} +``` + +Available skip macros: +- `WSL1_TEST_ONLY()` — skip unless WSL1 +- `WSL2_TEST_ONLY()` — skip unless WSL2 +- `SKIP_TEST_ARM64()` — skip on ARM64 +- `SKIP_TEST_UNSTABLE()` — skip known-flaky tests +- `WINDOWS_11_TEST_ONLY()` — skip on pre-Windows 11 +- `WSL_TEST_VERSION_REQUIRED(version)` — skip if WSL version too old + +### RAII Test Helpers +- `WslKeepAlive` — prevents UVM timeout during long-running tests; create at test start +- `WslConfigChange` — RAII wrapper that applies a temporary `.wslconfig` and restores the original on destruction: +```cpp +TEST_METHOD(TestWithCustomConfig) +{ + WslConfigChange config(L"[wsl2]\nmemory=4GB\n"); + // ... test with custom config ... + // Original .wslconfig restored when config goes out of scope +} +``` + +### Memory in Tests +- Use `ALLOC(size)` / `FREE(ptr)` macros for direct heap allocation in tests +- Prefer RAII wrappers and smart pointers for production-like code paths + +### Test Naming +- Use descriptive PascalCase names that describe the scenario: `CreateInstanceWithInvalidGuidFails`, `EchoTest`, `MountPlan9Share` +- Group related tests in the same test class diff --git a/.github/policies/resourceManagement.yml b/.github/policies/resourceManagement.yml new file mode 100644 index 000000000..82307e634 --- /dev/null +++ b/.github/policies/resourceManagement.yml @@ -0,0 +1,263 @@ +id: +name: GitOps.PullRequestIssueManagement +description: GitOps.PullRequestIssueManagement primitive +owner: +resource: repository +disabled: false +where: +configuration: + resourceManagementConfiguration: + scheduledSearches: + - description: + frequencies: + - hourly: + hour: 3 + filters: + - isIssue + - isOpen + - hasLabel: + label: needs-author-feedback + - noActivitySince: + days: 7 + actions: + - closeIssue + - addReply: + reply: >- + This issue has been automatically closed since it has not had any author activity for the past **7 days**. If you're still experiencing this issue please re-file it as a new issue. + + + Thank you! + - description: Close year old issues + frequencies: + - weekday: + day: Thursday + time: 12:00 + filters: + - isIssue + - isOpen + - isNotLabeledWith: + label: feature + - noActivitySince: + days: 365 + actions: + - closeIssue + - addReply: + reply: >- + This issue has been automatically closed since it has not had any activity for the past **year**. If you're still experiencing this issue please re-file this as a new issue or feature request. + + + Thank you! + eventResponderTasks: + - if: + - payloadType: Issue_Comment + - isAction: + action: Created + - isActivitySender: + issueAuthor: True + - hasLabel: + label: needs-author-feedback + then: + - removeLabel: + label: needs-author-feedback + description: + - if: + - payloadType: Issue_Comment + - commentContains: + pattern: '\/dup(licate|e)?(\s+of)?\s+\#[\d]+' + isRegex: True + - or: + - activitySenderHasPermission: + permission: Admin + - activitySenderHasPermission: + permission: Write + then: + - addReply: + reply: >- + Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread. + + + Thanks for your report! + - closeIssue + - addLabel: + label: duplicate + description: + - if: + - payloadType: Issue_Comment + - commentContains: + pattern: '\/need-repro' + isRegex: True + - or: + - activitySenderHasPermission: + permission: Admin + - activitySenderHasPermission: + permission: Write + then: + - addReply: + reply: >- + We’ve labelled your issue as ‘need-repro’ since we need more steps to help identify your problem. + + + Could you please provide us with reproducible steps for the issue you’re experiencing, including things such as the specific command line steps necessary to reproduce the behavior and their output. + + + Thank you! + - addLabel: + label: need-repro + description: + - if: + - payloadType: Issue_Comment + then: + - cleanEmailReply + description: + - if: + - payloadType: Issue_Comment + - commentContains: + pattern: '\/template' + isRegex: True + - or: + - activitySenderHasPermission: + permission: Admin + - activitySenderHasPermission: + permission: Write + then: + - closeIssue + - addReply: + reply: >- + Hi! We've closed your issue since you haven't used the template, or it is incomplete. Could you please provide all the requested info in the bug template and resubmit? Having that information will help us be able to accurately diagnose and resolve your issue. + + + Thank you! + - lockIssue + description: + - if: + - payloadType: Issue_Comment + - commentContains: + pattern: '\/fixed' + isRegex: True + - or: + - activitySenderHasPermission: + permission: Admin + - activitySenderHasPermission: + permission: Write + then: + - closeIssue + - addLabel: + label: fixedininsiderbuilds + - addReply: + reply: >- + This bug or feature request originally submitted has been addressed in whole or in part. Related or ongoing bug or feature gaps should be opened as a new issue submission if one does not already exist. + + + Thank you! + - removeLabel: + label: fixinbound + description: + - if: + - payloadType: Issue_Comment + - commentContains: + pattern: '\/logs?' + isRegex: True + - or: + - activitySenderHasPermission: + permission: Admin + - activitySenderHasPermission: + permission: Write + then: + - addReply: + reply: >- + Hello! Could you please provide more logs to help us better diagnose your issue? + + + To collect WSL logs, download and execute [collect-wsl-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1) in an **administrative powershell prompt**: + + + ``` + + Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1 + + Set-ExecutionPolicy Bypass -Scope Process -Force + + .\collect-wsl-logs.ps1 + + ``` + + The script will output the path of the log file once done. + + + Once completed please upload the output files to this GitHub issue. + + + See [Collect WSL logs (recommended method)](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method). + + + If you choose to email these logs instead of attaching them to the bug, please send them to wsl-gh-logs@microsoft.com with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body. + + + Thank you! + - addLabel: + label: needs-author-feedback + description: + - if: + - payloadType: Issue_Comment + - commentContains: + pattern: '\/dump?' + isRegex: True + - or: + - activitySenderHasPermission: + permission: Admin + - activitySenderHasPermission: + permission: Write + then: + - addReply: + reply: >- + Hello! Could you please provide logs and process dumps to help us better diagnose your issue? + + + To collect WSL logs and dumps, download and execute [collect-wsl-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1) in an **administrative powershell prompt**: + + + ``` + + Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1 + + Set-ExecutionPolicy Bypass -Scope Process -Force + + .\collect-wsl-logs.ps1 -Dump + + ``` + + The script will output the path of the log file once done. + + + Once completed please upload the output files to this GitHub issue. + + + See [Collect WSL logs (recommended method)](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method). + + + Thank you! + - addLabel: + label: needs-author-feedback + description: + - if: + - payloadType: Issue_Comment + - commentContains: + pattern: '\/bsod?' + isRegex: True + - or: + - activitySenderHasPermission: + permission: Admin + - activitySenderHasPermission: + permission: Write + then: + - addReply: + reply: >- + Hello! Could you please provide a kernel dump to help us better diagnose your issue? + To collect a kernel dump, follow [10) Reporting a Windows crash (BSOD)](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#10-reporting-a-windows-crash-bsod) + + Thank you! + - addLabel: + label: needs-author-feedback + description: +onFailure: +onSuccess: diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..d1ef424ee --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,18 @@ + +## Summary of the Pull Request + + +## PR Checklist + +- [ ] **Closes:** Link to issue #xxx +- [ ] **Communication:** I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected +- [ ] **Tests:** Added/updated if needed and all pass +- [ ] **Localization:** All end user facing strings can be localized +- [ ] **Dev docs:** Added/updated if needed +- [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/wsl/) and link it here: #xxx + + +## Detailed Description of the Pull Request / Additional comments + + +## Validation Steps Performed diff --git a/.github/workflows/distributions.yml b/.github/workflows/distributions.yml new file mode 100644 index 000000000..62e2a39b9 --- /dev/null +++ b/.github/workflows/distributions.yml @@ -0,0 +1,17 @@ +name: Validate distributions + +on: + pull_request: + paths: ['distributions/**'] + +jobs: + check: + name: Validate distributions + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Run validation + run: python distributions/validate.py distributions/DistributionInfo.json + shell: bash diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 000000000..e169afaa0 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,39 @@ +name: Build documentation +on: + workflow_dispatch: + push: + branches: [main, master] + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +jobs: + DeployDocs: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + permissions: + contents: read + pages: write + id-token: write + steps: + - name: Checkout actions + uses: actions/checkout@v4 + + - name: Install packages + run: pip install mkdocs-mermaid2-plugin mkdocs --break-system-packages + shell: bash + + - name: Build documentation + run: mkdocs build -f doc/mkdocs.yml + shell: bash + + - uses: actions/upload-pages-artifact@v4 + with: + path: doc/site + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/issue_edited.yml b/.github/workflows/issue_edited.yml new file mode 100644 index 000000000..75027b89b --- /dev/null +++ b/.github/workflows/issue_edited.yml @@ -0,0 +1,22 @@ +name: Process edited issue + +on: + workflow_dispatch: + issues: + types: [edited] + +jobs: + wti: + name: Run wti + runs-on: windows-2022 + permissions: + issues: write + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - uses: ./.github/actions/triage + with: + issue: "${{ github.event.issue.number }}" + previous_body: "${{ github.event.changes.body.from }}" + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/modern-distributions.yml b/.github/workflows/modern-distributions.yml new file mode 100644 index 000000000..7d6121c6e --- /dev/null +++ b/.github/workflows/modern-distributions.yml @@ -0,0 +1,28 @@ +name: Validate tar based distributions + +on: + pull_request: + paths: ['distributions/**'] + +jobs: + check: + name: Validate tar based distributions changes + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install pip packages + run: pip install -r distributions/requirements.txt + shell: bash + + - name: Run validation + run: | + python distributions/validate-modern.py \ + --repo-path . \ + --compare-with-branch 'origin/${{ github.base_ref }}' \ + --manifest distributions/DistributionInfo.json \ + + shell: bash diff --git a/.github/workflows/new_issue.yml b/.github/workflows/new_issue.yml new file mode 100644 index 000000000..4e81edf89 --- /dev/null +++ b/.github/workflows/new_issue.yml @@ -0,0 +1,21 @@ +name: Process new issue + +on: + workflow_dispatch : + issues: + types: [opened] + +jobs: + wti: + name: Run wti + runs-on: windows-2022 + permissions: + issues: write + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - uses: ./.github/actions/triage + with: + issue: "${{ github.event.issue.number }}" + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/new_issue_comment.yml b/.github/workflows/new_issue_comment.yml new file mode 100644 index 000000000..b0cd31107 --- /dev/null +++ b/.github/workflows/new_issue_comment.yml @@ -0,0 +1,23 @@ +name: Process new comment on issue + +on: + workflow_dispatch : + issue_comment: + types: [created] + +jobs: + wti: + name: Run wti + runs-on: windows-2022 + permissions: + issues: write + if: ${{ !github.event.issue.pull_request && github.event.issue.user.id == github.event.comment.user.id }} + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - uses: ./.github/actions/triage + with: + issue: '${{ github.event.issue.number }}' + comment: '${{ github.event.comment.id }}' + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml new file mode 100644 index 000000000..d8bde2979 --- /dev/null +++ b/.github/workflows/winget.yml @@ -0,0 +1,30 @@ +name: Publish to WinGet + +on: + release: + types: [released] + +jobs: + publish: + if: github.event.release.prerelease == false + runs-on: windows-latest # Action can only run on Windows + steps: + - name: Publish WSL + run: | + + Set-StrictMode -Version Latest + $ErrorActionPreference = "Stop" + + $assets = '${{ toJSON(github.event.release.assets) }}' | ConvertFrom-Json + $wingetRelevantAssetx64 = $assets | Where-Object { $_.name -like '*x64.msi' } | Select-Object -First 1 + $wingetRelevantAssetARM64 = $assets | Where-Object { $_.name -like '*arm64.msi' } | Select-Object -First 1 + + $version = "${{ github.event.release.tag_name }}" + + $wingetx64URL = $wingetRelevantAssetx64.browser_download_url + $wingetARM64URL = $wingetRelevantAssetARM64.browser_download_url + + $wingetPackageId = "Microsoft.WSL" + + & curl.exe -JLO https://aka.ms/wingetcreate/latest + & .\wingetcreate.exe update $wingetPackageId -s -v $version -u "$wingetx64URL|x64" "$wingetARM64URL|arm64" -t "${{ secrets.WINGET_TOKEN }}" diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..cdb56176c --- /dev/null +++ b/.gitignore @@ -0,0 +1,74 @@ +.vscode/* +.vs/ +!vendor/.preserve +out +tmp +/.vs/ +/.vscode/ +*.sln +*.slnx +*.user +*.csproj +*.vcxproj +*.filters +*.pdb +*.lib +*.dll +obj/ +Debug/ +Release/ +Properties/ +/_deps/ +/package/Strings/en-US/ +/packages/ +CMakeFiles/ +CMakeCache.txt +*.msix +cmake_install.cmake +build_tools/ +*_i.c +*_p.c +*_p.c +wslsupport/wslsupport.h +dlldata.c +.gdbinit +llvm/ +*.a +*.so +*.o +linux/init/init +linux/init +initrd/init +bin/ +*.nupkg +generated/ +*.nuspec +test/linux/unit_tests/wsl_unit_tests +*.dir/ +UserConfig.cmake +*.wix +*.wixobj +*.wixpdb +test.bat +AppxManifest.xml +package_layout/ +priconf.xml +resources.map.txt +resources.pri +msi-install-*.txt +kernellogs.txt +FormatSource.ps1 +msixinstaller/x64 +package/x64 +/appx-logs.txt +tools/clang-format.exe +tools/hooks/pre-commit +!/tools/hooks/pre-commit.in +/linux-crashes +doc/site/ +directory.build.targets +test-storage/ +*.vhdx +*.tar +*.etl +*.lscache diff --git a/.pipelines/build-job.yml b/.pipelines/build-job.yml new file mode 100644 index 000000000..7c0d66a23 --- /dev/null +++ b/.pipelines/build-job.yml @@ -0,0 +1,349 @@ +# Shared build job template for x64 and arm64 platforms. +# Parameterized by platform, with optional test artifact and CodeQL support. + +parameters: + - name: platform + type: string + + - name: isRelease + type: boolean + + - name: isNightly + type: boolean + + - name: packageVersion + type: string + + - name: traceLoggingConfig + type: string + default: '' + + - name: targets + type: object + + - name: pool + type: string + default: '' + + - name: vsoOrg + type: string + + - name: vsoProject + type: string + + - name: artifactSuffix + type: string + + - name: esrp + type: object + + # x64-only features + - name: includeTestArtifacts + type: boolean + default: false + + - name: includeCodeQL + type: boolean + default: false + + - name: dependsOn + type: string + default: '' + +jobs: + - job: build_${{ parameters.platform }} + displayName: "Build WSL package (${{ parameters.platform }})" + timeoutInMinutes: 120 + ${{ if ne(parameters.dependsOn, '') }}: + dependsOn: ${{ parameters.dependsOn }} + + ${{ if eq(parameters.pool, '') }}: + pool: {'type': 'windows'} + + ${{ else }}: + pool: ${{ parameters.pool }} + + variables: + NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS: 60 + NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS: 60 + ob_outputDirectory: '$(Build.SourcesDirectory)\out' + ob_artifactBaseName: 'drop_wsl' + ob_artifactSuffix: '${{ parameters.artifactSuffix }}' + packageStagingDir: '$(Build.SourcesDirectory)\packageStagingDir' + ob_sdl_codeSignValidation_excludes: -|**\*.ps1;-|**\testbin\** + ${{ if parameters.includeCodeQL }}: + Codeql.PublishDatabaseLog: true + Codeql.SourceRoot: src + ${{ if eq(parameters.isRelease, true) }}: + packageInputDirArg: '-DPACKAGE_INPUT_DIR=$(packageStagingDir)' + ${{ else }}: + packageInputDirArg: '' + + steps: + + - ${{ if parameters.includeCodeQL }}: + - task: CodeQL3000Init@0 + inputs: + Enabled: ${{ and(parameters.isNightly, eq(variables['Build.SourceBranch'], 'refs/heads/main'))}} + + - ${{ if eq(parameters.isRelease, true) }}: + - task: UseDotNet@2 + displayName: Install .NET Core SDK (required by EsrpCodeSigning) + inputs: + packageType: "sdk" + + - task: PowerShell@2 + displayName: Set trace logging configuration + condition: ne('${{ parameters.traceLoggingConfig }}', '') + inputs: + targetType: 'inline' + script: 'Set-Content -Path src/windows/inc/traceloggingconfig.h -Value $env:config.replace("\n", "`n")' + env: + config: '${{ parameters.traceLoggingConfig }}' + + - task: PowerShell@2 + displayName: "Compute package version" + name: version + inputs: + targetType: inline + ${{ if eq(parameters.packageVersion, '') }}: + script: | + $gitversion_version = (Select-Xml -Path packages.config -XPath '/packages/package[@id=''GitVersion.CommandLine'']/@version').Node.Value + $env:path = "packages/GitVersion.CommandLine.$gitversion_version/tools;$env:path" + . .\tools\devops\version_functions.ps1 + $version = Get-VersionInfo -Nightly $${{ parameters.isNightly }} + Write-Host "##vso[task.setvariable variable=WSL_PACKAGE_VERSION;isOutput=true]$($version.MsixVersion)" + Write-Host "##vso[task.setvariable variable=WSL_NUGET_PACKAGE_VERSION;isOutput=true]$($version.NugetVersion)" + + ${{ else }}: + script: | + Write-Host "##vso[task.setvariable variable=WSL_PACKAGE_VERSION;isOutput=true]$([string]('${{ parameters.packageVersion }}' + '.0'))" + Write-Host "##vso[task.setvariable variable=WSL_NUGET_PACKAGE_VERSION;isOutput=true]$([string]('${{ parameters.packageVersion }}'))" + + - task: CMake@1 + displayName: "CMake ${{ parameters.platform }}" + inputs: + workingDirectory: "." + cmakeArgs: . --fresh -A ${{ parameters.platform }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_VERSION=10.0.26100.0 -DPACKAGE_VERSION=$(version.WSL_PACKAGE_VERSION) -DWSL_NUGET_PACKAGE_VERSION=$(version.WSL_NUGET_PACKAGE_VERSION) -DSKIP_PACKAGE_SIGNING=${{ parameters.isRelease }} -DOFFICIAL_BUILD=${{ parameters.isRelease }} -DINCLUDE_PACKAGE_STAGE=${{ or(parameters.isRelease, parameters.isNightly) }} -DPIPELINE_BUILD_ID=$(Build.BuildId) -DVSO_ORG=${{ parameters.vsoOrg }} -DVSO_PROJECT=${{ parameters.vsoProject }} -DWSL_BUILD_WSL_SETTINGS=true -DWSL_BUILD_SDKCS=true $(packageInputDirArg)\${{ parameters.platform }} + + # Workaround for WSL Settings NuGet restore authentication issue + - script: _deps\nuget.exe restore -NonInteractive + + - ${{ each target in parameters.targets }}: + - script: cmake --build . --config Release --target ${{ target.target }} -- -m + displayName: "Build ${{ target.target }} (${{ parameters.platform }})" + + - ${{ if eq(parameters.isRelease, true) }}: + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5 + displayName: "Sign ${{ target.target }} (${{ parameters.platform }})" + inputs: + ConnectedServiceName: ${{ parameters.esrp.ConnectedServiceName}} + signConfigType: ${{ parameters.esrp.signConfigType }} + SessionTimeout: ${{ parameters.esrp.SessionTimeout }} + MaxConcurrency: ${{ parameters.esrp.MaxConcurrency }} + MaxRetryAttempts: ${{ parameters.esrp.MaxRetryAttempts }} + ServiceEndpointUrl: ${{ parameters.esrp.ServiceEndpointUrl }} + AuthAKVName: ${{ parameters.esrp.AuthAKVName }} + AuthSignCertName: ${{ parameters.esrp.AuthSignCertName }} + AppRegistrationClientId: ${{ parameters.esrp.AppRegistrationClientId }} + AppRegistrationTenantId: ${{ parameters.esrp.AppRegistrationTenantId }} + FolderPath: "bin\\${{ parameters.platform }}\\Release" + Pattern: "${{ target.pattern }}" + UseMSIAuthentication: true + EsrpClientId: ${{ parameters.esrp.EsrpClientId }} + inlineOperation: | + [ + { + "KeyCode": "CP-230012", + "OperationCode": "SigntoolSign", + "Parameters" : { + "OpusName" : "Microsoft", + "OpusInfo" : "http://www.microsoft.com", + "FileDigest" : "/fd \"SHA256\"", + "PageHash" : "/NPH", + "TimeStamp" : "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" + }, + "ToolName" : "sign", + "ToolVersion" : "1.0" + }, + { + "KeyCode" : "CP-230012", + "OperationCode" : "SigntoolVerify", + "Parameters" : {}, + "ToolName" : "sign", + "ToolVersion" : "1.0" + } + ] + + - task: PowerShell@2 + displayName: "Copy signed ${{ target.target }} to staging (${{ parameters.platform }})" + inputs: + targetType: inline + script: | + $arch = '${{ parameters.platform }}' + $pattern = '${{ target.pattern }}' + $inputDir = "bin\$arch\Release" + $outputDir = "$(packageStagingDir)\$arch" + New-Item -ItemType Directory -Path "$outputDir\wslsettings" -Force + foreach ($file in $pattern.Split(',')) { + $sourcePath = Join-Path $inputDir $file + if (Test-Path $sourcePath) { + $destPath = Join-Path $outputDir $file + Write-Host "Copying signed file: $sourcePath -> $destPath" + Copy-Item -Path $sourcePath -Destination $destPath -Force + } else { + Write-Warning "File not found: $sourcePath" + } + } + + - script: cmake --build . --config Release -- -m + displayName: "Build remaining targets (${{ parameters.platform }})" + + - task: PowerShell@2 + displayName: "Stage MSI and installer msix (${{ parameters.platform }})" + inputs: + targetType: inline + script: | + New-Item -ItemType Directory -Path "$(ob_outputDirectory)\bundle" -Force + New-Item -ItemType Directory -Path "$(ob_outputDirectory)\installer" -Force + Copy-Item -Path "bin\${{ parameters.platform }}\release\wsl.msi" -Destination "$(ob_outputDirectory)\bundle\wsl.$(version.WSL_PACKAGE_VERSION).${{ parameters.platform }}.msi" + Copy-Item -Path "bin\${{ parameters.platform }}\release\installer.msix" -Destination "$(ob_outputDirectory)\installer\installer.${{ parameters.platform }}.msix" + if (Test-Path "generated\dev-cert.pfx") { Copy-Item "generated\dev-cert.pfx" "$(ob_outputDirectory)\installer\dev-cert.pfx" } + New-Item -ItemType Directory -Path "$(ob_outputDirectory)\sdk\${{ parameters.platform }}" -Force + Copy-Item -Path "bin\${{ parameters.platform }}\release\wslcsdk.lib" -Destination "$(ob_outputDirectory)\sdk\${{ parameters.platform }}\wslcsdk.lib" + if ('${{ parameters.isRelease }}' -eq 'True') { + Copy-Item -Path "$(packageStagingDir)\${{ parameters.platform }}\wslcsdk.dll" -Destination "$(ob_outputDirectory)\sdk\${{ parameters.platform }}\wslcsdk.dll" + Copy-Item -Path "$(packageStagingDir)\${{ parameters.platform }}\wslcsdkcs.dll" -Destination "$(ob_outputDirectory)\sdk\${{ parameters.platform }}\wslcsdkcs.dll" + Copy-Item -Path "$(packageStagingDir)\${{ parameters.platform }}\Microsoft.WSL.Containers.winmd" -Destination "$(ob_outputDirectory)\sdk\${{ parameters.platform }}\Microsoft.WSL.Containers.winmd" + } else { + Copy-Item -Path "bin\${{ parameters.platform }}\release\wslcsdk.dll" -Destination "$(ob_outputDirectory)\sdk\${{ parameters.platform }}\wslcsdk.dll" + Copy-Item -Path "bin\${{ parameters.platform }}\release\wslcsdkcs.dll" -Destination "$(ob_outputDirectory)\sdk\${{ parameters.platform }}\wslcsdkcs.dll" + Copy-Item -Path "bin\${{ parameters.platform }}\release\Microsoft.WSL.Containers.winmd" -Destination "$(ob_outputDirectory)\sdk\${{ parameters.platform }}\Microsoft.WSL.Containers.winmd" + } + + - task: PowerShell@2 + displayName: "Create CAB from ${{ parameters.platform }} installer msi" + inputs: + targetType: inline + script: | + $arch = '${{ parameters.platform }}' + $bundleDir = "$(ob_outputDirectory)\bundle" + $msiPath = Join-Path $bundleDir "wsl.$(version.WSL_PACKAGE_VERSION).$arch.msi" + $cabPath = Join-Path $bundleDir "wsl.$(version.WSL_PACKAGE_VERSION).$arch.cab" + + if (-not (Test-Path -Path $msiPath)) { + throw "Input MSI not found for architecture '$arch': $msiPath" + } + + Write-Host "Creating CAB from MSI: $msiPath -> $cabPath" + & makecab.exe $msiPath $cabPath + + if ($LASTEXITCODE -ne 0) { + throw "makecab.exe failed with exit code $LASTEXITCODE for architecture '$arch'." + } + + if (-not (Test-Path -Path $cabPath)) { + throw "CAB file was not created at expected path: $cabPath" + } + + - ${{ if eq(parameters.isRelease, true) }}: + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5 + displayName: "Sign CAB (${{ parameters.platform }})" + inputs: + ConnectedServiceName: ${{ parameters.esrp.ConnectedServiceName}} + signConfigType: ${{ parameters.esrp.signConfigType }} + SessionTimeout: ${{ parameters.esrp.SessionTimeout }} + MaxConcurrency: ${{ parameters.esrp.MaxConcurrency }} + MaxRetryAttempts: ${{ parameters.esrp.MaxRetryAttempts }} + ServiceEndpointUrl: ${{ parameters.esrp.ServiceEndpointUrl }} + AuthAKVName: ${{ parameters.esrp.AuthAKVName }} + AuthSignCertName: ${{ parameters.esrp.AuthSignCertName }} + AppRegistrationClientId: ${{ parameters.esrp.AppRegistrationClientId }} + AppRegistrationTenantId: ${{ parameters.esrp.AppRegistrationTenantId }} + FolderPath: "$(ob_outputDirectory)\\bundle" + Pattern: "*.cab" + UseMSIAuthentication: true + EsrpClientId: ${{ parameters.esrp.EsrpClientId }} + inlineOperation: | + [ + { + "KeyCode": "CP-230012", + "OperationCode": "SigntoolSign", + "Parameters" : { + "OpusName" : "Microsoft", + "OpusInfo" : "http://www.microsoft.com", + "FileDigest" : "/fd \"SHA256\"", + "PageHash" : "/NPH", + "TimeStamp" : "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" + }, + "ToolName" : "sign", + "ToolVersion" : "1.0" + }, + { + "KeyCode" : "CP-230012", + "OperationCode" : "SigntoolVerify", + "Parameters" : {}, + "ToolName" : "sign", + "ToolVersion" : "1.0" + } + ] + + - powershell: | + $binFolder = ".\bin\${{ parameters.platform }}\Release" + $pdbFolder = Join-Path $(ob_outputDirectory) "pdb\${{ parameters.platform }}\Release" + mkdir $pdbFolder + foreach ($filter in @("*.pdb", "*.debug")) + { + foreach ($e in (Get-ChildItem -Recurse -Path $binFolder -Filter $filter)) {Move-Item -Path $e.fullname -Destination (Join-Path $pdbFolder $e.name)} + } + displayName: Collect symbols (${{ parameters.platform }}) + + # Test artifacts (x64 only) + - ${{ if parameters.includeTestArtifacts }}: + - powershell: | + $taefVersion = (Select-Xml -Path packages.config -XPath '/packages/package[@id=''Microsoft.Taef'']/@version').Node.Value + New-Item -ItemType Directory -Path "$(ob_outputDirectory)\bundle" -Force + mkdir $(ob_outputDirectory)\testbin\x64\release + + Copy-Item -Path "bin\x64\release\wsltests.dll" -Destination "$(ob_outputDirectory)\testbin\x64\release\wsltests.dll" + Copy-Item -Path "bin\x64\release\testplugin.dll" -Destination "$(ob_outputDirectory)\testbin\x64\release\testplugin.dll" + Copy-Item -Path "bin\x64\release\wslcsdk.dll" -Destination "$(ob_outputDirectory)\testbin\x64\release\wslcsdk.dll" + Copy-Item -Path "bin\x64\release\installer.msix" -Destination "$(ob_outputDirectory)\testbin\x64\release\installer.msix" + Move-Item -Path "packages\Microsoft.Taef.$taefVersion\build\Binaries\x64" -Destination "$(ob_outputDirectory)\testbin\x64\release\taef" + + Move-Item -Path "bin\x64\cloudtest" -Destination "$(ob_outputDirectory)\testbin\x64\cloudtest" + + Move-Item -Path "tools\test\test-setup.ps1" -Destination "$(ob_outputDirectory)\testbin\test-setup.ps1" + Move-Item -Path "tools\test\CloudTest-Setup.bat" -Destination "$(ob_outputDirectory)\testbin\CloudTest-Setup.bat" + Move-Item -Path "diagnostics\wsl.wprp" -Destination "$(ob_outputDirectory)\testbin\wsl.wprp" + Move-Item -Path "test\linux\unit_tests" -Destination "$(ob_outputDirectory)\testbin\unit_tests" + + $TestDistroVersion = (Select-Xml -Path packages.config -XPath '/packages/package[@id=''Microsoft.WSL.TestDistro'']/@version').Node.Value + Copy-Item "packages\Microsoft.WSL.TestDistro.$TestDistroVersion\x64\test_distro.tar.xz" "$(ob_outputDirectory)\testbin\x64" + + $TestDataVersion = (Select-Xml -Path packages.config -XPath '/packages/package[@id=''Microsoft.WSL.TestData'']/@version').Node.Value + Copy-Item "packages\Microsoft.WSL.TestData.$TestDataVersion\x64" "$(ob_outputDirectory)\testbin\x64\test_data" -Recurse -Force + + displayName: Stage test artifacts + + - task: PublishSymbols@2 + displayName: Publish symbols (${{ parameters.platform }}) + inputs: + SymbolServerType: "TeamServices" + TreatNotIndexedAsWarning: true + SymbolsProduct: WSL + SymbolsVersion: $(version.WSL_PACKAGE_VERSION) + SearchPattern: | + $(ob_outputDirectory)/pdb/**/*.pdb + bin/**/*.exe + bin/**/*.dll + + - ${{ if ne(parameters.pool, '') }}: + - task: PublishPipelineArtifact@1 + inputs: + targetPath: $(ob_outputDirectory) + artifactName: $(ob_artifactBaseName)$(ob_artifactSuffix) + + - ${{ if parameters.includeCodeQL }}: + - task: CodeQL3000Finalize@0 + condition: ${{ and(parameters.isNightly, eq(variables['Build.SourceBranch'], 'refs/heads/main'))}} diff --git a/.pipelines/build-stage.yml b/.pipelines/build-stage.yml new file mode 100644 index 000000000..0d0c30b17 --- /dev/null +++ b/.pipelines/build-stage.yml @@ -0,0 +1,153 @@ +parameters: + - name: isRelease + type: boolean + default: true + + - name: packageVersion + type: string + default: "" + + - name: nugetSuffix + type: string + default: "" + + - name: isNightly + type: boolean + default: false + + - name: traceLoggingConfig + type: string + default: '' + + - name: nugetPackages + type: object + default: + - Microsoft.WSL.PluginApi.nuspec + - Microsoft.WSL.Containers.nuspec + + - name: includePackageStage + type: boolean + default: true + + - name: targets + type: object + default: + - target: "wsl;libwsl;wslg;wslservice;wslhost;wslrelay;wslinstaller;wslinstall;initramfs;wslserviceproxystub;wslsettings;wslinstallerproxystub;testplugin;wslcsession;wslc;wsltests;wslcsdk" + pattern: "wsl.exe,libwsl.dll,wslg.exe,wslservice.exe,wslhost.exe,wslrelay.exe,wslinstaller.exe,wslinstall.dll,wslserviceproxystub.dll,wslsettings/wslsettings.dll,wslsettings/wslsettings.exe,wslinstallerproxystub.dll,WSLDVCPlugin.dll,testplugin.dll,wsldeps.dll,wslcsession.exe,wslc.exe,wslcsdk.dll" + - target: "msixgluepackage" + pattern: "gluepackage.msix" + - target: "msipackage;wslcsdkcs" + pattern: "wsl.msi,wslcsdkcs.dll,Microsoft.WSL.Containers.winmd" + + - name: pool + type: string + default: '' + + - name: vsoOrg + type: string + + - name: vsoProject + type: string + + - name: esrp + type: object + default: + ConnectedServiceName: "AzureConnection-AME" + signConfigType: "inlineSignParams" + SessionTimeout: 60 + MaxConcurrency: 50 + MaxRetryAttempts: 5 + ServiceEndpointUrl: $(EsrpServiceEndpointUrl) + AuthAKVName: $(EsrpAuthAKVName) + AuthSignCertName: $(EsrpAuthSignCertName) + AppRegistrationClientId: $(EsrpAppRegistrationClientId) + AppRegistrationTenantId: $(EsrpAppRegistrationTenantId) + EsrpClientId: $(EsrpClientId) + +stages: + # ── x64 build stage ────────────────────────────────────────────────── + # Runs in parallel with build_arm64. Tests depend on this stage. + - stage: build_x64 + dependsOn: [] + jobs: + - template: build-job.yml + parameters: + platform: x64 + artifactSuffix: '_build' + isRelease: ${{ parameters.isRelease }} + isNightly: ${{ parameters.isNightly }} + packageVersion: ${{ parameters.packageVersion }} + traceLoggingConfig: ${{ parameters.traceLoggingConfig }} + targets: ${{ parameters.targets }} + pool: ${{ parameters.pool }} + vsoOrg: ${{ parameters.vsoOrg }} + vsoProject: ${{ parameters.vsoProject }} + esrp: ${{ parameters.esrp }} + includeTestArtifacts: true + + # ── arm64 build stage (runs in parallel with build_x64) ────────────── + # Includes formatting/localization checks as a first job, then arm64 build. + - stage: build_arm64 + dependsOn: [] + jobs: + - job: checks + displayName: "Formatting & localization checks" + timeoutInMinutes: 30 + + variables: + ob_outputDirectory: '$(Build.SourcesDirectory)\out' + + ${{ if eq(parameters.pool, '') }}: + pool: {'type': 'windows'} + + ${{ else }}: + pool: ${{ parameters.pool }} + + steps: + - script: python tools/devops/validate-localization.py + displayName: Validate localization resources + + - script: python tools\devops\validate-copyright-headers.py src + displayName: Validate copyright headers (src/) + + - script: python tools\devops\validate-copyright-headers.py test + displayName: Validate copyright headers (test/) + + - task: CMake@1 + displayName: "CMake ." + inputs: + workingDirectory: "." + cmakeArgs: . + + - task: PowerShell@2 + inputs: + targetType: "filePath" + filePath: FormatSource.ps1 + arguments: "-ModifiedOnly $false -Verify $true" + displayName: "Clang-format check" + + - template: build-job.yml + parameters: + platform: arm64 + artifactSuffix: '_build_arm64' + dependsOn: checks + isRelease: ${{ parameters.isRelease }} + isNightly: ${{ parameters.isNightly }} + packageVersion: ${{ parameters.packageVersion }} + traceLoggingConfig: ${{ parameters.traceLoggingConfig }} + targets: ${{ parameters.targets }} + pool: ${{ parameters.pool }} + vsoOrg: ${{ parameters.vsoOrg }} + vsoProject: ${{ parameters.vsoProject }} + esrp: ${{ parameters.esrp }} + includeCodeQL: true + + # ── package stage (release and nightly only) ───────────────────────── + # Creates msixbundle, appxupload, and NuGet packages from both platform artifacts. + - ${{ if parameters.includePackageStage }}: + - template: package-stage.yml + parameters: + isRelease: ${{ parameters.isRelease }} + pool: ${{ parameters.pool }} + esrp: ${{ parameters.esrp }} + nugetPackages: ${{ parameters.nugetPackages }} diff --git a/.pipelines/flight-stage.yml b/.pipelines/flight-stage.yml new file mode 100644 index 000000000..52640fcab --- /dev/null +++ b/.pipelines/flight-stage.yml @@ -0,0 +1,119 @@ +parameters: +- name: publishPackage + type: boolean + default: false + +- name: packageVersion + type: string + default: '' + +- name: bypassTests + type: boolean + default: false + +stages: + - stage: flight + ${{ if eq(parameters.bypassTests, true) }}: + dependsOn: [package] + ${{ else }}: + dependsOn: [test, package] + + jobs: + - job: flight + displayName: 'Package and Flight WSL package' + + dependsOn: [] # The stage handles this dependency + pool: + type: windows + variables: + AppId: 9P9TQF7MRM4R + FlightId: $(StoreBrokerFlightId) + StoreBrokerPath: $(Build.SourcesDirectory)\storebroker # location of StoreBroker information in the repo + StoreBrokerPayloadPath: $(Build.ArtifactStagingDirectory)\StoreBrokerPayload # location of package created for flight + ob_outputDirectory: '$(Build.SourcesDirectory)\out' + ob_artifactBaseName: 'drop_wsl' + ob_artifactSuffix: '_flight' + ob_sdl_checkcflags_enabled : false # Disable the CFLAGS check since we're not actually building anything in this stage + + steps: + + # Source: https://learn.microsoft.com/azure/devops/pipelines/build/run-retention?view=azure-devops&tabs=powershell + - task: PowerShell@2 + condition: and(succeeded(), not(canceled())) + displayName: Retain this build + inputs: + failOnStderr: true + targetType: 'inline' + script: | + $contentType = "application/json"; + $headers = @{ Authorization = 'Bearer $(System.AccessToken)' }; + $rawRequest = @{ daysValid = 365 * 2; definitionId = $(System.DefinitionId); ownerId = 'User:$(Build.RequestedForId)'; protectPipeline = $false; runId = $(Build.BuildId) }; + $request = ConvertTo-Json @($rawRequest); + $uri = "$(System.CollectionUri)$(System.TeamProject)/_apis/build/retention/leases?api-version=6.0-preview.1"; + Invoke-RestMethod -uri $uri -method POST -Headers $headers -ContentType $contentType -Body $request; + + # Download the build drop + - task: DownloadPipelineArtifact@2 + displayName: Download package artifact + inputs: + artifact: "drop_wsl_package" + path: drop + + # copy the appxupload folder to the storebroker folder + - powershell: | + mkdir $(StoreBrokerPath)\appxpackage\ + Copy-Item -Path drop\appxupload\* -Destination $(StoreBrokerPath)\appxpackage\ -Recurse -Force + displayName: Copy AppxUpload artifact + + # creates a submission package that is published to the store; containers store page information and the WSL appxupload + - task: MS-RDX-MRO.windows-store-publish.package-task.store-package@3 + displayName: 'Creating StoreBroker Payload' + inputs: + serviceEndpoint: 'AzureConnection-StoreBroker-WIF' + sbConfigPath: $(StoreBrokerPath)\sbconfig.json + sourceFolder: $(StoreBrokerPath)\appxpackage\ + contents: Microsoft.WSL_${{ parameters.packageVersion }}.0_x64_ARM64.appxupload + pdpPath: $(StoreBrokerPath)\PDPs\ + pdpInclude: PDP.xml + pdpMediaPath: $(StoreBrokerPath)\Media\ + outSBPackagePath: $(StoreBrokerPayloadPath) + outSBName: WindowsSubsystemForLinux + + # copy the storebroker submission package to the drop folder so it can be used if needed + - powershell: | + New-Item -ItemType Directory -Force -Path $(ob_outputDirectory) + Copy-Item -Path $(StoreBrokerPayloadPath)\* -Destination $(ob_outputDirectory) -Recurse -Force + Copy-Item -Path SBLog.txt -Destination $(ob_outputDirectory) -Force + displayName: Copy StoreBrokerPayload to drop + + # submit the package flight to the WSL SelfHost Flight Group + - task: MS-RDX-MRO.windows-store-publish.flight-task.store-flight@3 + displayName: 'Flight StoreBroker Package to Partner Center - WSL SelfHost Flight Group' + condition: and(succeeded(), eq('${{ parameters.publishPackage }}', true)) + inputs: + serviceEndpoint: 'AzureConnection-StoreBroker-WIF' + appId: $(AppId) + flightId: $(FlightId) + inputMethod: JsonAndZip + jsonPath: $(StoreBrokerPayloadPath)\WindowsSubsystemForLinux.json + zipPath: $(StoreBrokerPayloadPath)\WindowsSubsystemForLinux.zip + force: true + skipPolling: true # skips polling Partner Centre/store API for the state of the package; skipping will mean that errors in the process will only show up in Partner Center + targetPublishMode: Immediate # on completion of this task, the package will be published to the WSL SelfHost flight once certified (no manual clicking of any buttons in Partner Center) + preserveSubmissionId: false + deletePackages: true + numberOfPackagesToKeep: 0 + + - task: PipAuthenticate@1 + displayName: 'Pip Authenticate' + inputs: + artifactFeeds: 'wsl' + + # Create a draft github release + - powershell: | + pip install --user -r tools/devops/requirements.txt + python tools/devops/create-release.py '${{ parameters.packageVersion }}' drop\bundle\Microsoft.WSL_${{ parameters.packageVersion }}.0_x64_ARM64.msixbundle drop\bundle\wsl.${{ parameters.packageVersion }}.0.arm64.msi drop\bundle\wsl.${{ parameters.packageVersion }}.0.x64.msi --no-fetch --github-token "$env:token" ${{ iif(parameters.publishPackage, '--publish --auto-release-notes', '--use-current-ref') }} + + displayName: Create GitHub release + env: + token: $(GITHUB_RELEASE_TOKEN) \ No newline at end of file diff --git a/.pipelines/nuget-stage.yml b/.pipelines/nuget-stage.yml new file mode 100644 index 000000000..2700ed93e --- /dev/null +++ b/.pipelines/nuget-stage.yml @@ -0,0 +1,49 @@ +parameters: +- name: isNightly + type: boolean + default: false + +- name: nugetPackages + type: object + default: + - Microsoft.WSL.PluginApi + - Microsoft.WSL.Containers + +stages: +- stage: nuget + dependsOn: [package, test] + jobs: + - job: nuget + displayName: 'Publish nuget packages' + condition: and(succeeded(), or(eq(variables['Build.Reason'], 'Schedule'), eq('${{ parameters.isNightly }}', false))) + dependsOn: [] # The stage handles this dependency + + pool: + type: windows + + variables: + WSL_NUGET_PACKAGE_VERSION: $[ stageDependencies.package.package.outputs['version.WSL_NUGET_PACKAGE_VERSION'] ] + NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS: 60 + NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS: 60 + ob_outputDirectory: '$(Build.SourcesDirectory)\out' + ob_artifactBaseName: 'drop_wsl' + ob_artifactSuffix: '_nuget' + + steps: + + - task: DownloadPipelineArtifact@2 + displayName: Download nuget artifacts + inputs: + artifact: "drop_wsl_package" + path: $(Build.SourcesDirectory)\drop + + # Note: this task might fail if there's been no commits between two nightly pipelines, which is fine. + - ${{ each package in parameters.nugetPackages }}: + - task: NuGetCommand@2 + displayName: Push nuget/${{ package }}.*.nupkg + inputs: + command: 'push' + packagesToPush: $(Build.SourcesDirectory)\drop\nuget\${{ package }}.$(WSL_NUGET_PACKAGE_VERSION).nupkg + nuGetFeedType: 'internal' + publishVstsFeed: wsl + allowPackageConflicts: ${{ parameters.isNightly }} \ No newline at end of file diff --git a/.pipelines/package-stage.yml b/.pipelines/package-stage.yml new file mode 100644 index 000000000..31773fd5d --- /dev/null +++ b/.pipelines/package-stage.yml @@ -0,0 +1,243 @@ +parameters: + - name: isRelease + type: boolean + default: true + + - name: nugetPackages + type: object + default: + - Microsoft.WSL.PluginApi.nuspec + + - name: pool + type: string + default: '' + + - name: esrp + type: object + default: + ConnectedServiceName: "AzureConnection-AME" + signConfigType: "inlineSignParams" + SessionTimeout: 60 + MaxConcurrency: 50 + MaxRetryAttempts: 5 + ServiceEndpointUrl: $(EsrpServiceEndpointUrl) + AuthAKVName: $(EsrpAuthAKVName) + AuthSignCertName: $(EsrpAuthSignCertName) + AppRegistrationClientId: $(EsrpAppRegistrationClientId) + AppRegistrationTenantId: $(EsrpAppRegistrationTenantId) + EsrpClientId: $(EsrpClientId) + +stages: + - stage: package + dependsOn: [build_x64, build_arm64] + jobs: + - job: package + displayName: "Package WSL release artifacts" + timeoutInMinutes: 60 + + ${{ if eq(parameters.pool, '') }}: + pool: {'type': 'windows'} + + ${{ else }}: + pool: ${{ parameters.pool }} + + variables: + ob_outputDirectory: '$(Build.SourcesDirectory)\out' + ob_artifactBaseName: 'drop_wsl' + ob_artifactSuffix: '_package' + buildStagePackageVersion: $[ stageDependencies.build_x64.build_x64.outputs['version.WSL_PACKAGE_VERSION'] ] + buildStageNugetVersion: $[ stageDependencies.build_x64.build_x64.outputs['version.WSL_NUGET_PACKAGE_VERSION'] ] + + steps: + - task: PowerShell@2 + displayName: "Set package version from build stage" + name: version + inputs: + targetType: inline + script: | + Write-Host "##vso[task.setvariable variable=WSL_PACKAGE_VERSION;isOutput=true]$(buildStagePackageVersion)" + Write-Host "##vso[task.setvariable variable=WSL_NUGET_PACKAGE_VERSION;isOutput=true]$(buildStageNugetVersion)" + + - task: DownloadPipelineArtifact@2 + displayName: Download x64 build artifact + inputs: + artifact: "drop_wsl_build" + path: $(Pipeline.Workspace)\drop_x64 + + - task: DownloadPipelineArtifact@2 + displayName: Download arm64 build artifact + inputs: + artifact: "drop_wsl_build_arm64" + path: $(Pipeline.Workspace)\drop_arm64 + + - powershell: | + $version = "$(version.WSL_PACKAGE_VERSION)" + + # Place per-platform msix files where cmake's bundle target expects them + foreach ($arch in @( + @{platform="x64"; dir="X64"}, + @{platform="arm64"; dir="arm64"} + )) { + $dest = "bin\$($arch.dir)\Release" + New-Item -ItemType Directory -Path $dest -Force + Copy-Item "$(Pipeline.Workspace)\drop_$($arch.platform)\installer\installer.$($arch.platform).msix" "$dest\installer.msix" + Copy-Item "$(Pipeline.Workspace)\drop_$($arch.platform)\sdk\$($arch.platform)\wslcsdk.lib" "$dest\wslcsdk.lib" + Copy-Item "$(Pipeline.Workspace)\drop_$($arch.platform)\sdk\$($arch.platform)\wslcsdk.dll" "$dest\wslcsdk.dll" + Copy-Item "$(Pipeline.Workspace)\drop_$($arch.platform)\sdk\$($arch.platform)\wslcsdkcs.dll" "$dest\wslcsdkcs.dll" + Copy-Item "$(Pipeline.Workspace)\drop_$($arch.platform)\sdk\$($arch.platform)\Microsoft.WSL.Containers.winmd" "$dest\Microsoft.WSL.Containers.winmd" + } + + # Copy MSIs to the output bundle directory + $bundleDir = "$(ob_outputDirectory)\bundle" + New-Item -ItemType Directory -Path $bundleDir -Force + Copy-Item "$(Pipeline.Workspace)\drop_x64\bundle\wsl.${version}.x64.msi" "$bundleDir\" + Copy-Item "$(Pipeline.Workspace)\drop_arm64\bundle\wsl.${version}.arm64.msi" "$bundleDir\" + displayName: Stage build artifacts + + - task: CMake@1 + displayName: "CMake configure (bundle-only)" + inputs: + workingDirectory: "." + cmakeArgs: . -DBUNDLE_ONLY=TRUE -DCMAKE_BUILD_TYPE=Release -DPACKAGE_VERSION=$(version.WSL_PACKAGE_VERSION) -DWSL_NUGET_PACKAGE_VERSION=$(version.WSL_NUGET_PACKAGE_VERSION) + + - script: cmake --build . --config Release --target bundle -- -m + displayName: Create msixbundle + + - powershell: | + Copy-Item "bundle\Release\*.msixbundle" "$(ob_outputDirectory)\bundle\" + displayName: Copy bundle to output + + - ${{ if eq(parameters.isRelease, true) }}: + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5 + displayName: "Sign the bundle" + inputs: + ConnectedServiceName: ${{ parameters.esrp.ConnectedServiceName}} + signConfigType: ${{ parameters.esrp.signConfigType }} + SessionTimeout: ${{ parameters.esrp.SessionTimeout }} + MaxConcurrency: ${{ parameters.esrp.MaxConcurrency }} + MaxRetryAttempts: ${{ parameters.esrp.MaxRetryAttempts }} + ServiceEndpointUrl: ${{ parameters.esrp.ServiceEndpointUrl }} + AuthAKVName: ${{ parameters.esrp.AuthAKVName }} + AuthSignCertName: ${{ parameters.esrp.AuthSignCertName }} + AppRegistrationClientId: ${{ parameters.esrp.AppRegistrationClientId }} + AppRegistrationTenantId: ${{ parameters.esrp.AppRegistrationTenantId }} + FolderPath: "$(ob_outputDirectory)\\bundle" + Pattern: "*.msixbundle" + UseMSIAuthentication: true + EsrpClientId: ${{ parameters.esrp.EsrpClientId }} + inlineOperation: | + [ + { + "KeyCode": "CP-230012", + "OperationCode": "SigntoolSign", + "Parameters" : { + "OpusName" : "Microsoft", + "OpusInfo" : "http://www.microsoft.com", + "FileDigest" : "/fd \"SHA256\"", + "PageHash" : "/NPH", + "TimeStamp" : "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" + }, + "ToolName" : "sign", + "ToolVersion" : "1.0" + }, + { + "KeyCode" : "CP-230012", + "OperationCode" : "SigntoolVerify", + "Parameters" : {}, + "ToolName" : "sign", + "ToolVersion" : "1.0" + } + ] + + - ${{ if not(eq(parameters.isRelease, true)) }}: + - powershell: | + # Sign the bundle with the dev cert from the x64 build + $cert = "$(Pipeline.Workspace)\drop_x64\installer\dev-cert.pfx" + if (-not (Test-Path $cert)) { throw "Dev cert not found at $cert" } + $bundle = Get-ChildItem "$(ob_outputDirectory)\bundle\*.msixbundle" | Select-Object -First 1 + $signtool = Get-ChildItem "${env:ProgramFiles(x86)}\Windows Kits\10\bin\*\x64\signtool.exe" -ErrorAction Stop | Sort-Object FullName -Descending | Select-Object -First 1 -ExpandProperty FullName + & $signtool sign /a /v /fd SHA256 /f $cert $bundle.FullName + displayName: Sign bundle with dev cert + + - powershell: | + $version = "$(version.WSL_PACKAGE_VERSION)" + + # Collect PDBs from both platforms + foreach ($source in @( + @{arch="x64"; drop="$(Pipeline.Workspace)\drop_x64\pdb\x64\Release"}, + @{arch="ARM64"; drop="$(Pipeline.Workspace)\drop_arm64\pdb\arm64\Release"} + )) + { + $pdbFolder = Join-Path $(ob_outputDirectory) "pdb\$($source.arch)\Release" + New-Item -ItemType Directory -Path $pdbFolder -Force + if (Test-Path $source.drop) { + Copy-Item -Path "$($source.drop)\*" -Destination $pdbFolder -Recurse + } + } + displayName: Collect symbols from both platforms + + - powershell: | + $version = "$(version.WSL_PACKAGE_VERSION)" + + mkdir appxsym + foreach ($arch in @("x64", "ARM64")) + { + Get-ChildItem -Path $(ob_outputDirectory)\pdb\$arch\release\*.pdb -Exclude wsltests.pdb | Compress-Archive -DestinationPath appxsym/Microsoft.WSL_${version}_$arch.zip + Copy-Item -Path appxsym/Microsoft.WSL_${version}_$arch.zip -Destination appxsym/Microsoft.WSL_${version}_$arch.appxsym + } + mkdir $(ob_outputDirectory)/appxupload + Get-ChildItem -Path appxsym/*.appxsym,$(ob_outputDirectory)/bundle/Microsoft.WSL_${version}_x64_ARM64.msixbundle | Compress-Archive -DestinationPath $(ob_outputDirectory)/appxupload/Microsoft.WSL_${version}_x64_ARM64.zip + Move-Item -Path $(ob_outputDirectory)/appxupload/Microsoft.WSL_${version}_x64_ARM64.zip -Destination $(ob_outputDirectory)/appxupload/Microsoft.WSL_${version}_x64_ARM64.appxupload + rm appxsym/*.appxsym + + displayName: Create appxupload + condition: and(succeeded(), eq('${{ parameters.isRelease }}', true)) + + - script: md.exe $(ob_outputDirectory)\nuget + displayName: "Create the nuget directory" + + - ${{ each package in parameters.nugetPackages }}: + - script: nuget.exe pack ${{ package }} -OutputDirectory $(ob_outputDirectory)\nuget -NonInteractive + displayName: Build ${{ package }} + + - ${{ if eq(parameters.isRelease, true) }}: + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5 + displayName: "Sign nuget packages" + inputs: + ConnectedServiceName: ${{ parameters.esrp.ConnectedServiceName}} + signConfigType: ${{ parameters.esrp.signConfigType }} + SessionTimeout: ${{ parameters.esrp.SessionTimeout }} + MaxConcurrency: ${{ parameters.esrp.MaxConcurrency }} + MaxRetryAttempts: ${{ parameters.esrp.MaxRetryAttempts }} + ServiceEndpointUrl: ${{ parameters.esrp.ServiceEndpointUrl }} + AuthAKVName: ${{ parameters.esrp.AuthAKVName }} + AuthSignCertName: ${{ parameters.esrp.AuthSignCertName }} + AppRegistrationClientId: ${{ parameters.esrp.AppRegistrationClientId }} + AppRegistrationTenantId: ${{ parameters.esrp.AppRegistrationTenantId }} + FolderPath: '$(ob_outputDirectory)\nuget' + Pattern: "*.nupkg" + UseMSIAuthentication: true + EsrpClientId: ${{ parameters.esrp.EsrpClientId }} + inlineOperation: | + [ + { + "KeyCode": "CP-401405", + "OperationCode": "NuGetSign", + "Parameters" : {}, + "ToolName" : "sign", + "ToolVersion" : "1.0" + }, + { + "KeyCode" : "CP-401405", + "OperationCode" : "NuGetVerify", + "Parameters" : {}, + "ToolName" : "sign", + "ToolVersion" : "1.0" + } + ] + + - ${{ if ne(parameters.pool, '') }}: + - task: PublishPipelineArtifact@1 + inputs: + targetPath: $(ob_outputDirectory) + artifactName: $(ob_artifactBaseName)$(ob_artifactSuffix) diff --git a/.pipelines/test-job.yml b/.pipelines/test-job.yml new file mode 100644 index 000000000..61cd79f98 --- /dev/null +++ b/.pipelines/test-job.yml @@ -0,0 +1,49 @@ +parameters: + - name: branch + type: string + + - name: version + type: string + + - name: image + type: string + + - name: run + type: boolean + + - name: pool + type: string + default: '' + +jobs: + - job: test_${{ parameters.branch }}_${{ parameters.version }} + displayName: "${{ parameters.version }} tests - ${{ parameters.branch }}" + dependsOn: [] + condition: and(succeeded(), eq('${{ parameters.run }}', true)) + variables: + ob_outputDirectory: '$(Build.SourcesDirectory)\out' + ob_artifactBaseName: 'drop_wsl' + ob_artifactSuffix: '_test' + timeoutInMinutes: 360 + cancelTimeoutInMinutes: 420 + ${{ if eq(parameters.pool, '') }}: + pool: {'type': 'cloudtestagentless'} + + ${{ else }}: + pool: ${{ parameters.pool }} + steps: + - task: CloudTestServerBuildTask@2 + inputs: + DisplayName: "${{ parameters.version }} tests - ${{ parameters.branch }}" + connectedServiceName: "CloudTest-PROD" + cloudTestTenant: "wsl" + testMapLocation: 'testbin\x64\cloudtest\wsl-test-image-${{ parameters.image }}-${{ parameters.version}}\TestMap.xml' + pipelineArtifactName: "drop_wsl_build" + pipelineArtifactBuildUrl: '$(System.TaskDefinitionsUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)' + buildDropArtifactName: "" + timeoutInMinutes: 360 + sessionTimeout: 360 + cancelTimeoutInMinutes: 420 + TestTimeout: "0.05:00:00" + parserProperties: "worker:VsTestVersion=V150;session:HoldTrigger=Failure;VstsTestResultAttachmentUploadBehavior=Always" + notificationSubscribers: $(Build.RequestedForEmail) \ No newline at end of file diff --git a/.pipelines/test-stage.yml b/.pipelines/test-stage.yml new file mode 100644 index 000000000..b917bde9b --- /dev/null +++ b/.pipelines/test-stage.yml @@ -0,0 +1,53 @@ +parameters: + - name: rs_prerelease_only + type: boolean + default: false + + - name: includePackageStage + type: boolean + default: true + + - name: pool + type: string + default: '' + + - name: versions + type: object + default: + - wsl1 + - wsl2 + - wslc + + - name: test_images + type: object + default: + - name: rs_prerelease + image: rs_prerelease-2025-01-30 + - name: ni_release + image: win11-23h2-ent-2024-11-18 + - name: fe_release + image: 2022-datacenter-g2-2024-09-10 + server: true + - name: vb_release + image: win10-22h2-ent-g2-2024-09-10 + + # TODO: ge_release + +stages: +- stage: test + ${{ if parameters.includePackageStage }}: + dependsOn: [build_x64, package] + ${{ else }}: + dependsOn: [build_x64] + jobs: + - ${{ each version in parameters.versions }}: + - ${{ each image in parameters.test_images }}: + - template: test-job.yml@self + parameters: + branch: "${{ image.name }}" + version: ${{ version }} + image: "${{ image.image }}" + # Skip the WSLC suite on Server images: it triggers a Hyper-V VMBus + # PowerOff hang during VM teardown that times out the job. + run: ${{ and(or(not(parameters.rs_prerelease_only), eq(image.name, 'rs_prerelease')), or(ne(version, 'wslc'), ne(image.server, true))) }} + pool: "${{ parameters.pool }}" \ No newline at end of file diff --git a/.pipelines/wsl-build-nightly-localization.yml b/.pipelines/wsl-build-nightly-localization.yml new file mode 100644 index 000000000..908f3aa22 --- /dev/null +++ b/.pipelines/wsl-build-nightly-localization.yml @@ -0,0 +1,67 @@ +trigger: + branches: + include: + - master + paths: + include: + - 'localization/strings/en-US/Resources.resw' + - 'intune/en-US/WSL.adml' + +# Schedule nightly build +# Cron syntax: "mm HH DD MM DW" = minutes, hours, days, months, day of week (UTC time) +schedules: +# "0 8" = 8AM UTC = 12AM PST +- cron: "0 8 * * *" + displayName: Nightly Touchdown Build Schedule + branches: + include: + - "master" + always: true + +# Build.SourceBranchName is only the leaf segment of the ref (e.g. +# 'loc-pipeline-debug' for refs/heads/user/benhill/loc-pipeline-debug), which +# fails GitHub's pulls API with a 422 'base invalid' when the branch name +# contains slashes. Strip 'refs/heads/' from the full ref instead so the PR +# targets the actual branch the pipeline ran against. +variables: + targetBranch: $[ replace(variables['Build.SourceBranch'], 'refs/heads/', '') ] + +pool: + vmImage: 'windows-latest' + +steps: +- checkout : self + persistCredentials: true + +- task: TouchdownBuildTask@5 + displayName: Touchdown Build Localization + inputs: + environment: 'PRODEXT' + teamId: '38646' + serviceTreeId: 'd8846bef-e9b5-4542-bcfc-98ebabac8a7b' + authType: 'FederatedIdentity' + FederatedIdentityServiceConnection: 'Azure-Connection' + isPreview: false + resourceFilePath: | + localization\strings\en-US\Resources.resw;O:localization\strings\ + storebroker\PDPs\en-us\PDP.xml;O:storebroker\PDPs\ + intune\en-US\WSL.adml;O:intune\ + localizationTarget: true + pseudoSetting: 'Excluded' + cultureMappingType: 'None' + +- task: PipAuthenticate@1 + condition: and(succeeded(), in(variables['Build.Reason'], 'Schedule', 'Manual')) + inputs: + artifactFeeds: 'wsl' + +- powershell: | + pip install --user -r tools/devops/requirements.txt + python tools/devops/create-change.py . "$env:token" "WSL localization" "Localization change from build: $env:buildId" "user/localization/$env:buildId" "$env:targetBranch" + + displayName: Create pull request + condition: and(succeeded(), in(variables['Build.Reason'], 'Schedule', 'Manual')) + env: + token: $(GithubPRToken) + buildId: $(Build.BuildId) + targetBranch: $(targetBranch) \ No newline at end of file diff --git a/.pipelines/wsl-build-nightly-onebranch.yml b/.pipelines/wsl-build-nightly-onebranch.yml new file mode 100644 index 000000000..3d490f2dd --- /dev/null +++ b/.pipelines/wsl-build-nightly-onebranch.yml @@ -0,0 +1,57 @@ +trigger: none + +schedules: +# "0 8" = 8AM UTC = 12AM PST +- cron: "0 8 * * *" + displayName: Nightly build + branches: + include: [master] + always: true + +variables: + WindowsContainerImage: "onebranch.azurecr.io/windows/ltsc2022/vse2022:latest" + WindowsHostVersion: '1ESWindows2022' + ob_sdl_codeSignValidation_excludes: -|**\*.ps1 + +resources: + repositories: + - repository: templates + type: git + name: OneBranch.Pipelines/GovernedTemplates + ref: refs/heads/main + +extends: + template: v2/Microsoft.NonOfficial.yml@templates + parameters: + platform: + name: "windows_undocked" + featureFlags: + EnableCDPxPAT: false + WindowsHostVersion: 1ESWindows2022 + globalSdl: + credscan: + enabled: true + perStage: + credscan: + enabled: true + tsa: + enabled: false + git: + fetchDepth: -1 + fetchTags: true + + stages: + - template: build-stage.yml@self + parameters: + isRelease: false + isNightly: true + vsoOrg: microsoft + vsoProject: Microsoft.WSL + + - template: test-stage.yml@self + parameters: + rs_prerelease_only: false + + - template: nuget-stage.yml@self + parameters: + isNightly: true \ No newline at end of file diff --git a/.pipelines/wsl-build-notice.yml b/.pipelines/wsl-build-notice.yml new file mode 100644 index 000000000..7810d8424 --- /dev/null +++ b/.pipelines/wsl-build-notice.yml @@ -0,0 +1,37 @@ +trigger: + branches: + include: + - master + +variables: + targetBranch: $[ replace(variables['Build.SourceBranch'], 'refs/heads/', '') ] + +pool: + vmImage: 'windows-latest' + +steps: +- checkout : self + persistCredentials: true + +- task: ComponentGovernanceComponentDetection@0 + displayName: Component Detection + +- task: notice@0 + displayName: Generate NOTICE file + inputs: + outputfile: $(System.DefaultWorkingDirectory)/NOTICE.txt + outputformat: text + +- task: PipAuthenticate@1 + inputs: + artifactFeeds: 'wsl' + +- powershell: | + pip install --user -r tools/devops/requirements.txt + python tools/devops/create-change.py . "$env:token" "WSL notice" "Notice change from build: $env:buildId" "user/notice/$env:buildId" "$env:targetBranch" + + displayName: Create pull request + env: + token: $(GithubPRToken) + buildId: $(Build.BuildId) + targetBranch: $(targetBranch) \ No newline at end of file diff --git a/.pipelines/wsl-build-pr-onebranch.yml b/.pipelines/wsl-build-pr-onebranch.yml new file mode 100644 index 000000000..1eeea2473 --- /dev/null +++ b/.pipelines/wsl-build-pr-onebranch.yml @@ -0,0 +1,54 @@ +trigger: + branches: + include: + - master + - release/* + +variables: + WindowsContainerImage: "onebranch.azurecr.io/windows/ltsc2022/vse2022:latest" + WindowsHostVersion: '1ESWindows2022' + ob_sdl_codeSignValidation_excludes: -|**\*.ps1 + +resources: + repositories: + - repository: templates + type: git + name: OneBranch.Pipelines/GovernedTemplates + ref: refs/heads/main + +extends: + template: v2/Microsoft.NonOfficial.yml@templates + parameters: + platform: + name: "windows_undocked" + featureFlags: + EnableCDPxPAT: false + WindowsHostVersion: 1ESWindows2022 + globalSdl: + suppression: + suppressionFile: $(Build.SourcesDirectory)\.gdnsuppress + suppressionSet: default + apiscan: + enabled: false + credscan: + enabled: true + perStage: + credscan: + enabled: true + policheck: + enabled: true + break: true + severity: Note + git: + fetchDepth: -1 + fetchTags: true + + stages: + - template: build-stage.yml@self + parameters: + isRelease: false + + - template: test-stage.yml@self + parameters: + includePackageStage: false + rs_prerelease_only: true diff --git a/.pipelines/wsl-build-pr.yml b/.pipelines/wsl-build-pr.yml new file mode 100644 index 000000000..4a7e2d912 --- /dev/null +++ b/.pipelines/wsl-build-pr.yml @@ -0,0 +1,19 @@ +trigger: + branches: + include: + - master + - release/* + +stages: +- template: build-stage.yml@self + parameters: + isRelease: false + pool: 'wsl-build' + vsoOrg: shine-oss + vsoProject: wsl + +- template: test-stage.yml@self + parameters: + includePackageStage: false + rs_prerelease_only: true + pool: server diff --git a/.pipelines/wsl-build-release-onebranch.yml b/.pipelines/wsl-build-release-onebranch.yml new file mode 100644 index 000000000..896877679 --- /dev/null +++ b/.pipelines/wsl-build-release-onebranch.yml @@ -0,0 +1,82 @@ +parameters: +- name: bypassTests + displayName: 'Publish release even if tests fail' + type: boolean + default: false + +- name: testVersion + displayName: 'Test the release pipeline' + type: string + default: '' + +- name: nugetSuffix + displayName: 'Nuget version suffix (must include "-")' + type: string + default: '' + +trigger: + tags: + include: ['*.*.*'] + +variables: + WindowsContainerImage: "onebranch.azurecr.io/windows/ltsc2022/vse2022:latest" + WindowsHostVersion: '1ESWindows2022' + ob_sdl_codeSignValidation_excludes: -|**\*.ps1 + +resources: + repositories: + - repository: templates + type: git + name: OneBranch.Pipelines/GovernedTemplates + ref: refs/heads/main + +extends: + template: v2/Microsoft.Official.yml@templates + parameters: + platform: + name: "windows_undocked" + featureFlags: + EnableCDPxPAT: false + WindowsHostVersion: 1ESWindows2022 + globalSdl: + credscan: + enabled: true + codesign: + enabled: true + break: true + targetGlob: '**\*.dll;**\*.exe;**\*.sys;**\*.msi;**\*.msix;**\*.msixbundle;**\*.appx;**\*.nupkg' + perStage: + credscan: + enabled: true + tsa: + enabled: false + evidence: + enabled: false + git: + fetchDepth: -1 + fetchTags: true + + stages: + - template: build-stage.yml@self + parameters: + isRelease: true + packageVersion: ${{ iif(eq(parameters.testVersion, ''), variables['Build.SourceBranchName'], parameters.testVersion) }} + nugetSuffix: ${{ parameters.nugetSuffix }} + traceLoggingConfig: $(ReleaseTraceLoggingConfig) + vsoOrg: microsoft + vsoProject: Microsoft.WSL + + - template: test-stage.yml@self + parameters: + rs_prerelease_only: false + + - template: flight-stage.yml@self + parameters: + publishPackage: ${{ iif(eq(parameters.testVersion, ''), true, false) }} + packageVersion: ${{ iif(eq(parameters.testVersion, ''), variables['Build.SourceBranchName'], parameters.testVersion) }} + bypassTests: ${{ parameters.bypassTests }} + + - ${{ if or(eq(parameters.testVersion, ''), not(eq(parameters.nugetSuffix, ''))) }}: + - template: nuget-stage.yml@self + parameters: + isNightly: false \ No newline at end of file diff --git a/.vsconfig b/.vsconfig new file mode 100644 index 000000000..19229b943 --- /dev/null +++ b/.vsconfig @@ -0,0 +1,21 @@ +{ + "version": "1.0", + "components": [ + "Microsoft.Component.MSBuild", + "Microsoft.VisualStudio.Component.VC.CoreIde", + "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", + "Microsoft.VisualStudio.Component.VC.Tools.ARM64", + "Microsoft.VisualStudio.Component.VC.Tools.x86.x64.Spectre", + "Microsoft.VisualStudio.Component.VC.Tools.ARM64.Spectre", + "Microsoft.VisualStudio.Component.VC.ATL", + "Microsoft.VisualStudio.Component.VC.ATL.ARM64", + "Microsoft.VisualStudio.Component.VC.ATL.Spectre", + "Microsoft.VisualStudio.Component.VC.ATL.ARM64.Spectre", + "Microsoft.VisualStudio.Component.VC.Llvm.Clang", + "Microsoft.VisualStudio.Component.Windows11SDK.26100", + "Microsoft.VisualStudio.Component.UWP.VC.ARM64", + "Microsoft.VisualStudio.Workload.ManagedDesktop", + "Microsoft.VisualStudio.Workload.Universal", + "Microsoft.VisualStudio.Workload.NativeDesktop" + ] +} diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..4d6e9c1c9 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,562 @@ +cmake_minimum_required(VERSION 3.25) +set(CMAKE_SYSTEM_VERSION 10.0.26100.0) + +project(wsl) + +# Rationalize TARGET_PLATFORM +# When neither CMAKE_GENERATOR_PLATFORM nor TARGET_PLATFORM is set, default to the host architecture. +if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "" AND "${TARGET_PLATFORM}" STREQUAL "") + if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "ARM64") + set(TARGET_PLATFORM "arm64") + else() + set(TARGET_PLATFORM "x64") + endif() + message(STATUS "No platform specified, defaulting to '${TARGET_PLATFORM}' based on host architecture.") +endif() + +if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "arm64" OR "${TARGET_PLATFORM}" STREQUAL "arm64") + set(TARGET_PLATFORM "arm64") +elseif("${CMAKE_GENERATOR_PLATFORM}" MATCHES "x64|amd64" OR "${TARGET_PLATFORM}" MATCHES "x64|amd64") + set(TARGET_PLATFORM "x64") +else() + message(FATAL_ERROR "Unsupported platform: ${CMAKE_GENERATOR_PLATFORM}") +endif() + + +if (NOT ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION} STREQUAL ${CMAKE_SYSTEM_VERSION}) + message(FATAL_ERROR "Incorrect Windows SDK version: ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}, requires ${CMAKE_SYSTEM_VERSION}") +endif() + +# Default to debug build if unspecified (pipeline always passes -DCMAKE_BUILD_TYPE=Release) +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Debug") +endif() + +# Only generate the build configuration that CMake is configured for +set(CMAKE_CONFIGURATION_TYPES "${CMAKE_BUILD_TYPE}" CACHE STRING "" FORCE) + +# Configure output directories +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${TARGET_PLATFORM}) + +# BUNDLE_ONLY mode: skip all source builds; only configure the msixbundle target and nuspec files. +# Used by the package pipeline stage to create the bundle from pre-built per-platform msix files. +option(BUNDLE_ONLY "Only configure the msixbundle target, skip all source builds" OFF) +if (BUNDLE_ONLY) + if (NOT PACKAGE_VERSION) + message(FATAL_ERROR "PACKAGE_VERSION is required for BUNDLE_ONLY mode") + endif() + + if (NOT PACKAGE_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)\\.([0-9]+)$") + message(FATAL_ERROR "PACKAGE_VERSION is invalid: '${PACKAGE_VERSION}'") + endif() + + set(PACKAGE_SIGN_COMMAND echo Skipped package signing for:) + + add_subdirectory(nuget) + add_subdirectory(msixinstaller) + return() +endif() + +include(FetchContent) + +# Import GSL and nlohmannjson + +set(FETCHCONTENT_BASE_DIR ${CMAKE_BINARY_DIR}/_deps/${TARGET_PLATFORM}) + +# N.B. Changes to any of the FetchContent dependencies below (GSL, nlohmannjson) must be reflected in cgmanifest.json + +FetchContent_Declare(GSL + URL https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.tar.gz + URL_HASH SHA256=f0e32cb10654fea91ad56bde89170d78cfbf4363ee0b01d8f097de2ba49f6ce9) + +FetchContent_MakeAvailable(GSL) +FetchContent_GetProperties(GSL SOURCE_DIR GSL_SOURCE_DIR) + + +FetchContent_Declare(nlohmannjson + URL https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz + URL_HASH SHA256=42f6e95cad6ec532fd372391373363b62a14af6d771056dbfc86160e6dfff7aa ) + +FetchContent_MakeAvailable(nlohmannjson) +FetchContent_GetProperties(nlohmannjson SOURCE_DIR NLOHMAN_JSON_SOURCE_DIR) + +FetchContent_Declare(yaml-cpp + URL https://github.com/jbeder/yaml-cpp/releases/download/yaml-cpp-0.9.0/yaml-cpp-yaml-cpp-0.9.0.tar.gz + URL_HASH SHA256=298593d9c440fd9034b8b193d96318b76d49bc97c6ceadb7b0836edf0b6d7539) + +set(YAML_CPP_BUILD_TESTS OFF CACHE BOOL "" FORCE) +set(YAML_CPP_BUILD_TOOLS OFF CACHE BOOL "" FORCE) +set(YAML_CPP_BUILD_CONTRIB OFF CACHE BOOL "" FORCE) +set(YAML_MSVC_SHARED_RT OFF CACHE BOOL "" FORCE) +set(BUILD_TESTING OFF CACHE BOOL "" FORCE) # Prevents yaml-cpp from generating CTest* targets + +FetchContent_MakeAvailable(yaml-cpp) + +set(BOOST_VERSION "1.90.0") +set(BOOST_TARBALL "boost_${BOOST_VERSION}") +string(REPLACE "." "_" BOOST_TARBALL "${BOOST_TARBALL}") + +FetchContent_Declare( + boost_headers + URL https://archives.boost.io/release/${BOOST_VERSION}/source/${BOOST_TARBALL}.tar.gz + URL_HASH SHA256=5e93d582aff26868d581a52ae78c7d8edf3f3064742c6e77901a1f18a437eea9 +) + +FetchContent_MakeAvailable(boost_headers) + + +# Import modules +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") +find_package(IDL REQUIRED) +find_package(LINUXBUILD REQUIRED) +find_package(NUGET REQUIRED) +find_package(VERSION REQUIRED) +find_package(MC REQUIRED) +find_package(Appx REQUIRED) +find_package(CSharp REQUIRED) + +# Download nuget packages +restore_nuget_packages() + +# Load nuget packages versions and paths +parse_nuget_packages_versions() + +find_nuget_package(Microsoft.Direct3D.Linux DIRECT3D /build/native) +find_nuget_package(Microsoft.Identity.MSAL.WSL.Proxy MSAL /build/native/bin) +find_nuget_package(Microsoft.RemoteDesktop.Client.MSRDC.SessionHost MSRDC /build/native/bin) +find_nuget_package(Microsoft.Taef TAEF /) +find_nuget_package(Microsoft.Windows.ImplementationLibrary WIL /) +find_nuget_package(Microsoft.WSL.DeviceHost WSL_DEVICE_HOST /build/native) +find_nuget_package(Microsoft.WSL.Kernel KERNEL /build/native) +find_nuget_package(Microsoft.WSL.bsdtar BSDTARD /build/native/bin) +find_nuget_package(Microsoft.WSL.LinuxSdk LINUXSDK /) +find_nuget_package(Microsoft.WSL.TestDistro TEST_DISTRO /) +find_nuget_package(Microsoft.WSL.TestData WSL_TEST_DATA /) +find_nuget_package(Microsoft.WSLg WSLG /build/native/bin) +find_nuget_package(vswhere VSWHERE /tools) +find_nuget_package(Wix WIX /tools/net6.0/any) + +# Architecture-specific nuget packages from the OS repo. +if (${TARGET_PLATFORM} STREQUAL "x64") + find_nuget_package(Microsoft.DXCore.Linux.amd64fre DXCORE /build/native) + find_nuget_package(Microsoft.WSL.Dependencies.amd64fre WSLDEPS /build/native) +endif() + +if (${TARGET_PLATFORM} STREQUAL "arm64") + find_nuget_package(Microsoft.DXCore.Linux.arm64fre DXCORE /build/native) + find_nuget_package(Microsoft.WSL.Dependencies.arm64fre WSLDEPS /build/native) +endif() + +# Wsl Settings packages +find_nuget_package(CommunityToolkit.Mvvm CTK_MVVM /) +find_nuget_package(CommunityToolkit.WinUI.Animations CTK_ANIMATIONS /) +find_nuget_package(CommunityToolkit.WinUI.Controls.SettingsControls CTK_STTNGS_CTRLS /) +find_nuget_package(Microsoft.Extensions.Hosting EXTS_HOSTING /) +find_nuget_package(Microsoft.NETCore.App.Runtime.win-${TARGET_PLATFORM} DOTNET_RUNTIME /) +find_nuget_package(Microsoft.WindowsAppSDK WIN_APP_SDK /) +find_nuget_package(Microsoft.Windows.SDK.NET.Ref WINDOWS_SDK_DOTNET /) +find_nuget_package(Microsoft.Xaml.Behaviors.WinUI.Managed XAML_BEHAVIORS /) +find_nuget_package(WinUIEx WINUIEX /) + +# WSLC C# API packages +find_nuget_package(Microsoft.Windows.CsWinRT CSWINRT /) + +set(WSLG_TS_PLUGIN_DLL "WSLDVCPlugin.dll") + +set(SUPPORTED_LANGS cs-CZ;da-DK;de-DE;en-GB;en-US;es-ES;fi-FI;fr-FR;hu-HU;it-IT;ja-JP;ko-KR;nb-NO;nl-NL;pl-PL;pt-BR;pt-PT;ru-RU;sv-SE;tr-TR;zh-CN;zh-TW) + +if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/UserConfig.cmake") + find_package(USER REQUIRED PATHS ${CMAKE_CURRENT_LIST_DIR}) +endif() + +# Optional target configuration + +if (NOT DEFINED WSL_BUILD_WSL_SETTINGS) + set(WSL_BUILD_WSL_SETTINGS false) +endif () + +if (NOT DEFINED WSL_BUILD_SDKCS) + set(WSL_BUILD_SDKCS false) +endif () + +find_commit_hash(COMMIT_HASH) + +if (NOT PACKAGE_VERSION) + find_version(PACKAGE_VERSION WSL_NUGET_PACKAGE_VERSION) # Fetch the package version from git if not specified +endif () + +if (NOT PACKAGE_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)\\.([0-9]+)$") + message(FATAL_ERROR "PACKAGE_VERSION must be four dot-separated numeric components (e.g., '1.2.3.4'): got '${PACKAGE_VERSION}'") +endif() + +set(PACKAGE_VERSION_MAJOR ${CMAKE_MATCH_1}) +set(PACKAGE_VERSION_MINOR ${CMAKE_MATCH_2}) +set(PACKAGE_VERSION_REVISION ${CMAKE_MATCH_3}) + +# The store requires the revision number to be 0, so enforce this on official builds +if (OFFICIAL_BUILD AND NOT PACKAGE_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)\\.0$") + message(FATAL_ERROR "PACKAGE_VERSION is invalid: '${PACKAGE_VERSION}'. Needs to match '([0-9]+).([0-9]+).([0-9]+).0' for official builds") +endif() + +if (${TARGET_PLATFORM} STREQUAL "x64") + set(DCAT_PRODUCT_NAME WSL.amd64) +endif() + +if (${TARGET_PLATFORM} STREQUAL "arm64") + set(DCAT_PRODUCT_NAME WSL.arm64) +endif() + +set(DCAT_REGISTRATION_KEY "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Update\\TargetingInfo\\DynamicInstalled\\${DCAT_PRODUCT_NAME}") + +# Configure output directories +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${TARGET_PLATFORM}) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Release) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +# Packaging variables +set(BIN ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}) +file(MAKE_DIRECTORY ${BIN}) + +set (GENERATED_DIR ${CMAKE_BINARY_DIR}/generated) +file(MAKE_DIRECTORY ${GENERATED_DIR}) + +# Generate Source Link JSON so debuggers can fetch source from GitHub (pipeline builds only) +if (DEFINED PIPELINE_BUILD_ID) + set(SOURCELINK_JSON "${GENERATED_DIR}/sourcelink.json") + file(WRITE "${SOURCELINK_JSON}" "{\"documents\":{\"${CMAKE_SOURCE_DIR}/*\":\"https://raw.githubusercontent.com/microsoft/WSL/${COMMIT_HASH}/*\"}}") +endif() + +set(PACKAGE_CERTIFICATE ${GENERATED_DIR}/dev-cert.pfx) +file(CREATE_LINK ${WSLG_SOURCE_DIR}/${TARGET_PLATFORM}/${WSLG_TS_PLUGIN_DLL} ${BIN}/${WSLG_TS_PLUGIN_DLL}) +file(CREATE_LINK ${WSLDEPS_SOURCE_DIR}/bin/wsldeps.dll ${BIN}/wsldeps.dll) + +if (${SKIP_PACKAGE_SIGNING}) + set(PACKAGE_SIGN_COMMAND echo Skipped package signing for:) +else() + if (NOT EXISTS ${PACKAGE_CERTIFICATE}) + execute_process( + COMMAND powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File "${CMAKE_CURRENT_LIST_DIR}/tools/create-dev-cert.ps1" -OutputPath "${PACKAGE_CERTIFICATE}" + COMMAND_ERROR_IS_FATAL ANY) + endif() + + set(PACKAGE_SIGN_COMMAND SignTool.exe sign /a /v /fd SHA256 /f ${PACKAGE_CERTIFICATE}) +endif() + + +# Generate local test script +configure_file(${CMAKE_CURRENT_LIST_DIR}/tools/test/test.bat.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/test.bat) + +# Common build flags +set(CMAKE_CXX_STANDARD 20) + +if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") + set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDebug) +else() + set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded) +endif() + +if (${TARGET_PLATFORM} STREQUAL "x64") + add_compile_definitions(_AMD64_) + set(DISTRO_HOSTTYPE x86_64) +endif() + +if (${TARGET_PLATFORM} STREQUAL "arm64") + add_compile_definitions(_ARM64_) + set(DISTRO_HOSTTYPE aarch64) +endif() + +add_definitions(/sdl) # Default-initialize class members +add_definitions(/FS) # Enable parallel PDB access +add_compile_definitions(UNICODE + WIL_SUPPRESS_PRIVATE_API_USE + CPPWINRT_SUPPRESS_STATIC_INITIALIZERS + NOMINMAX + _CRT_SECURE_NO_WARNINGS + KERNEL_VERSION="${KERNEL_VERSION}" + WSLDEPS_VERSION="${WSLDEPS_VERSION}" + WSLG_VERSION="${WSLG_VERSION}" + WSLG_TS_PLUGIN_DLL=L"${WSLG_TS_PLUGIN_DLL}" + WSL_DEVICE_HOST_VERSION="${WSL_DEVICE_HOST_VERSION}" + COMMIT_HASH="${COMMIT_HASH}" + WSL_PACKAGE_VERSION="${PACKAGE_VERSION}" + MSRDC_VERSION="${MSRDC_VERSION}" + DIRECT3D_VERSION="${DIRECT3D_VERSION}" + DXCORE_VERSION="${DXCORE_VERSION}" + WSL_PACKAGE_VERSION_MAJOR=${PACKAGE_VERSION_MAJOR} + WSL_PACKAGE_VERSION_MINOR=${PACKAGE_VERSION_MINOR} + WSL_PACKAGE_VERSION_REVISION=${PACKAGE_VERSION_REVISION} + DISTRO_HOSTTYPE="${DISTRO_HOSTTYPE}" + WSL_BUILD_WSL_SETTINGS=${WSL_BUILD_WSL_SETTINGS} + DCAT_PRODUCT_NAME=R"\(${DCAT_PRODUCT_NAME}\)" + DCAT_REGISTRATION_KEY=R"\(${DCAT_REGISTRATION_KEY}\)") + +if (${OFFICIAL_BUILD}) + add_compile_definitions(WSL_OFFICIAL_BUILD) +endif() + +if (${WSL_BUILD_THIN_PACKAGE}) + add_compile_definitions(WSL_DEV_THIN_MSI_PACKAGE="${BIN}/wsl.msi") +endif () + +string(REPLACE "/Zi" "" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) # make sure /Zi is removed from the debug flags +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /W3 /WX /ZH:SHA_256") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Z7 -DDEBUG -DDBG") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi /guard:cf /Qspectre") + +# Linker flags +set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /debug:full /debugtype:cv,fixup /guard:cf /DYNAMICBASE") +set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /debug:full /debugtype:cv,fixup /guard:cf /DYNAMICBASE") +if (DEFINED SOURCELINK_JSON) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SOURCELINK:\"${SOURCELINK_JSON}\"") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SOURCELINK:\"${SOURCELINK_JSON}\"") +endif() +if (${TARGET_PLATFORM} STREQUAL "x64") + set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /CETCOMPAT") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /CETCOMPAT") +endif() + +# Common link libraries +link_directories(${WSLDEPS_SOURCE_DIR}/lib/) +set(COMMON_LINK_LIBRARIES + ws2_32.lib + Userenv.lib + RuntimeObject.lib + Pathcch.lib + ntdll.lib + RpcRT4.lib + Mswsock.lib + Shlwapi.lib + synchronization.lib + Bcrypt.lib + Crypt32.lib + icu.lib) + +set(MSI_LINK_LIBRARIES + Wintrust.lib + msi.lib) + +set(HCS_LINK_LIBRARIES + computecore.lib + computenetwork.lib + Iphlpapi.lib) + +set(SERVICE_LINK_LIBRARIES + MI.lib + wsldeps.lib) + +# Linux +if(${TARGET_PLATFORM} STREQUAL "" OR ${TARGET_PLATFORM} STREQUAL "x64") + set(LLVM_ARCH x86_64) +elseif(${TARGET_PLATFORM} STREQUAL "arm64") + set(LLVM_ARCH aarch64) +else() + message(FATAL_ERROR "Unsupported platform: '${TARGET_PLATFORM}'") +endif() + +# Determine the Visual Studio installation directory which contains LLVM tools. +# Supported versions: VS2022 and VS2026. +# Prefer VS2022 to keep local clang-format output aligned with pipeline expectations. +function(find_vs_install_dir VERSION_RANGE OUTPUT_VAR) + execute_process( + COMMAND "${VSWHERE_SOURCE_DIR}/vswhere.exe" -version "${VERSION_RANGE}" -products * -requires Microsoft.VisualStudio.Component.VC.Llvm.Clang -property installationPath -prerelease -latest + OUTPUT_VARIABLE _vs_install_dir + OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND_ERROR_IS_FATAL ANY + ) + + set(${OUTPUT_VAR} "${_vs_install_dir}" PARENT_SCOPE) +endfunction() + +find_vs_install_dir("[17.0,18.0)" VS_INSTALL_DIR) + +if (NOT VS_INSTALL_DIR) + find_vs_install_dir("[18.0,19.0)" VS_INSTALL_DIR) + if (VS_INSTALL_DIR) + message(WARNING "Visual Studio 2022 was not found; using Visual Studio 2026 instead. clang-format output may differ from pipeline expectations.") + endif() +endif() + +if (NOT VS_INSTALL_DIR) + message(FATAL_ERROR "Could not determine Visual Studio installation directory.") +endif() + +# Pick the first line returned from vswhere, in case multiple versions are returned. +# TODO: Remove this and require VS 2026 once the CI supports it. +string(REGEX MATCH "([^\n\r]+)" VS_INSTALL_DIR "${VS_INSTALL_DIR}") + +if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "AMD64") + set(LLVM_INSTALL_DIR "${VS_INSTALL_DIR}/VC/Tools/Llvm/x64/bin") +else() + set(LLVM_INSTALL_DIR "${VS_INSTALL_DIR}/VC/Tools/Llvm/${CMAKE_HOST_SYSTEM_PROCESSOR}/bin") +endif() + +if (NOT EXISTS ${LLVM_INSTALL_DIR}) + message(FATAL_ERROR "C++ Clang Compiler for Windows is not installed at ${LLVM_INSTALL_DIR}. Please install it from the Visual Studio Installer.") +endif() + +# Generate the clang-format script which contains a path to clang-format.exe +configure_file(${CMAKE_CURRENT_LIST_DIR}/tools/FormatSource.ps1.in ${CMAKE_BINARY_DIR}/FormatSource.ps1) + +# Pre-commit hook mode: warn (default), error, or fix +set(WSL_PRE_COMMIT_MODE "warn" CACHE STRING "Pre-commit hook behavior: warn, error, or fix") + +# Generate the pre-commit hook into the build tree +file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/tools/hooks) +configure_file(${CMAKE_CURRENT_LIST_DIR}/tools/hooks/pre-commit.in ${CMAKE_BINARY_DIR}/tools/hooks/pre-commit @ONLY) + +set(LINUXSDK_PATH ${LINUXSDK_SOURCE_DIR}/${LLVM_ARCH}) +set(LLVM_TARGET "${LLVM_ARCH}-unknown-linux-musl") +set(LINUX_CC ${LLVM_INSTALL_DIR}/clang.exe) +set(LINUX_CXX ${LLVM_INSTALL_DIR}/clang++.exe) +set(LINUX_AR ${LLVM_INSTALL_DIR}/llvm-ar.exe) +set(LINUX_COMMON_FLAGS --gcc-toolchain=${LINUXSDK_PATH} + -fpic + -B${LINUXSDK_PATH} + -isysroot ${LINUXSDK_PATH} + -isystem ${LINUXSDK_PATH}/include/c++/v1 + -isystem ${LINUXSDK_PATH}/include + -isystem ${GSL_SOURCE_DIR}/include + -isystem "${WSLDEPS_SOURCE_DIR}/include/lxcore" + -isystem "${WSLDEPS_SOURCE_DIR}/include/schemas" + -I "${CMAKE_CURRENT_LIST_DIR}/src/linux/inc" + -I "${CMAKE_CURRENT_LIST_DIR}/src/linux/mountutil" + -I "${CMAKE_CURRENT_LIST_DIR}/src/linux/plan9" + -I "${CMAKE_CURRENT_LIST_DIR}/src/shared/configfile" + -I "${CMAKE_CURRENT_LIST_DIR}/src/shared/inc" + -I "${NLOHMAN_JSON_SOURCE_DIR}/include" + -I "${CMAKE_BINARY_DIR}/generated" + --no-standard-libraries + -Werror + -Wall + -Wpointer-arith + -D_POSIX_C_SOURCE=200809L + -Dswprintf_s=swprintf + -fms-extensions + -target ${LLVM_TARGET} + -D_GNU_SOURCE=1 + -D_LARGEFILE64_SOURCE + -DWSL_PACKAGE_VERSION="${PACKAGE_VERSION}" + -DWSL_PACKAGE_VERSION_MAJOR=${PACKAGE_VERSION_MAJOR} + -DWSL_PACKAGE_VERSION_MINOR=${PACKAGE_VERSION_MINOR} + -DWSL_PACKAGE_VERSION_REVISION=${PACKAGE_VERSION_REVISION} + ) + +if (${TARGET_PLATFORM} STREQUAL "x64") + set(LINUX_COMMON_FLAGS ${LINUX_COMMON_FLAGS} -D_AMD64_) +endif() + +if (${TARGET_PLATFORM} STREQUAL "arm64") + set(LINUX_COMMON_FLAGS ${LINUX_COMMON_FLAGS} -D_ARM64_) +endif() + +set(LINUX_CXXFLAGS ${LINUX_COMMON_FLAGS} -std=c++20) +set(LINUX_CFLAGS ${LINUX_COMMON_FLAGS} -std=c99) + +string(TOLOWER ${CMAKE_BUILD_TYPE} build_type) +if (build_type STREQUAL debug) + set(LINUX_BUILD_TYPE_FLAGS -g3 -fno-inline-functions -DDEBUG -DDBG) +else() + set(LINUX_BUILD_TYPE_FLAGS -g -O2 -DNDEBUG) +endif() + +set(LINUX_LDFLAGS -target ${LLVM_TARGET} + --gcc-toolchain=${LINUXSDK_PATH} + -B${LINUXSDK_PATH} + -isysroot ${LINUXSDK_PATH} + -nostartfiles + --no-standard-libraries + -fuse-ld=lld.exe + -L${LINUXSDK_PATH}/lib + -L${LINUXSDK_PATH}/lib/linux + -L${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE} + -lclang_rt.builtins-${LLVM_ARCH} + -l:libc.a + -static) + +set(COMMON_LINUX_LINK_LIBRARIES configfile) +file(GLOB COMMON_LINUX_HEADERS CONFIGURE_DEPENDS "${CMAKE_CURRENT_LIST_DIR}/src/shared/inc/*.h") + +if(DEFINED ENV{WSL_DEV_BINARY_PATH}) + set(WSL_DEV_BINARY_PATH $ENV{WSL_DEV_BINARY_PATH}) +endif() + +if (DEFINED WSL_DEV_BINARY_PATH) # Development shortcut to make the package smaller + add_compile_definitions(WSL_SYSTEM_DISTRO_PATH="${WSL_DEV_BINARY_PATH}/system.vhd" + WSL_KERNEL_PATH="${WSL_DEV_BINARY_PATH}/kernel" + WSL_KERNEL_MODULES_PATH="${WSL_DEV_BINARY_PATH}/modules.vhd" + WSL_DEV_INSTALL_PATH="${WSL_DEV_BINARY_PATH}" + WSL_GPU_LIB_PATH="${WSL_DEV_BINARY_PATH}/lib") +endif() + +# Common include paths +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/wil/include) +include_directories(${boost_headers_SOURCE_DIR}) +include_directories(${WSLDEPS_SOURCE_DIR}/include) +include_directories(${WSLDEPS_SOURCE_DIR}/include/Windows) +include_directories(${WSLDEPS_SOURCE_DIR}/include/schemas) +include_directories(${WSLDEPS_SOURCE_DIR}/include/lxcore) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/shared/inc) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/windows/inc) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/src/windows/service/inc/${TARGET_PLATFORM}/${CMAKE_BUILD_TYPE}) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/src/windows/wslinstaller/inc/${TARGET_PLATFORM}/${CMAKE_BUILD_TYPE}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/linux/init/inc) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/windows/common) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/shared/configfile) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/localization) +include_directories(${CMAKE_BINARY_DIR}/generated) + +include_directories(${WIL_SOURCE_DIR}/include) +include_directories(${GSL_SOURCE_DIR}/include) +include_directories(${TAEF_SOURCE_DIR}/build/include) + +include_directories(${NLOHMAN_JSON_SOURCE_DIR}/include) +link_directories(${TAEF_SOURCE_DIR}/build/Library/${TARGET_PLATFORM}) +set(TAEF_LINK_LIBRARIES + TE.Common.lib + Wex.Common.lib + Wex.Logger.lib) + +# Subprojects +add_subdirectory(nuget) +add_subdirectory(msixgluepackage) +add_subdirectory(msipackage) +add_subdirectory(msixinstaller) +add_subdirectory(src/windows/common) +add_subdirectory(src/windows/service) +add_subdirectory(src/windows/wslcsession) +add_subdirectory(src/windows/wslinstaller/inc) +add_subdirectory(src/windows/wslinstaller/stub) +add_subdirectory(src/windows/wslinstaller/exe) +add_subdirectory(src/shared/configfile) +add_subdirectory(src/windows/wsl) +add_subdirectory(src/windows/wslg) +add_subdirectory(src/windows/wslhost) +add_subdirectory(src/windows/wslrelay) +add_subdirectory(src/windows/wslinstall) +add_subdirectory(src/windows/wslc) +add_subdirectory(src/windows/WslcSDK) + +if (WSL_BUILD_WSL_SETTINGS) + add_subdirectory(src/windows/libwsl) + add_subdirectory(src/windows/wslsettings) +endif() + +add_subdirectory(src/linux/netlinkutil) +add_subdirectory(src/linux/mountutil) +add_subdirectory(src/linux/plan9) +add_subdirectory(src/linux/init) +add_subdirectory(localization) + +add_subdirectory(test/windows) + +if (DEFINED PIPELINE_BUILD_ID) + add_subdirectory(cloudtest) +endif() + + +if(DEFINED ENV{WSL_POST_BUILD_COMMAND}) + set(WSL_POST_BUILD_COMMAND $ENV{WSL_POST_BUILD_COMMAND}) +endif () diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..f9ba8cf65 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,9 @@ +# Microsoft Open Source Code of Conduct + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). + +Resources: + +- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) +- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b244a9240..632ba51c7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,136 +1,170 @@ -Please provide as much information as possible when reporting a bug or filing an issue on the Windows Subsystem for Linux. +# WSL contributing guide -## Important: Reporting BSODs and Security issues -**Do not open Github issues for Windows crashes (BSODs) or security issues.**. Instead, send Windows crashes or other security-related issues to secure@microsoft.com. +There are a few main ways to contribute to WSL, with guides to each one: -## Reporting issues in Windows Console or WSL text rendering/user experience -Note that WSL distro's launch in the Windows Console (unless you have taken steps to launch a 3rd party console/terminal). Therefore, *please file UI/UX related issues in the [Windows Console issue tracker](https://github.com/microsoft/console)*. +1. [Add a feature or bugfix to WSL](#add-a-feature-or-bugfix-to-wsl) +2. [File a WSL issue](#file-a-wsl-issue) + +## Add a feature or bugfix to WSL + +We welcome any contributions to the WSL source code to add features or fix bugs! Before you start actually working on the feature, please **[file it as an issue, or a feature request in this repository](https://github.com/microsoft/WSL/issues)** so that we can track it and provide any feedback if necessary. + +Once you have done so, please see [the developer docs](./doc/docs/dev-loop.md) for instructions on how to build WSL locally on your machine for development. + +When your fix is ready, please [submit it as a pull request in this repository](https://github.com/microsoft/WSL/pulls) and the WSL team will triage and respond to it. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. + +## File a WSL issue + +You can file issues for WSL at the WSL repository, or linked repositories. Before filing an issue please search for any existing issues and upvote or comment on those if possible. + +1. If your issue is related to WSL documentation, please file it at [microsoftdocs/wsl](https://github.com/microsoftdocs/WSL/issues) +2. If your issue is related to a Linux GUI app, please file it at [microsoft/wslg](https://github.com/microsoft/wslg/issues) +3. Otherwise, if you have a technical issue related to WSL in general, such as start up issues, etc., please file it at [microsoft/wsl](https://github.com/microsoft/WSL/issues) + +Please provide as much information as possible when reporting a bug or filing an issue on the Windows Subsystem for Linux, and be sure to include logs as necessary! -## Reporting issues in WSL -A well written bug will follow the following template: +Please see the [notes for collecting WSL logs](#notes-for-collecting-wsl-logs) section below for more info on filing issues. -### 1) Issue Title -A title succinctly describing the issue. +## Thank you -#### Example: -`Traceroute not working.` +Thank you in advance for your contribution! We appreciate your help in making WSL a better tool for everyone. -### 2) Windows version / build number -Your Windows build number. This can be gathered from the CMD prompt using the `ver` command. +## Notes for collecting WSL logs + +### Important: Reporting BSODs and Security issues +**Do not open GitHub issues for Windows crashes (BSODs) or security issues.** Instead, send Windows crashes or other security-related issues to secure@microsoft.com. +See the `10) Reporting a Windows crash (BSOD)` section below for detailed instructions. + +### Reporting issues in Windows Console or WSL text rendering/user experience +Note that WSL distro's launch in the Windows Console (unless you have taken steps to launch a 3rd party console/terminal). Therefore, *please file UI/UX related issues in the [Windows Console issue tracker](https://github.com/microsoft/console)*. + +### Collect WSL logs for networking issues + +Install iptables and tcpdump in your WSL distribution using the following commands. +Note: This will not work if WSL has Internet connectivity issues. ``` -C:\> ver -Microsoft Windows [Version 10.0.14385] +# sudo apt-get update +# sudo apt-get -y install iptables tcpdump ``` -Note: The Windows Insider builds contain many updates and fixes. If you are running on the Creators Update (10.0.15063) please check to see if your issue has been resolved in a later build. If you are running on the Anniversary Update (10.0.14393), please try updating to the Creators Update. +Install [WPR](https://learn.microsoft.com/windows-hardware/test/wpt/windows-performance-recorder) -#### Example: +To collect WSL networking logs, do the following steps in an administrative powershell prompt: -`Microsoft Windows [Version 10.0.16170]` +``` +Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1 +Set-ExecutionPolicy Bypass -Scope Process -Force +.\collect-wsl-logs.ps1 -LogProfile networking +``` +The script will output when log collection starts. Reproduce the problem, then press any key to stop the log collection. +The script will output the path of the log file once done. -### 3) Steps required to reproduce +For additional network creation logs (restarts WSL), use: +``` +.\collect-wsl-logs.ps1 -LogProfile networking -RestartWslReproMode +``` -Should include all packages and environmental variables as well as other required configuration. + +
+
+ -#### Example: -`$ sudo apt-get install traceroute && traceroute www.microsoft.com` +### Collect WSL logs (recommended method) -### 4) Copy of the terminal output +If you choose to email these logs instead of attaching them to the bug, please send them to wsl-gh-logs@microsoft.com with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body. -#### Example: +To collect WSL logs, download and execute [collect-wsl-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1) in an administrative powershell prompt: ``` -$ traceroute www.microsoft.com -traceroute to www.microsoft.com (23.75.239.28), 30 hops max, 60 byte packets -setsockopt IP_MTU_DISCOVER: Invalid argument +Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1 +Set-ExecutionPolicy Bypass -Scope Process -Force +.\collect-wsl-logs.ps1 ``` +The script will output the path of the log file once done. -### 5) Expected Behavior +For specific scenarios, you can use different log profiles: +- `.\collect-wsl-logs.ps1 -LogProfile storage` - Enhanced storage tracing +- `.\collect-wsl-logs.ps1 -LogProfile networking` - Comprehensive networking tracing (includes packet capture, tcpdump, etc.) +- `.\collect-wsl-logs.ps1 -LogProfile networking -RestartWslReproMode` - Networking tracing with WSL restart for network creation logs +- `.\collect-wsl-logs.ps1 -LogProfile hvsocket` - HvSocket-specific tracing -What was the expected result of the command? Include examples / documentation if possible. +### 10) Reporting a Windows crash (BSOD) -### 6) Strace of the failing command - -Run the failing command under [strace](http://manpages.ubuntu.com/manpages/wily/man1/strace.1.html). Normal command structure is: +To collect a kernel crash dump, first run the following command in an elevated command prompt: ``` -$ strace -ff +reg.exe add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl /v AlwaysKeepMemoryDump /t REG_DWORD /d 1 /f ``` -> Note: `strace` can produce lengthy output. If the generated trace is more than about 20 lines please paste this into a [Gist](https://gist.github.com/) or another paste service and link in the bug. +Then reproduce the issue, and let the machine crash and reboot. + +After reboot, the kernel dump will be in `%SystemRoot%\MEMORY.DMP` (unless this path has been overridden in the advanced system settings). + +Please send this dump to: secure@microsoft.com . +Make sure that the email body contains: + +- The GitHub issue number, if any +- That this dump is intended for the WSL team -#### Example: +### 11) Reporting a WSL process crash + +The easiest way to report a WSL process crash is by [collecting a user-mode crash dump](https://learn.microsoft.com/windows/win32/wer/collecting-user-mode-dumps). + +To collect dumps of all running WSL processes, please open a PowerShell prompt with admin privileges, navigate to a folder where you'd like to put your log files and run these commands: ``` -$ strace traceroute www.microsoft.com -execve("/usr/bin/traceroute", ["traceroute", "www.microsoft.com"], [/* 22 vars */]) = 0 -brk(0) = 0x7fffdd3bc000 -access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) -mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1f4e820000 -access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) -... -... -... +Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1 +Set-ExecutionPolicy Bypass -Scope Process -Force +.\collect-wsl-logs.ps1 -Dump ``` -### 7) Additional information +The script will output the path to the log file when it is done. -Some bugs require additional information such as scripts to reproduce. Please add to this section. +#### Enable automatic crash dump collection -If there are files required, email the files to InsiderSupport@microsoft.com with: +If your crash is sporadic or hard to reproduce, please enable automatic crash dumps to catch logs for this behavior: -* **Subject**: Forward to WSL Team - RE: github issue -* **Body**: "Please forward to WSL Team" and include your attachment. +``` +md C:\crashes +reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" /f +reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" /v DumpFolder /t REG_EXPAND_SZ /d C:\crashes /f +reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" /v DumpType /t REG_DWORD /d 2 /f +``` -Common files are: +Crash dumps will then automatically be written to C:\crashes. -* Memory dumps found under C:\Windows\MEMORY.DMP -* Additional strace logs if the error occurs within a fork. The following - command generates an output file for every fork created: +Once you're done, crash dump collection can be disabled by running the following command in an elevated command prompt: ``` -$ strace -ff -o +reg.exe delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" /f ``` - -
-
-### 8) Collect WSL logs -To collect WSL logs follow these steps: +### 12) Collect wslservice time travel debugging traces + +To collect time travel debugging traces: -#### Open Feedback Hub and enter the title and description of your issue +1) [Install WinDbg preview](https://apps.microsoft.com/store/detail/windbg-preview/9PGJGD53TN86?hl=en-us&gl=us&rtc=1) -- Open Feedback hub and create a new issue by pressing `Windows Key + F` on your keyboard. -- Enter in the details of your issue: - - In `Summarize your feedback` copy and paste in the title of your Github Issue - - In `Explain in more detail` copy and paste a link to your Github Issue +2) Open WinDbg preview as administrator by running `windbgx` in an elevated command prompt -![GIF Of networking instructions](img/networkinglog1.gif) +3) Navigate to `file` -> `Attach to process` -#### Choose the WSL category +4) Check `Record with Time Travel Debugging` (at the bottom right) -- Select that your issue is a `Problem` -- Choose the `Developer Platform` category and the `Windows Subsystem for Linux` subcategory +4) Check `Show processes from all users` (at the bottom) -![GIF Of networking instructions](img/networkinglog2.gif) +5) Select `wslservice.exe`. Note, if wslservice.exe is not running, you make it start it with: `wsl.exe -l` -#### Recreate your problem in the 'Additional Details' section +6) Click `Configure and Record` (write down the folder you chose for the traces) -- Select 'Other' under 'Which of the following best describes your problem' -- Click 'Recreate My Problem' under 'Attachments -- Ensure that `Include Data About:` is checked to 'Windows Subsystem for Linux' -- 'Click Start Recording' to start collecting logs -- Recreate your problem -- Click 'Stop Recording' +7) Reproduce the issue -![GIF Of networking instructions](img/networkinglog3.gif) +8) Go back to WinDbg and click `Stop and Debug` -#### Check your attachments and submit +9) Once the trace is done collecting, click `Stop Debugging` and close WinDbg -- Verify your recording is attached and whether you would like to send the screenshot that is automatically attached -- Hit Submit -- Get a link to your feedback item by clicking on 'Share my Feedback' and post that link to the Github thread so we can easily get to your feedback! +10) Go to the folder where the trace was collected, and locate the .run file. It should look like: `wslservice*.run` -![GIF Of networking instructions](img/networkinglog4.gif) +11) Share that file on the issue diff --git a/DATA_AND_PRIVACY.md b/DATA_AND_PRIVACY.md new file mode 100644 index 000000000..a004ea291 --- /dev/null +++ b/DATA_AND_PRIVACY.md @@ -0,0 +1,18 @@ +# WSL data & privacy + +## Overview + +WSL collects diagnostic data using Windows telemetry, just like other Windows components. You can disable this by opening Windows Settings, navigating to Privacy and Security -> Diagnostics & Feedback and disabling 'Diagnostic data'. You can also view all diagnostic data that you are sending in that menu using the 'View diagnostic data' option. + +For more information please read the [Microsoft privacy statement](https://www.microsoft.com/privacy/privacystatement). + +## What does WSL collect? + +1. Usage + - Understanding what features and settings are most often used in WSL helps us make decisions on where to focus our time and energy. +2. Stability + - Monitoring bugs and system crashes assists us in prioritizing the most urgent issues. +3. Performance + - Assessing the performance of WSL gives us an understanding of what runtimes / components could be causing slow downs. This supports our commitment in providing you a speedy and effective WSL. + +You can search for WSL telemetry events by looking for calls to `WSL_LOG_TELEMETRY` in the source code of this repository. \ No newline at end of file diff --git a/Directory.Build.Props b/Directory.Build.Props new file mode 100644 index 000000000..260090628 --- /dev/null +++ b/Directory.Build.Props @@ -0,0 +1,11 @@ + + + true + true + + + + true + + + \ No newline at end of file diff --git a/Images/LargeTile.scale-100.png b/Images/LargeTile.scale-100.png new file mode 100644 index 000000000..7bb1420f6 Binary files /dev/null and b/Images/LargeTile.scale-100.png differ diff --git a/Images/SettingsOOBECrossOSFileAccess.gif b/Images/SettingsOOBECrossOSFileAccess.gif new file mode 100644 index 000000000..b63446e35 Binary files /dev/null and b/Images/SettingsOOBECrossOSFileAccess.gif differ diff --git a/Images/SettingsOOBEDistroManagement.png b/Images/SettingsOOBEDistroManagement.png new file mode 100644 index 000000000..bcd00fd56 Binary files /dev/null and b/Images/SettingsOOBEDistroManagement.png differ diff --git a/Images/SettingsOOBEDockerDesktopIntegration.png b/Images/SettingsOOBEDockerDesktopIntegration.png new file mode 100644 index 000000000..c8eb59df5 Binary files /dev/null and b/Images/SettingsOOBEDockerDesktopIntegration.png differ diff --git a/Images/SettingsOOBEDockerIcon.png b/Images/SettingsOOBEDockerIcon.png new file mode 100644 index 000000000..ba6847c2f Binary files /dev/null and b/Images/SettingsOOBEDockerIcon.png differ diff --git a/Images/SettingsOOBEFileExplorerIcon.png b/Images/SettingsOOBEFileExplorerIcon.png new file mode 100644 index 000000000..36dc69076 Binary files /dev/null and b/Images/SettingsOOBEFileExplorerIcon.png differ diff --git a/Images/SettingsOOBEGPUAcceleration.gif b/Images/SettingsOOBEGPUAcceleration.gif new file mode 100644 index 000000000..4201c2cd0 Binary files /dev/null and b/Images/SettingsOOBEGPUAcceleration.gif differ diff --git a/Images/SettingsOOBEGUIApps.png b/Images/SettingsOOBEGUIApps.png new file mode 100644 index 000000000..cb750ac76 Binary files /dev/null and b/Images/SettingsOOBEGUIApps.png differ diff --git a/Images/SettingsOOBEGeneral.png b/Images/SettingsOOBEGeneral.png new file mode 100644 index 000000000..32aaa8124 Binary files /dev/null and b/Images/SettingsOOBEGeneral.png differ diff --git a/Images/SettingsOOBENetworkingIntegration.png b/Images/SettingsOOBENetworkingIntegration.png new file mode 100644 index 000000000..8381e3005 Binary files /dev/null and b/Images/SettingsOOBENetworkingIntegration.png differ diff --git a/Images/SettingsOOBEVSCodeIcon.png b/Images/SettingsOOBEVSCodeIcon.png new file mode 100644 index 000000000..38412416a Binary files /dev/null and b/Images/SettingsOOBEVSCodeIcon.png differ diff --git a/Images/SettingsOOBEVSCodeIntegration.png b/Images/SettingsOOBEVSCodeIntegration.png new file mode 100644 index 000000000..75d813a51 Binary files /dev/null and b/Images/SettingsOOBEVSCodeIntegration.png differ diff --git a/Images/SettingsOOBEVSIcon.png b/Images/SettingsOOBEVSIcon.png new file mode 100644 index 000000000..9b3f489c5 Binary files /dev/null and b/Images/SettingsOOBEVSIcon.png differ diff --git a/Images/SettingsOOBEVSIntegration.png b/Images/SettingsOOBEVSIntegration.png new file mode 100644 index 000000000..cc5516f75 Binary files /dev/null and b/Images/SettingsOOBEVSIntegration.png differ diff --git a/Images/SmallTile.scale-100.png b/Images/SmallTile.scale-100.png new file mode 100644 index 000000000..6a7ea0679 Binary files /dev/null and b/Images/SmallTile.scale-100.png differ diff --git a/Images/SplashScreen.scale-100.png b/Images/SplashScreen.scale-100.png new file mode 100644 index 000000000..99550aa6d Binary files /dev/null and b/Images/SplashScreen.scale-100.png differ diff --git a/Images/Square150x150Logo.scale-100.png b/Images/Square150x150Logo.scale-100.png new file mode 100644 index 000000000..c70923919 Binary files /dev/null and b/Images/Square150x150Logo.scale-100.png differ diff --git a/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png b/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png new file mode 100644 index 000000000..e83a109f7 Binary files /dev/null and b/Images/Square44x44Logo.altform-lightunplated_targetsize-16.png differ diff --git a/Images/Square44x44Logo.altform-lightunplated_targetsize-24.png b/Images/Square44x44Logo.altform-lightunplated_targetsize-24.png new file mode 100644 index 000000000..4d438ac65 Binary files /dev/null and b/Images/Square44x44Logo.altform-lightunplated_targetsize-24.png differ diff --git a/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png b/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png new file mode 100644 index 000000000..dba6db476 Binary files /dev/null and b/Images/Square44x44Logo.altform-lightunplated_targetsize-256.png differ diff --git a/Images/Square44x44Logo.altform-lightunplated_targetsize-32.png b/Images/Square44x44Logo.altform-lightunplated_targetsize-32.png new file mode 100644 index 000000000..b69075a97 Binary files /dev/null and b/Images/Square44x44Logo.altform-lightunplated_targetsize-32.png differ diff --git a/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png b/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png new file mode 100644 index 000000000..6e3e94a49 Binary files /dev/null and b/Images/Square44x44Logo.altform-lightunplated_targetsize-48.png differ diff --git a/Images/Square44x44Logo.altform-unplated_targetsize-16.png b/Images/Square44x44Logo.altform-unplated_targetsize-16.png new file mode 100644 index 000000000..e83a109f7 Binary files /dev/null and b/Images/Square44x44Logo.altform-unplated_targetsize-16.png differ diff --git a/Images/Square44x44Logo.altform-unplated_targetsize-256.png b/Images/Square44x44Logo.altform-unplated_targetsize-256.png new file mode 100644 index 000000000..dba6db476 Binary files /dev/null and b/Images/Square44x44Logo.altform-unplated_targetsize-256.png differ diff --git a/Images/Square44x44Logo.altform-unplated_targetsize-32.png b/Images/Square44x44Logo.altform-unplated_targetsize-32.png new file mode 100644 index 000000000..b69075a97 Binary files /dev/null and b/Images/Square44x44Logo.altform-unplated_targetsize-32.png differ diff --git a/Images/Square44x44Logo.altform-unplated_targetsize-48.png b/Images/Square44x44Logo.altform-unplated_targetsize-48.png new file mode 100644 index 000000000..6e3e94a49 Binary files /dev/null and b/Images/Square44x44Logo.altform-unplated_targetsize-48.png differ diff --git a/Images/Square44x44Logo.scale-100.png b/Images/Square44x44Logo.scale-100.png new file mode 100644 index 000000000..d01623cf3 Binary files /dev/null and b/Images/Square44x44Logo.scale-100.png differ diff --git a/Images/Square44x44Logo.targetsize-16.png b/Images/Square44x44Logo.targetsize-16.png new file mode 100644 index 000000000..e83a109f7 Binary files /dev/null and b/Images/Square44x44Logo.targetsize-16.png differ diff --git a/Images/Square44x44Logo.targetsize-24.png b/Images/Square44x44Logo.targetsize-24.png new file mode 100644 index 000000000..4d438ac65 Binary files /dev/null and b/Images/Square44x44Logo.targetsize-24.png differ diff --git a/Images/Square44x44Logo.targetsize-24_altform-unplated.png b/Images/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 000000000..4d438ac65 Binary files /dev/null and b/Images/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/Images/Square44x44Logo.targetsize-256.png b/Images/Square44x44Logo.targetsize-256.png new file mode 100644 index 000000000..dba6db476 Binary files /dev/null and b/Images/Square44x44Logo.targetsize-256.png differ diff --git a/Images/Square44x44Logo.targetsize-32.png b/Images/Square44x44Logo.targetsize-32.png new file mode 100644 index 000000000..b69075a97 Binary files /dev/null and b/Images/Square44x44Logo.targetsize-32.png differ diff --git a/Images/Square44x44Logo.targetsize-48.png b/Images/Square44x44Logo.targetsize-48.png new file mode 100644 index 000000000..6e3e94a49 Binary files /dev/null and b/Images/Square44x44Logo.targetsize-48.png differ diff --git a/Images/StoreLogo.scale-100.png b/Images/StoreLogo.scale-100.png new file mode 100644 index 000000000..2e4bb21d4 Binary files /dev/null and b/Images/StoreLogo.scale-100.png differ diff --git a/Images/Wide310x150Logo.scale-100.png b/Images/Wide310x150Logo.scale-100.png new file mode 100644 index 000000000..df78892e9 Binary files /dev/null and b/Images/Wide310x150Logo.scale-100.png differ diff --git a/Images/wsl.ico b/Images/wsl.ico new file mode 100644 index 000000000..1340c2521 Binary files /dev/null and b/Images/wsl.ico differ diff --git a/Images/wslbw.ico b/Images/wslbw.ico new file mode 100644 index 000000000..c9b9a1c47 Binary files /dev/null and b/Images/wslbw.ico differ diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..9e841e7a2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/NOTICE.txt b/NOTICE.txt new file mode 100644 index 000000000..0cf170bf7 --- /dev/null +++ b/NOTICE.txt @@ -0,0 +1,752 @@ +NOTICES AND INFORMATION +Do Not Translate or Localize + +This software incorporates material from third parties. +Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com, +or you may send a check or money order for US $5.00, including the product name, +the open source component name, platform, and version number, to: + +Source Code Compliance Team +Microsoft Corporation +One Microsoft Way +Redmond, WA 98052 +USA + +Notwithstanding any other terms, you may reverse engineer this software to the extent +required to debug changes to any libraries licensed under the GNU Lesser General Public License. + +--------------------------------------------------------- + +llvm/llvm-project d32170dbd5b0d54436537b6b75beaf44324e0c28 - Apache-2.0 WITH LLVM-exception + + +(c) (tm) +(c) Value A +(c) auto AS +(c) Value Sd +(c) auto AST +(c) CXType PT +(c) Type I1Ty +(c) Value RHS +(c) X1 ... X1 +(c) Type I32Ty +(c) Value Elt0 +Copyright 2014 +(c) Type Int8Ty +(c) Type V8x8Ty +(c) Value FMSub +(c) unsigned AS +(c) Constant One +(c) Type FloatTy +(c) Type Int16Ty +(c) Type Int32Ty +(c) Type Int64Ty +(c) Value AllocA +(c) Value Alloca +Alloc1 a1 (c) R1 +Alloc1 a2 (c) R1 +(c) FileID MainID +(c) Lower C Upper +(c) Stmt NumExprs +(c) Type DoubleTy +(c) Type I32PtrTy +(c) Value AllocaA +Coproc, Opc1, CRm +(c) ConstantInt C2 +(c) EUR CHECK-NEXT +(c) Scale 1 Offset +(c) State UNQUOTED +(c) Type IndexType +Copyright (c) 2012 +Copyright (c) 2013 +Copyright (c) 2019 +Exprs new (c) Stmt +(c) ExprResult NewE +(c) Metadata Ops MD +(c) SelectInst SelI +(c) SmallVector MDs +(c) TransferBatch B +(c) Type Int32PtrTy +(c) Type Int64PtrTy +(c) BasicBlock Entry +(c) CXXRecordDecl CD +(c) FunctionType FTy +(c) Offset C- Offset +Copyright 2010 INRIA +Copyright 2011 INRIA +Copyright 2012 INRIA +Copyright 2014 INRIA +Copyright 2015 INRIA +Copyright 2016 INRIA +(c) FunctionType FnTy +(c) QualType ResultTy +(c) SourceRange Range +AsmToks new (c) Token +SubExprs new (c) Stmt +(c) 2008 Red Hat, Inc. +(c) 2011 Anthony Green +(c) BasicBlock EntryBB +(c) FunctionType FFnTy +(c) FunctionType IFnTy +(c) SourceLocation Loc +Condition (c) Branches +Context (c) LineToUnit +Copyright (c) 2013 IBM +(c) ErrMsg Stream Error +(c) SmallVector NewVars +(c) SmallVector ToErase +Bbb kind copyright' Bbb +(c) Constant PosDivisorC +CommonPtr new (c) Common +Copyright (c) 2012 CHECK +(c) CharUnits AlignedSize +(c) Constant NullV2I32Ptr +(c) Constant PosDividendC +Copyright 2010-2011 INRIA +Copyright 2014-2015 INRIA +COPYRIGHT,v 1.3 2003/06/02 +Coproc, Opc1, Rt, Rt2, CRm +Copyright 2003 Google Inc. +Copyright 2008 Google Inc. +Copyright 2009 Google Inc. +Copyright 2015 Google Inc. +Copyright 2018 Google Inc. +Copyright The LLVM project +coprime. APInt A HugePrime +copyrighted by the author. +(c) IdentifierInfo NumExprs +(c) VectorType Int8PtrVecTy +(c) Willem van Schaik, 1999 +Copyright (c) 1997, Phillip +Copyright 2005, Google Inc. +Copyright 2006, Google Inc. +Copyright 2007, Google Inc. +Copyright 2008, Google Inc. +Copyright 2012 Google, Inc. +Copyright 2013, Google Inc. +Copyright 2015, Google Inc. +InitCache (c) TransferBatch +copyright u'2015, LLVM Team +Copyright 2006, Dean Edwards +(c) CHECK-NEXT 194 CHECK-NEXT +(c) CXXBaseSpecifier NumBases +(c) Designator NumDesignators +(c) StringLiteral NumClobbers +Constraints new (c) StringRef +Copyright (c) 2002 Bo Thorsen +Copyright (c) 2010 Apple Inc. +Copyright (c) by P.J. Plauger +Copyright 2010 Zencoder, Inc. +Copyright 2017 Roman Lebedev. +ParamInfo new (c) ParmVarDecl +Copyright (c) 2000 Software AG +Copyright (c) 2002 Roger Sayle +Copyright (c) 2008 David Daney +Copyright (c) 2009 Google Inc. +Copyright (c) 2016 Aaron Watry +Copyright (c) 2017 Google Inc. +Copyright (c) 2018 Jim Ingham. +Copyright 2009 The Go Authors. +Copyright 2010 The Go Authors. +Copyright 2011 The Go Authors. +Copyright 2012 The Go Authors. +Copyright 2013 The Go Authors. +Copyright 2014 The Go Authors. +Copyright 2015 The Go Authors. +(c) (3) educational corporation +(c) CHECK-NEXT foo() CHECK-NEXT +(copr0) ConstantDataVector CDV1 +(copr1) ConstantDataVector CDV2 +Copyright (c) 1994 X Consortium +Copyright (c) 2008 Matteo Frigo +Copyright (c) 2009 Matteo Frigo +Copyright (c) 2010 CodeSourcery +Copyright (c) 2011 Kyle Moffett +Copyright (c) 2011 Tilera Corp. +Copyright (c) 2011 Timothy Wall +Copyright (c) 2012 Peter Harris +Copyright (c) 2012 Tilera Corp. +Copyright 2008-2010 Apple, Inc. +Copyright 2015 Sven Verdoolaege +Copyright 2016 Sven Verdoolaege +Copyright 2017 Sven Verdoolaege +Copyright 2018 Sven Verdoolaege +Copyright, License, and Patents +Other Coprocessor Instructions. +(c) StringLiteral NumConstraints +Copyright (c) 1996 Red Hat, Inc. +Copyright (c) 2002 Ranjit Mathew +Copyright (c) 2004 Anthony Green +Copyright (c) 2004 Simon Posnjak +Copyright (c) 2008 Anthony Green +Copyright (c) 2008 Red Hat, Inc. +Copyright (c) 2011 Anthony Green +Copyright (c) 2012 Anthony Green +Copyright (c) 2014 Red Hat, Inc. +Copyright 2011 Sven Verdoolaege. +(c) foo() pragma omp target teams +Copyright (c) 1992 Henry Spencer. +Copyright (c) 2000 John Hornkvist +Copyright (c) 2001 John Hornkvist +Copyright (c) 2006 Kirill Simonov +Copyright (c) 2012 Alan Hourihane +Copyright 2001-2004 Unicode, Inc. +copyright u'2003- d, LLVM Project +copyright u'2011- d, LLVM Project +(c) CyclesSaved + LocalCyclesSaved +Copyright (c) 1999-2007 Apple Inc. +Copyright (c) 2009 The Go Authors. +Copyright (c) 2009-2019 Polly Team +Copyright (c) 2012 Thorsten Glaser +Copyright (c) 2013 Tensilica, Inc. +Copyright 2012 Universiteit Leiden +Copyright 2016-2017 Tobias Grosser +copyright u'2007- d, The LLDB Team +copyright u'2013- d, Analyzer Team +Constraint new (c) AtomicConstraint +Copyright (c) 1998 Cygnus Solutions +Copyright (c) 1998 Geoffrey Keating +Copyright (c) 2001 David E. O'Brien +Copyright (c) 2013 Mentor Graphics. +Copyright (c) 2015the LLVM Project. +Copyright 2009-2010 The Go Authors. +copyright u'2007- d, The Clang Team +copyright u'2010- d, The Polly Team +copyright u'2011-2018, LLVM Project +Copyright (C ) Microsoft Corporation +Copyright (c) 2000, 2007 Software AG +Copyright (c) 2001 Alexander Peslyak +Copyright (c) 2012, 2013 Xilinx, Inc +Copyright (c) 2014, 2015 Google Inc. +Copyright (c) 2019 The MLIR Authors. +Copyright (c) Microsoft Corporation. +Copyright 2009, 2010 The Go Authors. +Copyright 2015-2016 Sven Verdoolaege +Copyright 2016, 2017 Tobias Grosser. +Copyright 2016-2017 Sven Verdoolaege +(c) PointerType InitPtrType InitValue +Copyright (c) 1996-2003 Red Hat, Inc. +Copyright (c) 1996-2004 Red Hat, Inc. +Copyright (c) 1999-2003 Steve Purcell +Copyright (c) 2012-2016, Yann Collet. +Copyright 2011,2015 Sven Verdoolaege. +Copyright (c) 1996, 1998 Red Hat, Inc. +Copyright (c) 1998, 2008 Red Hat, Inc. +Copyright (c) 1999, 2008 Red Hat, Inc. +Copyright (c) 2004 Renesas Technology. +Copyright (c) 2008 Christian Haggstrom +Copyright (c) 2008, 2010 Red Hat, Inc. +Copyright (c) 2011, 2012 Anthony Green +Copyright (c) 2011, 2013 Anthony Green +Copyright (c) 2011, 2014 Anthony Green +Copyright (c) 2012, 2013 Anthony Green +Copyright (c) 2012, 2014 Anthony Green +Copyright 2007-2010 by the Sphinx team +(c) 2006 Free Software Foundation, Inc. +(c) CHECK-NEXT T break CHECK-NEXT Preds +Copyright (c) 1998, 2012 Andreas Schwab +Copyright (c) 2002-2004 Tim J. Robbins. +Copyright (c) 2005 Free Standards Group +Copyright 2005-2007 Universiteit Leiden +Copyright 2006-2007 Universiteit Leiden +Copyright 2012 Ecole Normale Superieure +Copyright 2013 Ecole Normale Superieure +Copyright 2014 Ecole Normale Superieure +Copyright 2016 Ismael Jimenez Martinez. +Portions Copyright 2009 The Go Authors. +in LLVM, Diploma Thesis, (c) April 2011 +(c) StringRef NumClobbers // FIXME Avoid +Copyright (c) 1996-1998 John D. Polstra. +Copyright (c) 2002-2008, 2012 Kaz Kojima +Copyright (c) 1997-2019 Intel Corporation +Copyright (c) 2005 Axis Communications AB +Copyright (c) 2010-2015 Benjamin Peterson +Copyright 1992, 1993, 1994 Henry Spencer. +coproc_option_imm Operand let PrintMethod +(c) CXXCtorInitializer NumIvarInitializers +Copyright (c) 2000 Hewlett Packard Company +Copyright (c) 2002 Bo Thorsen +Copyright (c) 1996-2003, 2010 Red Hat, Inc. +Copyright (c) 2004 eXtensible Systems, Inc. +Copyright (c) 2009-2014 by the contributors +Copyright (c) 2009-2015 by the contributors +Copyright (c) 2009-2016 by the contributors +Copyright (c) 2009-2019 by the contributors +Copyright (c) 2011 Free Software Foundation +Copyright (c) 2011-2014 by the contributors +Copyright (c) 2011-2019 by the contributors +Copyright (c) 2013 Imagination Technologies +Copyright (c) 2017-2019 by the contributors +(c) CHECK-NEXT Preds (1) B4 CHECK-NEXT Succs +(c) CHECK-NEXT Preds (1) B5 CHECK-NEXT Succs +(c) CHECK-NEXT Preds (1) B7 CHECK-NEXT Succs +CoprocNumAsmOperand AsmOperandClass let Name +CoprocRegAsmOperand AsmOperandClass let Name +Copyright (c) 1993 by Sun Microsystems, Inc. +Copyright (c) 1996, 1998, 2005 Red Hat, Inc. +Copyright (c) 1996, 1998, 2007 Red Hat, Inc. +Copyright (c) 1998, 2008, 2011 Red Hat, Inc. +Copyright (c) 1999, 2007, 2008 Red Hat, Inc. +Copyright (c) 2004 by Sun Microsystems, Inc. +Copyright (c) 2007, 2009, 2010 Red Hat, Inc. +Copyright (c) 2011, 2012, 2013 Anthony Green +Copyright 2012,2014 Ecole Normale Superieure +Copyright 2012-2013 Ecole Normale Superieure +Copyright 2012-2014 Ecole Normale Superieure +Copyright 2013-2014 Ecole Normale Superieure +Copyright (c) 1992, 1993, 1994 Henry Spencer. +Copyright (c) 2002-2007 Michael J. Fromberger +Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd. +Copyright (c) 2012, 2013 Anthony Green Target +Copyright 2000 Free Software Foundation, Inc. +Copyright 2004 Free Software Foundation, Inc. +Copyright (c) 2008 Ryan McCabe +(c) 2003-2004 Randolph Chung +CoprocOptionAsmOperand AsmOperandClass let Name +Copyright (c) 2003, 2004, 2006, 2008 Kaz Kojima +Copyright (c) 2014 Advanced Micro Devices, Inc. +Copyright (c) 2015 Advanced Micro Devices, Inc. +Copyright (c) 1994-1999 Lucent Technologies Inc. +Copyright (c) 2002, 2007 Bo Thorsen +Copyright (c) 2013 Imagination Technologies Ltd. +(c) Designator NumDesigs NumDesignators NumDesigs +Copyright (c) 1992, 1993 UNIX International, Inc. +Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc. +Copyright (c) 2004 Free Software Foundation, Inc. +Copyright (c) 2006 Free Software Foundation, Inc. +Copyright (c) 2007 Free Software Foundation, Inc. +Copyright (c) 2008 Free Software Foundation, Inc. +Copyright (c) 2009 Free Software Foundation, Inc. +Copyright (c) 2011 Free Software Foundation, Inc. +Copyright (c) 2012 Free Software Foundation, Inc. +Copyright (c) 2012, Noah Spurrier +Copyright (c) 2013-2014, Pexpect development team +Copyright (c) 2013-2016, Pexpect development team +Copyright (c) 2014 Free Software Foundation, Inc. +Copyright (c) 2015 Paul Norman +Copyright (c) 2016 Aaron Watry +Copyright extcopyright~ he year the LLVM Project. +(c) CHECK-NEXT Preds (3) B3 B4 B2 CHECK-NEXT Succs +(c) CHECK-NEXT Preds (3) B3 B5 B6 CHECK-NEXT Succs +Copyright (c) 1996, 2007, 2008, 2011 Red Hat, Inc. +Copyright (c) 1998, 2001, 2007, 2008 Red Hat, Inc. +Copyright (c) 1998, 2007, 2008, 2012 Red Hat, Inc. +Copyright (c) 2000, 2003, 2004, 2008 Red Hat, Inc. +Copyright (c) 2003-2010 Python Software Foundation +Copyright (c) 2012 Zack Weinberg +Copyright 1992-2018 Free Software Foundation, Inc. +Copyright 2008-2009 Katholieke Universiteit Leuven +(c) Stmt NumExprs std::copy Exprs, Exprs + NumExprs +Copyright (c) 1996, MPEG Software Simulation Group. +Copyright (c) 2003 Jakub Jelinek +Copyright (c) 2008 Guido U. Draheim +Copyright (c) 2008 Stepan Kasal +Copyright (c) 2011 Plausible Labs Cooperative, Inc. +Copyright (c) 2012 Qualcomm Innovation Center, Inc. +Copyright (c) 2008 Benjamin Kosnik +Copyright (c) 2013 Synopsys, Inc. (www.synopsys.com) +Copyright (c) 2013 Synposys, Inc. (www.synopsys.com) +Copyright (c) 2014,2015 Advanced Micro Devices, Inc. +Copyright (c) 2002, 2003, 2004, 2006, 2008 Kaz Kojima +Copyright (c) 2003, 2004, 2006, 2007, 2012 Kaz Kojima +Copyright (c) 2013 Miodrag Vallat. +Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. +Copyright (c) 2016 Krzesimir Nowak +Copyright (c) 1994-2014 Free Software Foundation, Inc. +Copyright (c) 1994-2017 Free Software Foundation, Inc. +Copyright (c) 1996, 2003-2004, 2007-2008 Red Hat, Inc. +Copyright (c) 1996-2014 Free Software Foundation, Inc. +Copyright (c) 1996-2015 Free Software Foundation, Inc. +Copyright (c) 1996-2017 Free Software Foundation, Inc. +Copyright (c) 1997-2014 Free Software Foundation, Inc. +Copyright (c) 1997-2017 Free Software Foundation, Inc. +Copyright (c) 1999-2013 Free Software Foundation, Inc. +Copyright (c) 1999-2014 Free Software Foundation, Inc. +Copyright (c) 1999-2017 Free Software Foundation, Inc. +Copyright (c) 2001-2014 Free Software Foundation, Inc. +Copyright (c) 2001-2017 Free Software Foundation, Inc. +Copyright (c) 2002-2014 Free Software Foundation, Inc. +Copyright (c) 2002-2017 Free Software Foundation, Inc. +Copyright (c) 2003-2014 Free Software Foundation, Inc. +Copyright (c) 2003-2017 Free Software Foundation, Inc. +Copyright (c) 2004-2014 Free Software Foundation, Inc. +Copyright (c) 2004-2015 Free Software Foundation, Inc. +Copyright (c) 2004-2017 Free Software Foundation, Inc. +Copyright (c) 2006-2014 Free Software Foundation, Inc. +Copyright (c) 2006-2017 Free Software Foundation, Inc. +Copyright (c) 2007, 2008 Free Software Foundation, Inc +Copyright (c) 2008 Sven Verdoolaege +Copyright (c) 2009-2014 Free Software Foundation, Inc. +Copyright (c) 2009-2017 Free Software Foundation, Inc. +Copyright (c) 2010-2015 Free Software Foundation, Inc. +Copyright (c) 2010-2017 Free Software Foundation, Inc. +Copyright (c) 2011-2013 Free Software Foundation, Inc. +Copyright (c) 2011-2014 Free Software Foundation, Inc. +Copyright (c) 2012-2014 Free Software Foundation, Inc. +Copyright (c) 2012-2015 Free Software Foundation, Inc. +Copyright (c) 2013-2014 Free Software Foundation, Inc. +Copyright (c) 2013-2015 Free Software Foundation, Inc. +Copyright (c) 2002, 2009 Free Software Foundation, Inc. +Copyright (c) 2004, 2005 Free Software Foundation, Inc. +Copyright (c) 2004, 2010 Free Software Foundation, Inc. +Copyright (c) 2006, 2008 Free Software Foundation, Inc. +Copyright (c) 2008, 2010 Free Software Foundation, Inc. +Copyright (c) 2014 Sebastian Macke +Copyright (c) 2015 Moritz Klammler +Copyright (c) 1996, 1997, 2003, 2004, 2008 Red Hat, Inc. +Copyright (c) 1998, 2001, 2007, 2008, 2011, 2014 Red Hat +Copyright (c) 2009 Bradley Smith +Copyright (c) 2013 Jesse Towner +Copyright (c) 2013 Roy Stogner +(c) Type AtExitFuncArgs VoidStar FunctionType AtExitFuncTy +copyright (c) 1991-2011, Thomas G. Lane, Guido Vollbeding. +(c) GlobalVariable Handle new GlobalVariable M, DsoHandleTy +(c) Type ArgTys Int32Ty, Int32Ty, Int32Ty FunctionType FnTy +Copyright (c) 2004 Scott James Remnant +Copyright (c) 2008 Steven G. Johnson +Copyright (c) 2009 Steven G. Johnson +Copyright (c) 2004, 2011-2015 Free Software Foundation, Inc. +Copyright (c) 2007, 2008, 2010 Free Software Foundation, Inc +Copyright (c) 2007, 2009, 2010 Free Software Foundation, Inc +Copyright (c) 2013 Victor Oliveira +Copyright 1984, 1987, 1989, 1992, 2000 by Stephen L. Moshier +(c) DeclRefExpr DR M.makeDeclRefExpr(PV) ImplicitCastExpr ICE +(c) IdentifierInfo NumExprs std::copy Names, Names + NumExprs +Copyright (c) 1998 Todd C. Miller +Copyright (c) 2001, 2003, 2005 Free Software Foundation, Inc. +Copyright (c) 2002, 2003, 2009 Free Software Foundation, Inc. +Copyright (c) 2004, 2005, 2012 Free Software Foundation, Inc. +Copyright (c) 2006, 2008, 2010 Free Software Foundation, Inc. +(c) BranchInst BI BranchInst::Create(Exit, Exit, False, Entry) +Copyright (c) 1996, 1998, 1999, 2001, 2007, 2008 Red Hat, Inc. +Copyright (c) 1996, 1998, 2001, 2002, 2003, 2005 Red Hat, Inc. +Copyright (c) 1996, 1998, 2005, 2007, 2009, 2010 Red Hat, Inc. +Copyright (c) 1996,1998,2001-2003,2005,2008,2010 Red Hat, Inc. +Copyright (c) 1994 The Regents of the University of California. +Copyright (c) 1996-2014 Anthony Green, Red Hat, Inc and others. +Copyright (c) 1992-1996, 1998-2012 Free Software Foundation, Inc. +Copyright (c) 1996-2001, 2003-2015 Free Software Foundation, Inc. +Copyright (c) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +Copyright (c) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +Copyright (c) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +Copyright (c) 2003-2019 University of Illinois at Urbana-Champaign. +Copyright (c) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +Copyright (c) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +Copyright (c) 2007-2018 University of Illinois at Urbana-Champaign. +Copyright (c) 2007-2019 University of Illinois at Urbana-Champaign. +Copyright (c) 2002, 2003, 2004, 2010, Free Software Foundation, Inc. +Copyright (c) 2006-2009 Steven J. Bethard +Copyright (c) 1992, 1993 The Regents of the University of California. +(c) StringLiteral NumClobbers std::copy Clobbers, Clobbers + NumClobbers +Copyright (c) 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com). +Copyright (c) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +Copyright (c) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +Copyright (c) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +Copyright (c) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, Inc. +Copyright (c) 2002, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. +Copyright (c) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, Inc. +Copyright (c) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. +Copyright (c) 1992, 1993, 1994 The Regents of the University of California. +Copyright (c) 2004-2005, 2007-2008, 2011-2015 Free Software Foundation, Inc. +Copyright (c) 2004-2005, 2007-2009, 2011-2015 Free Software Foundation, Inc. +Copyright (c) 2004-2005, 2007, 2009, 2011-2015 Free Software Foundation, Inc. +Copyright (c) 2012 Alexandre K. I. de Mendonca +Copyright (c) 2001, 2002, 2003, 2005, 2008, 2010 Free Software Foundation, Inc. +Copyright (c) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +(c) StringLiteral NumConstraints std::copy Constraints, Constraints + NumConstraints +Copyright (c) 1996, 1997, 2000, 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +Copyright (c) 1999, 2000, 2001, 2003, 2004, 2005, 2008 Free Software Foundation, Inc. +Copyright (c) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software Foundation, Inc. +Copyright (c) 1995, 1996, 1997, 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +Copyright (c) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 Free Software Foundation, Inc. +Copyright (c) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 Free Software Foundation, Inc. +Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 Free Software Foundation, Inc. +Copyright (c) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 Free Software Foundation, Inc. +Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 Free Software Foundation, Inc. +Copyright (c) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2011 Free Software Foundation, Inc. +Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2011 Free Software Foundation, Inc. +Copyright (c) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +Copyright (c) 2012 Alexandre K. I. de Mendonca , Paulo Pizarro +Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +Copyright (c) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +Copyright (c) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +Copyright (c) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2014 Free Software Foundation, Inc. +Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +Copyright (c) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +Copyright (c) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. + +Apache-2.0 WITH LLVM-exception + +--------------------------------------------------------- + +--------------------------------------------------------- + +CommunityToolkit.Mvvm 8.4.0 - MIT + + +Copyright (c) 2021 Sergio Pedri +Copyright (c) 2020 Michael Dietrich +Copyright (c) Microsoft Corporation +(c) .NET Foundation and Contributors +Copyright (c) 2009 - 2018 Laurent Bugnion +Copyright (c) .NET Foundation and Contributors +Copyright (c) 2017 Pedro Lamas, http://www.pedrolamas.com + +# .NET Community Toolkit + +Copyright © .NET Foundation and Contributors + +All rights reserved. + +## MIT License (MIT) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +CommunityToolkit.WinUI.Animations 8.2.250402 - MIT + + +(c) .NET Foundation and Contributors +Copyright (c) .NET Foundation and Contributors + +# Windows Community Toolkit + +Copyright © .NET Foundation and Contributors + +All rights reserved. + +## MIT License (MIT) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +CommunityToolkit.WinUI.Controls.SettingsControls 8.2.250402 - MIT + + +(c) .NET Foundation and Contributors +Copyright (c) .NET Foundation and Contributors + +# Windows Community Toolkit + +Copyright © .NET Foundation and Contributors + +All rights reserved. + +## MIT License (MIT) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +Microsoft.Extensions.Hosting 10.0.0 - MIT + + +Copyright (c) 2021 +Copyright (c) Six Labors +(c) Microsoft Corporation +Copyright (c) 2022 FormatJS +Copyright (c) Andrew Arnott +Copyright 2019 LLVM Project +Copyright (c) 1998 Microsoft +Copyright 2018 Daniel Lemire +Copyright (c) .NET Foundation +Copyright (c) 2011, Google Inc. +Copyright (c) 2020 Dan Shechter +(c) 1997-2005 Sean Eron Anderson +Copyright (c) 2015 Andrew Gallant +Copyright (c) 2022, Wojciech Mula +Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) 2022, Geoff Langdale +Copyright (c) 2005-2020 Rich Felker +Copyright (c) 2012-2021 Yann Collet +Copyright (c) Microsoft Corporation +Copyright (c) 2007 James Newton-King +Copyright (c) 1991-2024 Unicode, Inc. +Copyright (c) 2013-2017, Alfred Klomp +Copyright (c) 2018 Nemanja Mijailovic +Copyright 2012 the V8 project authors +Copyright (c) 1999 Lucent Technologies +Copyright (c) 2008-2016, Wojciech Mula +Copyright (c) 2011-2020 Microsoft Corp +Copyright (c) 2015-2017, Wojciech Mula +Copyright (c) 2015-2018, Wojciech Mula +Copyright (c) 2005-2007, Nick Galbreath +Copyright (c) 2015 The Chromium Authors +Copyright (c) 2018 Alexander Chermyanin +Copyright (c) The Internet Society 1997 +Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2011-2015 Intel Corporation +Copyright (c) 2013-2017, Milosz Krajewski +Copyright (c) 2016-2017, Matthieu Darbois +Copyright (c) The Internet Society (2003) +Copyright (c) .NET Foundation Contributors +(c) 1995-2024 Jean-loup Gailly and Mark Adler +Copyright (c) 2020 Mara Bos +Copyright (c) 2012 - present, Victor Zverovich +Copyright (c) 2006 Jb Evain (jbevain@gmail.com) +Copyright (c) 2008-2020 Advanced Micro Devices, Inc. +Copyright (c) 2019 Microsoft Corporation, Daan Leijen +Copyright (c) 2011 Novell, Inc (http://www.novell.com) +Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors +Copyright (c) 2014 Ryan Juckett http://www.ryanjuckett.com +Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. +Portions (c) International Organization for Standardization 1986 +Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang) Disclaimers +Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip +Copyright (c) 1980, 1986, 1993 The Regents of the University of California +Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California +Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass + +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +Microsoft.Xaml.Behaviors.WinUI.Managed 3.0.0 - MIT + + +(c) Microsoft Corporation + +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +vswhere 3.1.7 - MIT + + +(c) 2023 GitHub, Inc. +(c) Microsoft Corporation +Copyright (c) by P.J. Plauger +Copyright (c) Microsoft Corporation + +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +WinUIEx 2.9.0 - MIT + + +Copyright (c) Microsoft Corporation +Copyright 2021-2025 - Morten Nielsen +Copyright 2021-2025 - Morten Nielsen A +Copyright (c) 2021-2025 - Morten Nielsen + +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +wix 5.0.2 - MS-RL + + +Copyright James Newton-King 2008 +Copyright UpdateUrl DisableModify +Copyright (c) Microsoft Corporation +(c) .NET Foundation and contributors +Copyright James Newton-King 2008 Json.NET +Copyright AssemblyDescription AssemblyProduct +Copyright (c) .NET Foundation and contributors + +Microsoft Reciprocal License (Ms-RL) + +This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software. + + 1. Definitions + + The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. + + A "contribution" is the original software, or any additions or changes to the software. + + A "contributor" is any person that distributes its contribution under this license. + + "Licensed patents" are a contributor's patent claims that read directly on its contribution. + + 2. Grant of Rights + + (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. + + (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. + + 3. Conditions and Limitations + + (A) Reciprocal Grants- For any file you distribute that contains code from the software (in source code or binary format), you must provide recipients the source code to that file along with a copy of this license, which license will govern that file. You may license other files that are entirely your own work and do not contain code from the software under any terms you choose. + + (B) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. + + (C) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. + + (D) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. + + (E) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. + + (F) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. + +--------------------------------------------------------- + diff --git a/README.md b/README.md index d16cdd032..4c0f7468c 100644 --- a/README.md +++ b/README.md @@ -1,72 +1,49 @@ -This repo is for: +# Welcome to the Windows Subsystem for Linux (WSL) repository -- Reporting of issues found within and when using Windows Subsystem for Linux. - Please read [CONTRIBUTING.md](https://github.com/Microsoft/WSL/blob/master/CONTRIBUTING.md) before making an issue submission +

+ WSL logo +

- > Do not open Github issues for Windows crashes (BSODs) or security issues. Please direct all Windows crashes and security issues to secure@microsoft.com. Issues with security vulnerabilities may be edited to hide the vulnerability details. +[Learn more about WSL](https://aka.ms/wsldocs) | [Downloads & Release notes](https://github.com/microsoft/WSL/releases) | [Contributing to WSL](./CONTRIBUTING.md) -- Surrounding discussions about the Windows Subsystem for Linux. +## About -## Reporting issues in Windows Console or WSL text rendering/user experience +Windows Subsystem for Linux (WSL) is a powerful way for you to run your Linux command-line tools, utilities and applications, all unmodified and directly on Windows without the overhead of a traditional virtual machine or dual boot setup. -Note that WSL distro's launch in the Windows Console (unless you have taken steps to launch a 3rd party console/terminal). Therefore, *please file UI/UX related issues in the [Windows Console issue tracker](https://github.com/microsoft/console)*. +You can install WSL right away by running this command inside of your Windows command line: -## Labels: +```powershell +wsl --install +``` -This is your best ways to interact directly with the Windows Subsystem for Linux teams. We will be monitoring and responding to issues as best we can. Please attempt to avoid filing duplicates of open or closed items when possible. Issues may be tagged with with the following labels: +You can learn more about [best practices for setup](https://learn.microsoft.com/windows/wsl/setup/environment), [overviews of WSL](https://learn.microsoft.com/windows/wsl/about) and more at our [WSL documentation page](https://learn.microsoft.com/windows/wsl/). -- **bug** – The issue considered to be a bug internally by the dev team. This tag is generally for gaps in implemented (read: intended to be working) WSL behavior. Things marked with **bug** have a corresponding bug in on Microsoft’s internal bug tracking system. Example: "du -h reports wrong file size on DrvFs" [(#1894)](https://github.com/microsoft/WSL/issues/1894) +## Related repositories -- **feature** – Denotes something understood as not working and is not yet implemented. Example: "Cuda can not be installed" [(#327)](https:/github.com/microsoft/WSL/issues/327) +WSL also has related open source repositories: -- **fixinbound** / **fixedinNNNN** – The bug or feature request originally submitted has been addressed in whole or in part. Related or ongoing bug or feature gaps should be opened as a new issue submission if one does not already exist. +- [microsoft/WSL2-Linux-Kernel](https://github.com/microsoft/WSL2-Linux-Kernel) - The Linux kernel shipped with WSL +- [microsoft/WSLg](https://github.com/microsoft/wslg) - Support for Linux GUI apps in WSL +- [microsoftdocs/wsl](https://github.com/microsoftdocs/wsl) - WSL documentation at aka.ms/wsldocs -- **duplicate** – The submission is substantially duplicative of an existing issue, and/or has the same underlying cause. +## Contributing -- **need-repro** – The issue submission is missing fields from the issue [template](https://github.com/Microsoft/WSL/blob/master/ISSUE_TEMPLATE.md), cannot be reproduced with the information provided, or is not actionable. +This project welcomes contributions of all types, including coding features / bug fixes, documentation fixes, design proposals and more. -- **discussion** / **question** – Submissions which are not a bug report or feature request. Example: Windows Subsystem for Linux is not open source [(#178)](https://github.com/Microsoft/WSL/issues/178) +We ask that before you start working on a contribution, please read our [Contributor's Guide](./CONTRIBUTING.md). -- **bydesign** / **linux-behavior** – Denotes that an issue that is considered working as intended or would behave analogously on a native Linux kernel. +For guidance on developing for WSL, please read the [developer docs](./doc/docs/dev-loop.md) for instructions on how to build WSL from source and details on its architecture. -- **console** – The submission should be directed to the [console issue tracker](https://github.com/microsoft/console/issues). +## Code of Conduct -- **documentation** – The submission should be directed to the [WSL documentation issue tracker](https://github.com/MicrosoftDocs/WSL). +This project has adopted the [Microsoft Open Source Code of Conduct](./CODE_OF_CONDUCT.md) -- **wsl2** - The issue relates specifically to WSL 2. +## Trademarks -- **fixed-in-wsl2** - The issue could be resolved by switching the distro to use the WSL 2 architecture. +This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft’s Trademark & Brand Guidelines](https://www.microsoft.com/legal/intellectualproperty/trademarks). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies. -Additional tags may be used to denote specific types of issues. +## Privacy and telemetry -- **9p-linux-file-access** - The issue is related to accesing Linux files from Windows. +The application logs basic diagnostic data (telemetry). For more information on privacy and what we collect, see our [data and privacy documentation](DATA_AND_PRIVACY.md). -## Closing: - -Issues may be closed by the original poster at any time. We will close issues if: -- The issue is not a bug or feature request -- The issue has been addressed -- The issue is a duplicate of another issue -- Discussions or questions that have ran their course - -### Microsoft Links: - -- [Microsoft Docs](https://docs.microsoft.com/en-us/windows/wsl/about) -- [Release Notes](https://docs.microsoft.com/en-us/windows/wsl/release-notes) -- [WSL Blog](https://blogs.msdn.microsoft.com/wsl) (Historical) -- [Command Line Blog](https://blogs.msdn.microsoft.com/commandline/) (Active) - -### Community Links: - -- Stack Overflow: https://stackoverflow.com/questions/tagged/wsl -- Ask Ubuntu: https://askubuntu.com/questions/tagged/wsl -- reddit: https://www.reddit.com/r/bashonubuntuonwindows -- List of programs that work and don't work - - https://github.com/ethanhs/WSL-Programs - - https://github.com/davatron5000/can-i-subsystem-it -- Awesome WSL: https://github.com/sirredbeard/Awesome-WSL -- Tips and guides for new bash users: https://github.com/abergs/ubuntuonwindows - -### Troubleshooting: - -Common troubleshooting issues and solutions are available on our [MSDN documentation](https://msdn.microsoft.com/en-us/commandline/wsl/troubleshooting). +The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. \ No newline at end of file diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..d14263622 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,41 @@ + + +## Security + +Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). + +If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. + +## Reporting Security Issues + +**Please do not report security vulnerabilities through public GitHub issues.** + +Instead, please [report them to the Microsoft Security Response Center (MSRC)](https://aka.ms/opensource/security/create-report). + +If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). + +You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [Microsoft Security Response Center](https://aka.ms/opensource/security/msrc). + +Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: + + * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) + * Full paths of source file(s) related to the manifestation of the issue + * The location of the affected source code (tag/branch/commit or direct URL) + * Any special configuration required to reproduce the issue + * Step-by-step instructions to reproduce the issue + * Proof-of-concept or exploit code (if possible) + * Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. + +## Preferred Languages + +We prefer all communications to be in English. + +## Policy + +Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). + + \ No newline at end of file diff --git a/SUPPORT.md b/SUPPORT.md new file mode 100644 index 000000000..e8e8fee7a --- /dev/null +++ b/SUPPORT.md @@ -0,0 +1,17 @@ +# Support + +## How to file issues and get help + +This project uses [GitHub Issues][gh-issue] to [track bugs][gh-bug] and [feature requests][gh-feature]. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or +feature request as a new Issue. + +For general information on the Windows Subsystem for Linux, including help, tutorials, how-tos and reference guides, please view our [WSL documentation](https://docs.microsoft.com/windows/wsl/). + +## Microsoft Support Policy + +Technical Support for the use of WSL may also be available from Microsoft’s Customer Support Services (CSS). If you are a Premier or Unified Support customer, you may reach out to your account manager for further assistance. Otherwise, you may visit Microsoft’s [Support For Business site](https://support.serviceshub.microsoft.com/supportforbusiness/create) to [open a new support case for WSL](https://support.serviceshub.microsoft.com/supportforbusiness/create?sapid=9d5af292-506b-63ca-cb2c-7f4eaa380c56). + + +[gh-issue]: https://github.com/microsoft/WSL/issues/new/choose +[gh-bug]: https://github.com/microsoft/WSL/issues/new?assignees=&labels=&template=bug_report.md&title= +[gh-feature]: https://github.com/microsoft/WSL/issues/new?assignees=&labels=feature&template=feature_request.md&title= diff --git a/UserConfig.cmake.sample b/UserConfig.cmake.sample new file mode 100644 index 000000000..07c0992fe --- /dev/null +++ b/UserConfig.cmake.sample @@ -0,0 +1,58 @@ +# Sample user configuration + +message(STATUS "Loading user configuration") + +# Uncomment to enable development packages (smaller, faster to install) +# # Note: .vhd files fail to mount via symlink / hardlink, so COPY is needed. +# set(WSL_DEV_BINARY_PATH "C:/wsldev") + +if(WSL_DEV_BINARY_PATH) + file(MAKE_DIRECTORY ${WSL_DEV_BINARY_PATH}) + file(CREATE_LINK "${KERNEL_SOURCE_DIR}/bin/${TARGET_PLATFORM}/kernel" "${WSL_DEV_BINARY_PATH}/kernel" SYMBOLIC) + file(COPY_FILE "${WSLG_SOURCE_DIR}/${TARGET_PLATFORM}/system.vhd" "${WSL_DEV_BINARY_PATH}/system.vhd" ONLY_IF_DIFFERENT) + file(COPY_FILE "${KERNEL_SOURCE_DIR}/bin/${TARGET_PLATFORM}/modules.vhd" "${WSL_DEV_BINARY_PATH}/modules.vhd" ONLY_IF_DIFFERENT) + + # read-only VHDs need to be world readable to mount successfully. + execute_process( + COMMAND icacls.exe "${WSL_DEV_BINARY_PATH}/system.vhd" "/grant:r" "Everyone:(R)" /Q + COMMAND icacls.exe "${WSL_DEV_BINARY_PATH}/modules.vhd" "/grant:r" "Everyone:(R)" /Q + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY) + + file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/msrdc.exe" "${WSL_DEV_BINARY_PATH}/msrdc.exe" SYMBOLIC) + file(CREATE_LINK "${WSLG_SOURCE_DIR}/wslg.rdp" "${WSL_DEV_BINARY_PATH}/wslg.rdp" SYMBOLIC) + file(CREATE_LINK "${WSLG_SOURCE_DIR}/wslg_desktop.rdp" "${WSL_DEV_BINARY_PATH}/wslg_desktop.rdp" SYMBOLIC) + file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/rdclientax.dll" "${WSL_DEV_BINARY_PATH}/rdclientax.dll" SYMBOLIC) + file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/rdpnanoTransport.dll" "${WSL_DEV_BINARY_PATH}/rdpnanoTransport.dll" SYMBOLIC) + file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/RdpWinStlHelper.dll" "${WSL_DEV_BINARY_PATH}/RdpWinStlHelper.dll" SYMBOLIC) + file(CREATE_LINK "${MSAL_SOURCE_DIR}/${TARGET_PLATFORM}/msal.wsl.proxy.exe" "${WSL_DEV_BINARY_PATH}/msal.wsl.proxy.exe" SYMBOLIC) + file(CREATE_LINK "${DIRECT3D_SOURCE_DIR}/lib/${TARGET_PLATFORM}" "${WSL_DEV_BINARY_PATH}/lib" SYMBOLIC) + + foreach(LANG ${SUPPORTED_LANGS}) + file(CREATE_LINK "${MSRDC_SOURCE_DIR}/${TARGET_PLATFORM}/${LANG}" "${WSL_DEV_BINARY_PATH}/${LANG}" SYMBOLIC) + endforeach() +endif() + +# # Uncomment to build, package and install wslsettings +# set(WSL_BUILD_WSL_SETTINGS true) + +# # Uncomment to build the C# WSLC sdk +# set(WSL_BUILD_SDKCS true) + +# # Uncomment to configure the WSLC SDK NuGet to only target the current platform +# set(WSL_NUGET_SINGLE_PLATFORM true) + +# # Uncomment to generate a "thin" MSI package which builds and installs faster +# set(WSL_BUILD_THIN_PACKAGE true) + +# # Uncomment to install the package as part of the build +# set(WSL_POST_BUILD_COMMAND "powershell;-ExecutionPolicy;Bypass;-NoProfile;-NonInteractive;./tools/deploy/deploy-to-host.ps1") + +# # Uncomment to reduce the verbosity of the appx package build +# set(WSL_SILENT_APPX_BUILD true) + +# # Uncomment to change the pre-commit hook behavior (default: warn) +# # warn - report formatting issues without blocking the commit +# # error - block the commit when formatting issues are found +# # fix - automatically fix formatting and re-stage files +# set(WSL_PRE_COMMIT_MODE "warn") diff --git a/cgmanifest.json b/cgmanifest.json new file mode 100644 index 000000000..f81e699f3 --- /dev/null +++ b/cgmanifest.json @@ -0,0 +1,89 @@ +{ + "version": 1, + "$schema": "https://json.schemastore.org/component-detection-manifest.json", + "registrations": [ + { + "component": { + "type": "git", + "git": { + "repositoryUrl": "https://github.com/llvm/llvm-project", + "commitHash": "d32170dbd5b0d54436537b6b75beaf44324e0c28" + } + } + }, + { + "component": { + "type": "git", + "git": { + "repositoryUrl": "https://github.com/libarchive/libarchive", + "commitHash": "b439d586f53911c84be5e380445a8a259e19114c" + } + } + }, + { + "component": { + "type": "other", + "other": { + "name": "libarchive", + "version": "3.7.7", + "downloadUrl": "https://github.com/libarchive/libarchive/releases/download/v3.7.7/libarchive-3.7.7.tar.gz", + "hash": "sha1:918692098b11db61aff23684ab04f375e4a68f69" + } + } + }, + { + "component": { + "type": "git", + "git": { + "repositoryUrl": "https://github.com/boostorg/boost", + "commitHash": "1bed2b0712b2119f20d66c5053def9173c8462a5" + } + } + }, + { + "component": { + "type": "other", + "other": { + "name": "boost", + "version": "1.90.0", + "downloadUrl": "https://archives.boost.io/release/1.90.0/source/boost_1_90_0.tar.gz", + "hash": "sha256:5e93d582aff26868d581a52ae78c7d8edf3f3064742c6e77901a1f18a437eea9" + } + } + }, + { + "component": { + "type": "other", + "other": { + "name": "yaml-cpp", + "version": "0.9.0", + "downloadUrl": "https://github.com/jbeder/yaml-cpp/releases/download/yaml-cpp-0.9.0/yaml-cpp-yaml-cpp-0.9.0.tar.gz", + "hash": "sha256:298593d9c440fd9034b8b193d96318b76d49bc97c6ceadb7b0836edf0b6d7539" + + } + } + }, + { + "component": { + "type": "other", + "other": { + "name": "GSL", + "version": "4.0.0", + "downloadUrl": "https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.tar.gz", + "hash": "sha256:f0e32cb10654fea91ad56bde89170d78cfbf4363ee0b01d8f097de2ba49f6ce9" + } + } + }, + { + "component": { + "type": "other", + "other": { + "name": "nlohmann::json", + "version": "3.12.0", + "downloadUrl": "https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz", + "hash": "sha256:42f6e95cad6ec532fd372391373363b62a14af6d771056dbfc86160e6dfff7aa" + } + } + } + ] +} \ No newline at end of file diff --git a/cloudtest/CMakeLists.txt b/cloudtest/CMakeLists.txt new file mode 100644 index 000000000..643a069d1 --- /dev/null +++ b/cloudtest/CMakeLists.txt @@ -0,0 +1,60 @@ +set(OUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cloudtest) +file(MAKE_DIRECTORY ${OUT}) + +if (${TARGET_PLATFORM} STREQUAL x64) + set(CLOUDTEST_IMAGES + "wsl-test-image-rs_prerelease-2025-01-30" + "wsl-test-image-win11-23h2-ent-2024-11-18" + "wsl-test-image-2022-datacenter-g2-2024-09-10" + "wsl-test-image-win10-22h2-ent-g2-2024-09-10") + + # WSLC tests trigger a Hyper-V VMBus PowerOff hang during VM teardown + # on Windows Server SKUs, which causes the WSLC TAEF job to time out. + # Skip the WSLC test suite on Server images until the host issue is + # resolved. + set(CLOUDTEST_SERVER_IMAGES + "wsl-test-image-2022-datacenter-g2-2024-09-10") + + set(CLOUDTEST_TEST_PACKAGES "Test_Packages_2025_07_28") + set(DUMPTOOL_DROP "DumpTool_X64_2025-01-27") +elseif (${TARGET_PLATFORM} STREQUAL arm64) + set(CLOUDTEST_IMAGES) + set(CLOUDTEST_SERVER_IMAGES) +else() + message(FATAL_ERROR "Unsupported target platform: ${TARGET_PLATFORM}") +endif() + +# Passed down to test-setup.ps1 to determine if -AllowUnsigned should be passed to Add-AppxPackage +if (OFFICIAL_BUILD) + set(ALLOW_UNSIGNED_PACKAGE "0") +else() + set(ALLOW_UNSIGNED_PACKAGE "1") +endif() + +# When the package stage is included (release + nightly), test the real bundle from that stage. +# PR builds test the installer.msix directly from the build artifact (no bundle needed). +if (INCLUDE_PACKAGE_STAGE) + set(TEST_PACKAGE_PROVIDER "[package]") + set(TEST_PACKAGE_PATH "bundle\\Microsoft.WSL_${PACKAGE_VERSION}_x64_ARM64.msixbundle") + set(TEST_PACKAGE_FILE "Microsoft.WSL_${PACKAGE_VERSION}_x64_ARM64.msixbundle") +else() + set(TEST_PACKAGE_PROVIDER "[drop]") + set(TEST_PACKAGE_PATH "testbin\\x64\\release\\installer.msix") + set(TEST_PACKAGE_FILE "installer.msix") +endif() + +function(add_test_group image version suffix filter) + set(DIR ${OUT}/${image}-${suffix}) + file(MAKE_DIRECTORY ${DIR}) + + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestMap.xml.in ${DIR}/TestMap.xml) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestGroup.xml.in ${DIR}/TestGroup.xml) +endfunction() + +foreach(image ${CLOUDTEST_IMAGES}) + add_test_group("${image}" "1" "wsl1" "not (@TestCategory='WSLC')") + add_test_group("${image}" "2" "wsl2" "not (@TestCategory='WSLC')") + if (NOT "${image}" IN_LIST CLOUDTEST_SERVER_IMAGES) + add_test_group("${image}" "2" "wslc" "@TestCategory='WSLC'") + endif() +endforeach() diff --git a/cloudtest/TestGroup.xml.in b/cloudtest/TestGroup.xml.in new file mode 100644 index 000000000..81c4a6c5f --- /dev/null +++ b/cloudtest/TestGroup.xml.in @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + +