All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Improve cirrus msys2
@ 2020-10-07  3:51 Yonggang Luo
  2020-10-07  3:51 ` [PATCH v3 1/3] docker: Add win32/msys2/mingw64 docker Yonggang Luo
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Yonggang Luo @ 2020-10-07  3:51 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Thomas Huth, QEMU Trivial,
	Philippe Mathieu-Daudé,
	Yonggang Luo, Paolo Bonzini

Fixes the broken msys2/mingw ci and speed it up.

V2-V3
Add one more patch:
cirrus: msys2/mingw speed is up, add excluded target back
Do not build sphinx on windows, that's failing
set the number of parallel count to fixed number 8

V1-V2
Resolve the cirrus conflict

Yonggang Luo (3):
  docker: Add win32/msys2/mingw64 docker
  cirrus: Fixing and speedup the msys2/mingw CI
  cirrus: msys2/mingw speed is up, add excluded target back

 .cirrus.yml                           | 63 +++++++--------------------
 tests/docker/dockerfiles/msys2.docker | 57 ++++++++++++++++++++++++
 2 files changed, 73 insertions(+), 47 deletions(-)
 create mode 100644 tests/docker/dockerfiles/msys2.docker

-- 
2.28.0.windows.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v3 1/3] docker: Add win32/msys2/mingw64 docker
  2020-10-07  3:51 [PATCH v3 0/3] Improve cirrus msys2 Yonggang Luo
@ 2020-10-07  3:51 ` Yonggang Luo
  2020-10-07  3:51 ` [PATCH v3 2/3] cirrus: Fixing and speedup the msys2/mingw CI Yonggang Luo
  2020-10-07  3:51 ` [PATCH v3 3/3] cirrus: msys2/mingw speed is up, add excluded target back Yonggang Luo
  2 siblings, 0 replies; 8+ messages in thread
From: Yonggang Luo @ 2020-10-07  3:51 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Thomas Huth, QEMU Trivial,
	Philippe Mathieu-Daudé,
	Yonggang Luo, Paolo Bonzini

This docker is used to preparing a msys2/mingw with basic software installed.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
 tests/docker/dockerfiles/msys2.docker | 57 +++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 tests/docker/dockerfiles/msys2.docker

