[windows] Improve MSYS2 installation (#3652)

This commit is contained in:
Leonid Lapshin
2021-06-29 11:59:03 +03:00
committed by GitHub
parent 24387bf8e6
commit de7775d901
4 changed files with 15 additions and 23 deletions

View File

@@ -79,13 +79,12 @@ foreach ($arch in $archs)
Write-Host "`n$dash Clean packages"
pacman.exe -Scc --noconfirm
Write-Host "`n$dash Installed msys2 packages"
pacman.exe -Q | grep -v ^mingw-w64-
$pkgs = pacman.exe -Q
foreach ($arch in $archs)
{
Write-Host "`n$dash Installed $arch packages"
pacman.exe -Q | grep ^${arch}-
$pkgs | grep ^${arch}-
}
$env:PATH = $origPath

View File

@@ -1,6 +1,3 @@
$toolsetContent = (Get-ToolsetContent).MsysPackages
$archs = $toolsetContent.mingw.arch
BeforeAll {
$msys2Dir = "C:\msys64\usr\bin"
$originalPath = $env:PATH
@@ -34,31 +31,23 @@ Describe "MSYS2 packages" {
}
}
foreach ($arch in $archs) {
Describe "$arch arch packages" {
$archPackages = $toolsetContent.mingw | Where-Object { $_.arch -eq $arch }
$tools = $archPackages.runtime_packages.name
if ($arch -eq "mingw-w64-i686")
{
$ExecDir = "C:\msys64\mingw32\bin"
}
else
{
$ExecDir = "C:\msys64\mingw64\bin"
}
$mingwTypes = (Get-ToolsetContent).MsysPackages.mingw
foreach ($mingwType in $mingwTypes) {
Describe "$($mingwType.arch) packages" {
$tools = $mingwType.runtime_packages
$execDir = Join-Path "C:\msys64" $mingwType.exec_dir | Join-Path -ChildPath "bin"
foreach ($tool in $tools) {
Context "$tool package"{
$executables = ($archPackages.runtime_packages | Where-Object { $_.name -eq $tool }).executables | ForEach-Object {
Context "$($tool.name) package"{
$executables = $tool.executables | ForEach-Object {
@{
ExecName = $_
ExecDir = $ExecDir
ExecDir = $execDir
}
}
BeforeEach {
$env:PATH = "$ExecDir;$env:PATH"
$env:PATH = "$execDir;$env:PATH"
}
It "<ExecName> is installed in <ExecDir>" -TestCases $executables {

View File

@@ -181,6 +181,7 @@
"mingw": [
{
"arch": "mingw-w64-x86_64",
"exec_dir": "mingw64",
"runtime_packages": [
{
"name": "clang",
@@ -214,6 +215,7 @@
},
{
"arch": "mingw-w64-i686",
"exec_dir": "mingw32",
"runtime_packages": [
{
"name": "clang",

View File

@@ -181,6 +181,7 @@
"mingw": [
{
"arch": "mingw-w64-x86_64",
"exec_dir": "mingw64",
"runtime_packages": [
{
"name": "clang",
@@ -214,6 +215,7 @@
},
{
"arch": "mingw-w64-i686",
"exec_dir": "mingw32",
"runtime_packages": [
{
"name": "clang",