7 image: cirrusci/windowsservercore:2019
12 CIRRUS_SHELL: powershell
13 MSYS: winsymlinks:native
15 MSYS2_URL: https://github.com/msys2/msys2-installer/releases/download/2022-06-03/msys2-base-x86_64-20220603.sfx.exe
18 diffutils git grep make pkg-config sed
19 mingw-w64-x86_64-python
20 mingw-w64-x86_64-python-sphinx
21 mingw-w64-x86_64-toolchain
23 mingw-w64-x86_64-SDL2_image
25 mingw-w64-x86_64-glib2
26 mingw-w64-x86_64-ninja
27 mingw-w64-x86_64-jemalloc
30 mingw-w64-x86_64-libjpeg-turbo
31 mingw-w64-x86_64-pixman
32 mingw-w64-x86_64-libgcrypt
33 mingw-w64-x86_64-libpng
34 mingw-w64-x86_64-libssh
35 mingw-w64-x86_64-snappy
36 mingw-w64-x86_64-libusb
37 mingw-w64-x86_64-usbredir
38 mingw-w64-x86_64-libtasn1
39 mingw-w64-x86_64-nettle
40 mingw-w64-x86_64-cyrus-sasl
42 mingw-w64-x86_64-gnutls
43 mingw-w64-x86_64-libnfs
47 folder: C:\tools\archive
48 reupload_on_changes: false
49 # These env variables are used to generate fingerprint to trigger the cache procedure
50 # If wanna to force re-populate msys2, increase MSYS2_FINGERPRINT
53 echo $env:CIRRUS_TASK_NAME
55 echo $env:MSYS2_FINGERPRINT
56 echo $env:MSYS2_PACKAGES
59 md -Force C:\tools\archive\pkg
60 $start_time = Get-Date
61 bitsadmin /transfer msys_download /dynamic /download /priority FOREGROUND $env:MSYS2_URL C:\tools\archive\base.exe
62 Write-Output "Download time taken: $((Get-Date).Subtract($start_time))"
64 C:\tools\archive\base.exe -y
65 del -Force C:\tools\archive\base.exe
66 Write-Output "Base install time taken: $((Get-Date).Subtract($start_time))"
67 $start_time = Get-Date
69 ((Get-Content -path C:\tools\msys64\etc\\post-install\\07-pacman-key.post -Raw) -replace '--refresh-keys', '--version') | Set-Content -Path C:\tools\msys64\etc\\post-install\\07-pacman-key.post
70 C:\tools\msys64\usr\bin\bash.exe -lc "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf"
71 C:\tools\msys64\usr\bin\bash.exe -lc "export"
72 C:\tools\msys64\usr\bin\pacman.exe --noconfirm -Sy
73 echo Y | C:\tools\msys64\usr\bin\pacman.exe --noconfirm -Suu --overwrite=*
74 taskkill /F /FI "MODULES eq msys-2.0.dll"
76 C:\tools\msys64\usr\bin\bash.exe -lc "mv -f /etc/pacman.conf.pacnew /etc/pacman.conf || true"
77 C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syuu --overwrite=*"
78 Write-Output "Core install time taken: $((Get-Date).Subtract($start_time))"
79 $start_time = Get-Date
81 C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -S --needed $env:MSYS2_PACKAGES"
82 Write-Output "Package install time taken: $((Get-Date).Subtract($start_time))"
83 $start_time = Get-Date
85 del -Force -ErrorAction SilentlyContinue C:\tools\msys64\etc\mtab
86 del -Force -ErrorAction SilentlyContinue C:\tools\msys64\dev\fd
87 del -Force -ErrorAction SilentlyContinue C:\tools\msys64\dev\stderr
88 del -Force -ErrorAction SilentlyContinue C:\tools\msys64\dev\stdin
89 del -Force -ErrorAction SilentlyContinue C:\tools\msys64\dev\stdout
90 del -Force -Recurse -ErrorAction SilentlyContinue C:\tools\msys64\var\cache\pacman\pkg
91 tar cf C:\tools\archive\msys64.tar -C C:\tools\ msys64
93 Write-Output "Package archive time taken: $((Get-Date).Subtract($start_time))"
94 del -Force -Recurse -ErrorAction SilentlyContinue c:\tools\msys64
97 $start_time = Get-Date
99 ls C:\tools\archive\msys64.tar
100 tar xf C:\tools\archive\msys64.tar
101 Write-Output "Extract msys2 time taken: $((Get-Date).Subtract($start_time))"
103 - C:\tools\msys64\usr\bin\bash.exe -lc "mkdir build"
104 - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && ../configure --python=python3"
105 - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make -j8"
108 - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make V=1 check"