diff --git a/tests/docker/dockerfiles/msys2.docker b/tests/docker/dockerfiles/msys2.docker
new file mode 100644
index 0000000000..ce1404cbb8
--- /dev/null
+++ b/tests/docker/dockerfiles/msys2.docker
@@ -0,0 +1,57 @@
+FROM mcr.microsoft.com/windows/servercore:2004
+RUN cmd /S /C powershell -NoLogo -NoProfile -Command netsh interface ipv4 show interfaces ; netsh interface ipv4 set subinterface 18 mtu=1460 store=persistent ; netsh interface ipv4 show interfaces ; Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) ;
+RUN choco install -y --no-progress git 7zip
+RUN cmd /S /C powershell -NoLogo -NoProfile -Command Remove-Item C:\ProgramData\chocolatey\logs -Force -Recurse ; Remove-Item C:\Users\ContainerAdministrator\AppData\Local\Temp -Force -Recurse
+RUN mkdir C:\tools
+RUN bitsadmin /transfer msys_download /dynamic /download /priority FOREGROUND https://github.com/msys2/msys2-installer/releases/download/2020-09-03/msys2-base-x86_64-20200903.sfx.exe C:\tools\base.exe
+RUN cd /d C:\tools && base.exe -y
+RUN cmd /S /C powershell -NoLogo -NoProfile -Command "((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"
+RUN C:\tools\msys64\usr\bin\bash.exe -lc "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf"
+RUN C:\tools\msys64\usr\bin\bash.exe -lc "echo $MSYSTEM" >nul 2>&1
+# RUN C:\tools\msys64\usr\bin\bash.exe -lc "sed -i 's/Server = http:\/\/repo.msys2.org\/msys\/.arch\///g' /etc/pacman.d/mirrorlist.msys"
+# RUN C:\tools\msys64\usr\bin\bash.exe -lc "sed -i 's/Server = http:\/\/repo.msys2.org\/mingw\/i686\///g' /etc/pacman.d/mirrorlist.mingw32"
+# RUN C:\tools\msys64\usr\bin\bash.exe -lc "sed -i 's/Server = http:\/\/repo.msys2.org\/mingw\/x86_64\///g' /etc/pacman.d/mirrorlist.mingw64"
+RUN C:\tools\msys64\usr\bin\bash.exe -lc "grep -rl 'repo.msys2.org/' /etc/pacman.d/mirrorlist.* | xargs sed -i 's/repo.msys2.org\//mirrors.tuna.tsinghua.edu.cn\/msys2\//g'"
+RUN C:\tools\msys64\usr\bin\pacman.exe --noconfirm -Sy
+RUN echo Y | C:\tools\msys64\usr\bin\pacman.exe -Suu --noconfirm --needed
+RUN taskkill /F /FI "MODULES eq msys-2.0.dll"
+RUN tasklist
+RUN C:\tools\msys64\usr\bin\bash.exe -lc "pacman.exe --noconfirm -S --needed \
+base-devel \
+git \
+mingw-w64-x86_64-python \
+mingw-w64-x86_64-python-setuptools \
+mingw-w64-x86_64-toolchain \
+mingw-w64-x86_64-SDL2 \
+mingw-w64-x86_64-SDL2_image \
+mingw-w64-x86_64-gtk3 \
+mingw-w64-x86_64-glib2 \
+mingw-w64-x86_64-ninja \
+mingw-w64-x86_64-make \
+mingw-w64-x86_64-jemalloc \
+mingw-w64-x86_64-lzo2 \
+mingw-w64-x86_64-zstd \
+mingw-w64-x86_64-libjpeg-turbo \
+mingw-w64-x86_64-pixman \
+mingw-w64-x86_64-libgcrypt \
+mingw-w64-x86_64-libpng \
+mingw-w64-x86_64-libssh \
+mingw-w64-x86_64-libxml2 \
+mingw-w64-x86_64-snappy \
+mingw-w64-x86_64-libusb \
+mingw-w64-x86_64-usbredir \
+mingw-w64-x86_64-libtasn1 \
+mingw-w64-x86_64-nettle \
+mingw-w64-x86_64-cyrus-sasl \
+mingw-w64-x86_64-curl \
+mingw-w64-x86_64-gnutls \
+mingw-w64-x86_64-zstd"
+
+RUN C:\tools\msys64\usr\bin\bash.exe -lc "rm -rf /var/cache/pacman/pkg/*"
+RUN del C:\tools\base.exe
+RUN cd C:\tools\msys64 && cmd /C "7z a -ttar . -so | 7z a -txz -simsys2-x86_64.tar C:\tools\msys2-x86_64.tar.xz"
+# docker build --tag lygstate/windowsservercore:msys2 -f "msys2.docker" .
+# docker run -it --rm -v c:/work:c:/work lygstate/windowsservercore:msys2 cmd
+# docker push lygstate/windowsservercore:msys2
+# no cache
+# docker build --no-cache --tag lygstate/windowsservercore:msys2 -f "msys2.docker" .
-- 
2.28.0.windows.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v3 2/3] cirrus: Fixing and speedup the msys2/mingw CI
  2020-10-07  3:51 [PATCH v3 0/3] Improve cirrus msys2 Yonggang Luo
  2020-10-07  3:51 ` [PATCH v3 1/3] docker: Add win32/msys2/mingw64 docker Yonggang Luo
@ 2020-10-07  3:51 ` Yonggang Luo
  2020-10-07  8:18   ` Paolo Bonzini
  2020-10-07  3:51 ` [PATCH v3 3/3] cirrus: msys2/mingw speed is up, add excluded target back Yonggang Luo
  2 siblings, 1 reply; 8+ messages in thread
From: Yonggang Luo @ 2020-10-07  3:51 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Thomas Huth, QEMU Trivial,
	Philippe Mathieu-Daudé,
	Yonggang Luo, Paolo Bonzini

