From ea6f4bb93ee87e3ab41fab006a97bba6170a125d Mon Sep 17 00:00:00 2001 From: Christian Lohmaier Date: Fri, 13 Sep 2024 13:56:04 +0200 Subject: [PATCH] winget configuration files for installing Visual Studio Community 2022 A first step into streamlining the dependency installation process using winget / DevHome You can apply winget configurations with DevHome or from commandline by running winget configure -f path-to-configuration.yaml The *.vsconfig files can also be manually imported into Visual Studio Installer to install missing components into an existing installation Two variants are provided in this commit, one set including the components needed to cross-compile for ARM64 (uses around 1GB) The version of the Windows SDK chosen is the one that matches the SDK from the recommended packages, to avoid installing two different SDKs when using the configuration that includes the recommended packages The *.vsconfig files don't include the implied packages/the ones required by the workload. For a list of the components and their corresponding friendly names, see https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community Change-Id: Ie44ee3dd39c3e61fb2d7c597b71a4a81e0e6b8d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173336 Tested-by: Jenkins Reviewed-by: Christian Lohmaier --- .configurations/2022.vsconfig | 15 +++++++++++++ .configurations/2022_cross.vsconfig | 18 ++++++++++++++++ .configurations/configuration.dsc.yaml | 30 ++++++++++++++++++++++++++ .configurations/jenkins.dsc.yaml | 30 ++++++++++++++++++++++++++ .vsconfig | 1 + 5 files changed, 94 insertions(+) create mode 100644 .configurations/2022.vsconfig create mode 100644 .configurations/2022_cross.vsconfig create mode 100644 .configurations/configuration.dsc.yaml create mode 100644 .configurations/jenkins.dsc.yaml create mode 120000 .vsconfig diff --git a/.configurations/2022.vsconfig b/.configurations/2022.vsconfig new file mode 100644 index 000000000000..4c6d7facd359 --- /dev/null +++ b/.configurations/2022.vsconfig @@ -0,0 +1,15 @@ +{ + "version": "1.0", + "components": [ + "Microsoft.VisualStudio.Workload.CoreEditor", + "Microsoft.VisualStudio.Workload.NativeDesktop", + "Microsoft.Net.Component.4.8.SDK", + "Microsoft.VisualStudio.Component.Git", + "Microsoft.VisualStudio.Component.VC.ATL", + "Microsoft.VisualStudio.Component.VC.Llvm.Clang", + "Microsoft.VisualStudio.Component.VC.Redist.MSM", + "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", + "Microsoft.VisualStudio.Component.Windows11SDK.22621" + ], + "extensions": [] +} diff --git a/.configurations/2022_cross.vsconfig b/.configurations/2022_cross.vsconfig new file mode 100644 index 000000000000..e9ac2f114dc5 --- /dev/null +++ b/.configurations/2022_cross.vsconfig @@ -0,0 +1,18 @@ +{ + "version": "1.0", + "components": [ + "Microsoft.VisualStudio.Workload.CoreEditor", + "Microsoft.VisualStudio.Workload.NativeDesktop", + "Microsoft.Net.Component.4.8.SDK", + "Microsoft.VisualStudio.Component.Git", + "Microsoft.VisualStudio.Component.VC.ATL", + "Microsoft.VisualStudio.Component.VC.ATL.ARM64", + "Microsoft.VisualStudio.Component.VC.Llvm.Clang", + "Microsoft.VisualStudio.Component.VC.Redist.MSM", + "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", + "Microsoft.VisualStudio.Component.VC.Tools.ARM64", + "Microsoft.VisualStudio.Component.VC.Tools.ARM64EC", + "Microsoft.VisualStudio.Component.Windows11SDK.22621" + ], + "extensions": [] +} \ No newline at end of file diff --git a/.configurations/configuration.dsc.yaml b/.configurations/configuration.dsc.yaml new file mode 100644 index 000000000000..711fa297f011 --- /dev/null +++ b/.configurations/configuration.dsc.yaml @@ -0,0 +1,30 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +# This configuration is for a typical end-user installation of Visual Studio Community 2022 with the +# required components to build LibreOffice, excluding the components to cross-compile for ARM64 +# It includes recommended packages as if you had selected the "Desktop development with C++" +# workload in the in the UI driven installer. +# (the allowPrerelease directive refers to the DSC module) + +properties: + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudio + directives: + description: Install Visual Studio 2022 Community + allowPrerelease: true + settings: + id: Microsoft.VisualStudio.2022.Community + source: winget + - resource: Microsoft.VisualStudio.DSC/VSComponents + id: LibreOffice Components including recommended packages + dependsOn: + - VisualStudio + directives: + description: Install components required to build LibreOffice, including recommended ones + settings: + productId: Microsoft.VisualStudio.Product.Community + channelId: VisualStudio.17.Release + vsConfigFile: '${WinGetConfigRoot}\2022.vsconfig' + IncludeRecommended: true + configurationVersion: 0.2.0 diff --git a/.configurations/jenkins.dsc.yaml b/.configurations/jenkins.dsc.yaml new file mode 100644 index 000000000000..e1576eae552a --- /dev/null +++ b/.configurations/jenkins.dsc.yaml @@ -0,0 +1,30 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 + +# This configuration is for a minimal installation of Visual Studio meant for CI use or setups with +# remote access with no need for convenience features of the IDE. It installs the dependencies +# without additional recommended packages. If you want to use the IDE to edit code, you probably +# want to use the regular configuration.dsc.yaml (or launch Visual Studio Installer afterwards, pick +# modify and then unselect and reselect the "Desktop Development with C++" workload) +# (the allowPrerelease directive refers to the DSC module) + +properties: + resources: + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: VisualStudio + directives: + description: Install Visual Studio 2022 Community + allowPrerelease: true + settings: + id: Microsoft.VisualStudio.2022.Community + source: winget + - resource: Microsoft.VisualStudio.DSC/VSComponents + id: minimal LibreOffice Components + dependsOn: + - VisualStudio + directives: + description: Install components required to build LibreOffice + settings: + productId: Microsoft.VisualStudio.Product.Community + channelId: VisualStudio.17.Release + vsConfigFile: '${WinGetConfigRoot}\2022_cross.vsconfig' + configurationVersion: 0.2.0 diff --git a/.vsconfig b/.vsconfig new file mode 120000 index 000000000000..13260a166f77 --- /dev/null +++ b/.vsconfig @@ -0,0 +1 @@ +.configurations/2022.vsconfig \ No newline at end of file