7 image: cirrusci/windowsservercore:2019
12 CIRRUS_SHELL: powershell
13 MSYS: winsymlinks:nativestrict
15 MSYS2_URL: https://github.com/msys2/msys2-installer/releases/download/2021-04-19/msys2-base-x86_64-20210419.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-libxml2
36 mingw-w64-x86_64-snappy
37 mingw-w64-x86_64-libusb
38 mingw-w64-x86_64-usbredir
39 mingw-w64-x86_64-libtasn1
40 mingw-w64-x86_64-nettle
41 mingw-w64-x86_64-cyrus-sasl
43 mingw-w64-x86_64-gnutls
44 mingw-w64-x86_64-libnfs
48 folder: C:\tools\archive
49 reupload_on_changes: false
50 # These env variables are used to generate fingerprint to trigger the cache procedure
51 # If wanna to force re-populate msys2, increase MSYS2_FINGERPRINT
54 echo $env:CIRRUS_TASK_NAME
56 echo $env:MSYS2_FINGERPRINT
57 echo $env:MSYS2_PACKAGES
60 md -Force C:\tools\archive\pkg
61 $start_time = Get-Date
62 bitsadmin /transfer msys_download /dynamic /download /priority FOREGROUND $env:MSYS2_URL C:\tools\archive\base.exe
63 Write-Output "Download time taken: $((Get-Date).Subtract($start_time))"
65 C:\tools\archive\base.exe -y
66 del -Force C:\tools\archive\base.exe
67 Write-Output "Base install time taken: $((Get-Date).Subtract($start_time))"
68 $start_time = Get-Date
70 ((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
71 C:\tools\msys64\usr\bin\bash.exe -lc "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf"
72 C:\tools\msys64\usr\bin\bash.exe -lc "export"
73 C:\tools\msys64\usr\bin\pacman.exe --noconfirm -Sy
74 echo Y | C:\tools\msys64\usr\bin\pacman.exe --noconfirm -Suu --overwrite=*
75 taskkill /F /FI "MODULES eq msys-2.0.dll"
77 C:\tools\msys64\usr\bin\bash.exe -lc "mv -f /etc/pacman.conf.pacnew /etc/pacman.conf || true"
78 C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syuu --overwrite=*"
79 Write-Output "Core install time taken: $((Get-Date).Subtract($start_time))"
80 $start_time = Get-Date
82 C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -S --needed $env:MSYS2_PACKAGES"
83 Write-Output "Package install time taken: $((Get-Date).Subtract($start_time))"
84 $start_time = Get-Date
86 del -Force -ErrorAction SilentlyContinue C:\tools\msys64\etc\mtab
87 del -Force -ErrorAction SilentlyContinue C:\tools\msys64\dev\fd
88 del -Force -ErrorAction SilentlyContinue C:\tools\msys64\dev\stderr
89 del -Force -ErrorAction SilentlyContinue C:\tools\msys64\dev\stdin
90 del -Force -ErrorAction SilentlyContinue C:\tools\msys64\dev\stdout
91 del -Force -Recurse -ErrorAction SilentlyContinue C:\tools\msys64\var\cache\pacman\pkg
92 tar cf C:\tools\archive\msys64.tar -C C:\tools\ msys64
94 Write-Output "Package archive time taken: $((Get-Date).Subtract($start_time))"
95 del -Force -Recurse -ErrorAction SilentlyContinue c:\tools\msys64
98 $start_time = Get-Date
100 ls C:\tools\archive\msys64.tar
101 tar xf C:\tools\archive\msys64.tar
102 Write-Output "Extract msys2 time taken: $((Get-Date).Subtract($start_time))"
104 - C:\tools\msys64\usr\bin\bash.exe -lc "mkdir build"
105 - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && ../configure --python=python3"
106 - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make -j8"
109 - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make V=1 check"