Using a prepared https://github.com/lygstate/qemu/releases/download/v5.1.0/msys2-x86_64.tar.xz
for speed up the msys2/mingw prepare speed on the cirrus CI.
This file are generated by the msys2.docker

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
 .cirrus.yml | 60 ++++++++++++++---------------------------------------
 1 file changed, 15 insertions(+), 45 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index d58782ce67..bf5a0990ec 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -47,63 +47,33 @@ macos_xcode_task:
 
 windows_msys2_task:
   windows_container:
-    image: cirrusci/windowsservercore:cmake
+    image: cirrusci/windowsservercore:2019
     os_version: 2019
     cpu: 8
     memory: 8G
   env:
+    CIRRUS_SHELL: powershell
     MSYS: winsymlinks:nativestrict
     MSYSTEM: MINGW64
     CHERE_INVOKING: 1
-  printenv_script:
-    - C:\tools\msys64\usr\bin\bash.exe -lc 'printenv'
   install_script:
-    - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools &&
-        curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz"
-    - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools &&
-        curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig"
-    - C:\tools\msys64\usr\bin\bash.exe -lc "cd /c/tools &&
-        pacman -U --noconfirm msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz"
-    - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Sy"
-    - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -S --needed
-        bash pacman pacman-mirrors msys2-runtime"
-    - taskkill /F /IM gpg-agent.exe
-    - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Su"
-    - C:\tools\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -S --needed
-        base-devel
-        git
-        mingw-w64-x86_64-python
-        mingw-w64-x86_64-python-setuptools
-        mingw-w64-x86_64-toolchain
-        mingw-w64-x86_64-capstone
-        mingw-w64-x86_64-SDL2
-        mingw-w64-x86_64-SDL2_image
-        mingw-w64-x86_64-gtk3
-        mingw-w64-x86_64-glib2
-        mingw-w64-x86_64-ninja
-        mingw-w64-x86_64-make
-        mingw-w64-x86_64-lzo2
-        mingw-w64-x86_64-zstd
-        mingw-w64-x86_64-libjpeg-turbo
-        mingw-w64-x86_64-pixman
-        mingw-w64-x86_64-libgcrypt
-        mingw-w64-x86_64-libpng
-        mingw-w64-x86_64-libssh
-        mingw-w64-x86_64-libxml2
-        mingw-w64-x86_64-snappy
-        mingw-w64-x86_64-libusb
-        mingw-w64-x86_64-usbredir
-        mingw-w64-x86_64-libtasn1
-        mingw-w64-x86_64-nettle
-        mingw-w64-x86_64-cyrus-sasl
-        mingw-w64-x86_64-curl
-        mingw-w64-x86_64-gnutls
-        mingw-w64-x86_64-zstd"
+    - |
+      Write-Output $env:PATH
+      md C:\tools
+      $start_time = Get-Date
+      bitsadmin /transfer msys_download /dynamic /download /priority FOREGROUND https://github.com/lygstate/qemu/releases/download/v5.1.0/msys2-x86_64.tar.xz C:\tools\msys2-x86_64.tar.xz
+      Write-Output "Download time taken: $((Get-Date).Subtract($start_time).Seconds) second(s)"
+      $start_time = Get-Date
+      cd C:\tools
+      choco install -y --no-progress 7zip
+      cmd /C "7z x msys2-x86_64.tar.xz -so | 7z x -aoa -simsys2-x86_64.tar -ttar -omsys64"
+      Write-Output "Extract time taken: $((Get-Date).Subtract($start_time).Seconds) second(s)"
+
   script:
     - C:\tools\msys64\usr\bin\bash.exe -lc "mkdir build"
     - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && ../configure
       --python=python3 --ninja=ninja
       --target-list-exclude=i386-softmmu,arm-softmmu,ppc-softmmu,mips-softmmu"
-    - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make -j$NUMBER_OF_PROCESSORS"
+    - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make -j8"
   test_script:
     - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make V=1 check"
