diff --git a/ci/docker/windows/Dockerfile b/ci/docker/windows/Dockerfile index 17418c97c2..3aa80dfb44 100644 --- a/ci/docker/windows/Dockerfile +++ b/ci/docker/windows/Dockerfile @@ -49,15 +49,15 @@ RUN New-ItemProperty -Path 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\FileSyste -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force RUN git config --system core.longpaths true -RUN c:\msys64\usr\bin\bash -lc 'pacman -S --noconfirm mingw-w64-ucrt-x86_64-toolchain ninja' +COPY upgrade_msys2.ps1 C:\ +RUN C:\upgrade_msys2.ps1 -RUN pip3 install meson==1.1.1 +RUN C:\msys64\msys2_shell.cmd -ucrt64 -defterm -here -no-start -use-full-path -lc 'pacman -S --noconfirm mingw-w64-ucrt-x86_64-toolchain ninja' + +RUN python -m pip install meson==1.1.1 RUN 'git config --global user.email "cirunner@gstreamer.freedesktop.org"; git config --global user.name "GStreamer CI system"' -COPY install_mingw.ps1 C:\ -RUN C:\install_mingw.ps1 - COPY install_rust.ps1 C:\ RUN C:\install_rust.ps1 @@ -67,4 +67,4 @@ COPY prepare_gst_env.ps1 C:\ RUN C:\prepare_gst_env.ps1 COPY prepare_cerbero_env.sh C:\ -RUN C:\MinGW\msys\1.0\bin\bash.exe --login -c "C:/prepare_cerbero_env.sh" +RUN C:\msys64\msys2_shell.cmd -ucrt64 -defterm -here -no-start -use-full-path -lc "C:/prepare_cerbero_env.sh" diff --git a/ci/docker/windows/install_mingw.ps1 b/ci/docker/windows/install_mingw.ps1 deleted file mode 100644 index e7542369b2..0000000000 --- a/ci/docker/windows/install_mingw.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; - -$msys_mingw_get_url = 'https://dotsrc.dl.osdn.net/osdn/mingw/68260/mingw-get-0.6.3-mingw32-pre-20170905-1-bin.tar.xz' - -Get-Date -Write-Host "Downloading and extracting mingw-get for MSYS" -Invoke-WebRequest -Uri $msys_mingw_get_url -OutFile C:\mingw-get.tar.xz -7z e C:\mingw-get.tar.xz -o"C:\\" -$res1 = $? -7z x C:\mingw-get.tar -o"C:\\MinGW" -$res2 = $? - -if (!($res1 -and $res2)) { - Write-Host "Failed to extract mingw-get" - Exit 1 -} - -Remove-Item C:\mingw-get.tar.xz -Force -Remove-Item C:\mingw-get.tar -Force - -Get-Date -Write-Host "Installing MSYS for Cerbero into C:/MinGW using mingw-get" -Start-Process -Wait C:\MinGW\bin\mingw-get.exe -ArgumentList 'install msys-base mingw32-base mingw-developer-toolkit' -if (!$?) { - Write-Host "Failed to install Msys for cerbero using MinGW" - Exit 1 -} - -Write-Host "MSYS/MinGW Install Complete" diff --git a/ci/docker/windows/prepare_cerbero_env.sh b/ci/docker/windows/prepare_cerbero_env.sh index 90fb80c765..eb1dd07454 100644 --- a/ci/docker/windows/prepare_cerbero_env.sh +++ b/ci/docker/windows/prepare_cerbero_env.sh @@ -18,7 +18,7 @@ echo 'vs_install_version = "vs17"' >> localconf.cbc # Fetch all package requirements for a visualstudio gstreamer build ./cerbero-uninstalled -t -v visualstudio -c localconf.cbc -c config/win64.cbc fetch-package --jobs=4 gstreamer-1.0 -# Fixup the MSYS installation +# Fixup the MSYS2 installation ./cerbero-uninstalled -t -c localconf.cbc -c config/win64.cbc bootstrap -y --build-tools=no --toolchains=no --offline # Wipe visualstudio package dist, sources, logs, and the build tools recipes diff --git a/ci/docker/windows/upgrade_msys2.ps1 b/ci/docker/windows/upgrade_msys2.ps1 new file mode 100644 index 0000000000..de1638b23e --- /dev/null +++ b/ci/docker/windows/upgrade_msys2.ps1 @@ -0,0 +1,11 @@ +$ErrorActionPreference = 'Continue' +# Perform a sysupgrade on MSYS2, otherwise it will do the upgrade at a later stage +while (1) { + C:\msys64\msys2_shell.cmd -ucrt64 -defterm -here -no-start -use-full-path -lc 'pacman -Syuu --noconfirm' + if (!$?) { + Write-Host "System upgrade needed to kill MSYS2 processes or something, running it again..." + continue + } + Write-Host "MSYS2 system upgrade complete" + break +}