aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common
diff options
context:
space:
mode:
authorAmir Masoud Abdol <amir.abdol@qt.io>2023-11-22 08:58:50 +0100
committerAmir Masoud Abdol <amir.abdol@qt.io>2023-12-18 06:32:17 +0100
commit65e19ca67223dca0c6e3b4506eb59bbf698ead49 (patch)
tree95ab19c39f1be6be97bb2b95d8776acf1c9c7384 /coin/provisioning/common
parentc1847f4f5be1f76085a68e79c40e8bd67f0c0e3d (diff)
Provisioning: Install vcpkg on Windows
- Downloading the vcpkg executable - Cloning an internal mirror of the vcpkg's official repository, and setting the VCPKG_ROOT to its path. The mirror is under my personal namespace in `git.qt.io` and will be replaced by official qt mirror in the future. - Adding an empty `vcpkg.json` for Windows - Adding a `vcpkg-configuration.json` - Setting environment variables for Binary and Asset cache - Run `install-vcpkg.sh` on all active Windows hosts Task-number: QTBUG-115715 Change-Id: I7a8a883a1523f27506ff31757f5aad5221de0698 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'coin/provisioning/common')
-rw-r--r--coin/provisioning/common/shared/vcpkg-configuration.json9
-rw-r--r--coin/provisioning/common/shared/vcpkg_registry_mirror.txt1
-rw-r--r--coin/provisioning/common/shared/vcpkg_tool_release_tag.txt1
-rw-r--r--coin/provisioning/common/shared/vcpkg_version.txt1
-rw-r--r--coin/provisioning/common/windows/install-vcpkg.ps158
-rw-r--r--coin/provisioning/common/windows/vcpkg/vcpkg.json3
6 files changed, 73 insertions, 0 deletions
diff --git a/coin/provisioning/common/shared/vcpkg-configuration.json b/coin/provisioning/common/shared/vcpkg-configuration.json
new file mode 100644
index 00000000..83f4f440
--- /dev/null
+++ b/coin/provisioning/common/shared/vcpkg-configuration.json
@@ -0,0 +1,9 @@
+{
+ "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg-configuration.schema.json",
+ "default-registry": {
+ "kind": "git",
+ "repository": "https://git.qt.io/mrmsdbdl/vcpkg-mirror",
+ "baseline": "8eb57355a4ffb410a2e94c07b4dca2dffbee8e50"
+ },
+ "overlay-triplets": [ "./../../shared/triplets" ]
+}
diff --git a/coin/provisioning/common/shared/vcpkg_registry_mirror.txt b/coin/provisioning/common/shared/vcpkg_registry_mirror.txt
new file mode 100644
index 00000000..546ef5b6
--- /dev/null
+++ b/coin/provisioning/common/shared/vcpkg_registry_mirror.txt
@@ -0,0 +1 @@
+https://git.qt.io/mrmsdbdl/vcpkg-mirror.git
diff --git a/coin/provisioning/common/shared/vcpkg_tool_release_tag.txt b/coin/provisioning/common/shared/vcpkg_tool_release_tag.txt
new file mode 100644
index 00000000..3faa2683
--- /dev/null
+++ b/coin/provisioning/common/shared/vcpkg_tool_release_tag.txt
@@ -0,0 +1 @@
+vcpkg_tool_release_tag=2023-11-16
diff --git a/coin/provisioning/common/shared/vcpkg_version.txt b/coin/provisioning/common/shared/vcpkg_version.txt
new file mode 100644
index 00000000..d2aa3aa3
--- /dev/null
+++ b/coin/provisioning/common/shared/vcpkg_version.txt
@@ -0,0 +1 @@
+vcpkg_version=2023.10.19
diff --git a/coin/provisioning/common/windows/install-vcpkg.ps1 b/coin/provisioning/common/windows/install-vcpkg.ps1
new file mode 100644
index 00000000..f5d1dad3
--- /dev/null
+++ b/coin/provisioning/common/windows/install-vcpkg.ps1
@@ -0,0 +1,58 @@
+# Copyright (C) 2023 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+. "$PSScriptRoot\helpers.ps1"
+
+# This script will install vcpkg
+
+Write-Host "Installing vcpkg"
+
+$n = Get-Content "$PSScriptRoot\..\shared\vcpkg_version.txt"
+$n = $n.Split('=')
+$vcpkgVersion = $n[1]
+$nonDottedVersion = $vcpkgVersion.Replace(".", "")
+
+# Download vcpkg
+$vcpkgRoot = "C:\Utils\vcpkg-$vcpkgVersion"
+$vcpkgRepo = Get-Content -Path "$PSScriptRoot\..\shared\vcpkg_registry_mirror.txt" | Select-Object -First 1
+
+Write-Host "Cloning the vcpkg repo"
+git.exe clone "$vcpkgRepo" "$vcpkgRoot"
+git.exe -C "$vcpkgRoot" checkout "tags/$vcpkgVersion"
+
+# Download vcpkg-tool, i.e., vcpkg.exe
+
+$n = Get-Content "$PSScriptRoot\..\shared\vcpkg_tool_release_tag.txt"
+$n = $n.Split('=')
+$vcpkgExeReleaseTag = $n[1]
+$nonDottedReleaseTag = $vcpkgExeReleaseTag.replace('-', "")
+
+$vcpkgExeOfficialUrl = "https://github.com/microsoft/vcpkg-tool/releases/download/$vcpkgExeReleaseTag/vcpkg.exe"
+$vcpkgExeCacheUrl = "\\ci-files01-hki.ci.qt.io\provisioning\vcpkg\vcpkg-$nonDottedReleaseTag-windows-x64.exe"
+$vcpkgExeSHA1 = "F74DCDE7F6F5082EF6DC31FED486FAD69BE8D442"
+$vcpkgExe = "C:\Windows\Temp\vcpkg.exe"
+
+Download "$vcpkgExeOfficialUrl" "$vcpkgExeCacheUrl" "$vcpkgExe"
+Verify-Checksum $vcpkgExe $vcpkgExeSHA1
+Move-Item "$vcpkgExe" -Destination "$vcpkgRoot" -Force
+
+if(![System.IO.File]::Exists("$vcpkgRoot\vcpkg.exe")){
+ Write-Host "Can't find $vcpkgRoot\vcpkg.exe."
+ exit 1
+}
+
+# Disable telemetry
+Set-Content -Value "" -Path "$vcpkgRoot\vcpkg.disable-metrics" -Force
+
+# Setting VCPKG_ROOT using Set-EnvironmentVariable makes the variable only
+# available during build time. In order to make it available during the
+# provisioning, we need to directly set it via $env:VCPKG_ROOT as well.
+Set-EnvironmentVariable "VCPKG_ROOT" "$vcpkgRoot"
+$env:VCPKG_ROOT = "$vcpkgRoot"
+
+# Set a source for vcpkg Binary and Asset Cache
+# The `coin/provisioning/common/windows/mount-vcpkg-cache-drive.ps1` script is
+# mounting the SMB share located in `vcpkg-server.ci.qt.io/vcpkg` to drive V:\
+$env:VCPKG_BINARY_SOURCES = "files,V:/binaries,readwrite"
+$env:X_VCPKG_ASSET_SOURCES = "x-azurl,file:///V:/assets,,readwrite"
+
+Write-Output "vcpkg = $vcpkgVersion" >> ~/versions.txt
diff --git a/coin/provisioning/common/windows/vcpkg/vcpkg.json b/coin/provisioning/common/windows/vcpkg/vcpkg.json
new file mode 100644
index 00000000..0db3279e
--- /dev/null
+++ b/coin/provisioning/common/windows/vcpkg/vcpkg.json
@@ -0,0 +1,3 @@
+{
+
+}