-- 
2.28.0.windows.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v3 3/3] cirrus: msys2/mingw speed is up, add excluded target back
  2020-10-07  3:51 [PATCH v3 0/3] Improve cirrus msys2 Yonggang Luo
  2020-10-07  3:51 ` [PATCH v3 1/3] docker: Add win32/msys2/mingw64 docker Yonggang Luo
  2020-10-07  3:51 ` [PATCH v3 2/3] cirrus: Fixing and speedup the msys2/mingw CI Yonggang Luo
@ 2020-10-07  3:51 ` Yonggang Luo
  2 siblings, 0 replies; 8+ messages in thread
From: Yonggang Luo @ 2020-10-07  3:51 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Thomas Huth, QEMU Trivial,
	Philippe Mathieu-Daudé,
	Yonggang Luo, Paolo Bonzini

The following target are add back:
i386-softmmu,arm-softmmu,ppc-softmmu,mips-softmmu

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
 .cirrus.yml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index bf5a0990ec..39a175d569 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -72,8 +72,7 @@ windows_msys2_task:
   script:
     - C:\tools\msys64\usr\bin\bash.exe -lc "mkdir build"
     - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && ../configure
-      --python=python3 --ninja=ninja
-      --target-list-exclude=i386-softmmu,arm-softmmu,ppc-softmmu,mips-softmmu"
+      --python=python3 --ninja=ninja"
     - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make -j8"
   test_script:
     - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make V=1 check"
-- 
2.28.0.windows.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 2/3] cirrus: Fixing and speedup the msys2/mingw CI
  2020-10-07  3:51 ` [PATCH v3 2/3] cirrus: Fixing and speedup the msys2/mingw CI Yonggang Luo
@ 2020-10-07  8:18   ` Paolo Bonzini
  2020-10-07  8:32     ` Daniel P. Berrangé
  2020-10-07  8:41     ` Thomas Huth
  0 siblings, 2 replies; 8+ messages in thread
From: Paolo Bonzini @ 2020-10-07  8:18 UTC (permalink / raw)
  To: Yonggang Luo, qemu-devel
  Cc: QEMU Trivial, Peter Maydell, Thomas Huth, Philippe Mathieu-Daudé

On 07/10/20 05:51, Yonggang Luo wrote:
> Using a prepared https://github.com/lygstate/qemu/releases/download/v5.1.0/msys2-x86_64.tar.xz
> for speed up the msys2/mingw prepare speed on the cirrus CI.
> This file are generated by the msys2.docker

The speedup is nice, but we need to be able to regenerate the tarball
without access to a Windows machine.  Otherwise whoever adds a new
dependency cannot test it himself with CI.

Ideally, the tarball would be generated by the containers job in the
Gitlab CI, but I'm not sure if that's possible.

On top of this, whoever commits this needs to replace the URL with
something under download.qemu.org, but that's the easy part.

Paolo



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 2/3] cirrus: Fixing and speedup the msys2/mingw CI
  2020-10-07  8:18   ` Paolo Bonzini
@ 2020-10-07  8:32     ` Daniel P. Berrangé
  2020-10-07  8:41     ` Thomas Huth
  1 sibling, 0 replies; 8+ messages in thread
From: Daniel P. Berrangé @ 2020-10-07  8:32 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Peter Maydell, Thomas Huth, QEMU Trivial, qemu-devel,
	Philippe Mathieu-Daudé,
	Yonggang Luo

On Wed, Oct 07, 2020 at 10:18:48AM +0200, Paolo Bonzini wrote:
> On 07/10/20 05:51, Yonggang Luo wrote:
> > Using a prepared https://github.com/lygstate/qemu/releases/download/v5.1.0/msys2-x86_64.tar.xz
> > for speed up the msys2/mingw prepare speed on the cirrus CI.
> > This file are generated by the msys2.docker
> 
> The speedup is nice, but we need to be able to regenerate the tarball
> without access to a Windows machine.  Otherwise whoever adds a new
> dependency cannot test it himself with CI.
> 
> Ideally, the tarball would be generated by the containers job in the
> Gitlab CI, but I'm not sure if that's possible.

