[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
@@ -79,13 +79,12 @@ foreach ($arch in $archs)
Write-Host "`n$dash Clean packages" Write-Host "`n$dash Clean packages"
pacman.exe -Scc --noconfirm pacman.exe -Scc --noconfirm
Write-Host "`n$dash Installed msys2 packages" $pkgs = pacman.exe -Q
pacman.exe -Q | grep -v ^mingw-w64-
foreach ($arch in $archs) foreach ($arch in $archs)
{ {
Write-Host "`n$dash Installed $arch packages" Write-Host "`n$dash Installed $arch packages"
pacman.exe -Q | grep ^${arch}- $pkgs | grep ^${arch}-
} }
$env:PATH = $origPath $env:PATH = $origPath
+9 -20
View File
@@ -1,6 +1,3 @@
$toolsetContent = (Get-ToolsetContent).MsysPackages
$archs = $toolsetContent.mingw.arch
BeforeAll { BeforeAll {
$msys2Dir = "C:\msys64\usr\bin" $msys2Dir = "C:\msys64\usr\bin"
$originalPath = $env:PATH $originalPath = $env:PATH
@@ -34,31 +31,23 @@ Describe "MSYS2 packages" {
} }
} }
foreach ($arch in $archs) { $mingwTypes = (Get-ToolsetContent).MsysPackages.mingw
Describe "$arch arch packages" { foreach ($mingwType in $mingwTypes) {
$archPackages = $toolsetContent.mingw | Where-Object { $_.arch -eq $arch } Describe "$($mingwType.arch) packages" {
$tools = $archPackages.runtime_packages.name $tools = $mingwType.runtime_packages
$execDir = Join-Path "C:\msys64" $mingwType.exec_dir | Join-Path -ChildPath "bin"
if ($arch -eq "mingw-w64-i686")
{
$ExecDir = "C:\msys64\mingw32\bin"
}
else
{
$ExecDir = "C:\msys64\mingw64\bin"
}
foreach ($tool in $tools) { foreach ($tool in $tools) {
Context "$tool package"{ Context "$($tool.name) package"{
$executables = ($archPackages.runtime_packages | Where-Object { $_.name -eq $tool }).executables | ForEach-Object { $executables = $tool.executables | ForEach-Object {
@{ @{
ExecName = $_ ExecName = $_
ExecDir = $ExecDir ExecDir = $execDir
} }
} }
BeforeEach { BeforeEach {
$env:PATH = "$ExecDir;$env:PATH" $env:PATH = "$execDir;$env:PATH"
} }
It "<ExecName> is installed in <ExecDir>" -TestCases $executables { It "<ExecName> is installed in <ExecDir>" -TestCases $executables {
+2
View File
@@ -181,6 +181,7 @@
"mingw": [ "mingw": [
{ {
"arch": "mingw-w64-x86_64", "arch": "mingw-w64-x86_64",
"exec_dir": "mingw64",
"runtime_packages": [ "runtime_packages": [
{ {
"name": "clang", "name": "clang",
@@ -214,6 +215,7 @@
}, },
{ {
"arch": "mingw-w64-i686", "arch": "mingw-w64-i686",
"exec_dir": "mingw32",
"runtime_packages": [ "runtime_packages": [
{ {
"name": "clang", "name": "clang",
+2
View File
@@ -181,6 +181,7 @@
"mingw": [ "mingw": [
{ {
"arch": "mingw-w64-x86_64", "arch": "mingw-w64-x86_64",
"exec_dir": "mingw64",
"runtime_packages": [ "runtime_packages": [
{ {
"name": "clang", "name": "clang",
@@ -214,6 +215,7 @@
}, },
{ {
"arch": "mingw-w64-i686", "arch": "mingw-w64-i686",
"exec_dir": "mingw32",
"runtime_packages": [ "runtime_packages": [
{ {
"name": "clang", "name": "clang",