IMHO any caching should be integrated into the Cirrus CI job itself.
Cirrus has builtin support for caching the contents of a folder, so
the first time the job runs it should populate the cache, and that
can be used thereafter.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 2/3] cirrus: Fixing and speedup the msys2/mingw CI
  2020-10-07  8:18   ` Paolo Bonzini
  2020-10-07  8:32     ` Daniel P. Berrangé
@ 2020-10-07  8:41     ` Thomas Huth
  2020-10-07  8:54       ` 罗勇刚(Yonggang Luo)
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Huth @ 2020-10-07  8:41 UTC (permalink / raw)
  To: Paolo Bonzini, Yonggang Luo, qemu-devel
  Cc: QEMU Trivial, Peter Maydell, Philippe Mathieu-Daudé

On 07/10/2020 10.18, Paolo Bonzini wrote:
[...]
> 
> On top of this, whoever commits this needs to replace the URL with
> something under download.qemu.org, but that's the easy part.

I agree with Daniel - please let's not get go this way again. We've had this
with the various Free-/Net-/OpenBSD images in the past, and then we were
suddenly stuck with a fixed image where most people were not able to change
it anymore. That was very frustrating.

Apart from that, you also have to respect the GPL if you provide binaries
... so you'd need to gather all the sources for that blob, too, and be ready
to provide those in case somebody asks...

Yonggang, could you please try to use the caching mechanism of Cirrus-CI
instead? See https://cirrus-ci.org/guide/writing-tasks/#cache-instruction
... then we're a little bit more independent from downloading the msys2 for
each CI run.

 Thomas



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 2/3] cirrus: Fixing and speedup the msys2/mingw CI
  2020-10-07  8:41     ` Thomas Huth
@ 2020-10-07  8:54       ` 罗勇刚(Yonggang Luo)
  0 siblings, 0 replies; 8+ messages in thread
From: 罗勇刚(Yonggang Luo) @ 2020-10-07  8:54 UTC (permalink / raw)
  To: Thomas Huth
  Cc: QEMU Trivial, Paolo Bonzini, Philippe Mathieu-Daudé,
	qemu-level, Peter Maydell

[-- Attachment #1: Type: text/plain, Size: 1146 bytes --]

On Wed, Oct 7, 2020 at 4:41 PM Thomas Huth <thuth@redhat.com> wrote:
>
> On 07/10/2020 10.18, Paolo Bonzini wrote:
> [...]
> >
> > On top of this, whoever commits this needs to replace the URL with
> > something under download.qemu.org, but that's the easy part.
>
> I agree with Daniel - please let's not get go this way again. We've had
this
> with the various Free-/Net-/OpenBSD images in the past, and then we were
> suddenly stuck with a fixed image where most people were not able to
change
> it anymore. That was very frustrating.
>
> Apart from that, you also have to respect the GPL if you provide binaries
> ... so you'd need to gather all the sources for that blob, too, and be
ready
> to provide those in case somebody asks...
>
> Yonggang, could you please try to use the caching mechanism of Cirrus-CI
> instead? See https://cirrus-ci.org/guide/writing-tasks/#cache-instruction
> ... then we're a little bit more independent from downloading the msys2
for
> each CI run.
Looks good for me, let's me investigate
>
>  Thomas
>


--
         此致
礼
罗勇刚
Yours
    sincerely,
Yonggang Luo

[-- Attachment #2: Type: text/html, Size: 1512 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-10-07  8:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07  3:51 [PATCH v3 0/3] Improve cirrus msys2 Yonggang Luo
2020-10-07  3:51 ` [PATCH v3 1/3] docker: Add win32/msys2/mingw64 docker Yonggang Luo
2020-10-07  3:51 ` [PATCH v3 2/3] cirrus: Fixing and speedup the msys2/mingw CI Yonggang Luo
2020-10-07  8:18   ` Paolo Bonzini
2020-10-07  8:32     ` Daniel P. Berrangé
2020-10-07  8:41     ` Thomas Huth
2020-10-07  8:54       ` 罗勇刚(Yonggang Luo)
2020-10-07  3:51 ` [PATCH v3 3/3] cirrus: msys2/mingw speed is up, add excluded target back Yonggang Luo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.