Re: [PATCH 2/4] tests/lcitool: Remove g++ from the containers (except for the MinGW one)

2024-05-13 Thread Daniel P . Berrangé
On Mon, May 13, 2024 at 04:22:00PM +0200, Thomas Huth wrote:
> On 13/05/2024 14.11, Daniel P. Berrangé wrote:
> > On Mon, May 13, 2024 at 02:05:16PM +0200, Thomas Huth wrote:
> > > On 13/05/2024 12.28, Daniel P. Berrangé wrote:
> > > > A better way to handle this would be to define a separate project
> > > > 
> > > > 'tests/lcitool/projects/qemu-win-installer.yml'
> > > > 
> > > > With
> > > > 
> > > >  packages
> > > >- g++
> > > > 
> > > > Then enable the extra project for win64
> > > > 
> > > >   generate_dockerfile("fedora-win64-cross", "fedora-38",
> > > >   project='qemu,qemu-win-installer',
> > > >   cross="mingw64",
> > > >   trailer=cross_build("x86_64-w64-mingw32-",
> > > >   "x86_64-softmmu"))
> > > > 
> > > > which should result in an identical container to what we have today
> > > > for win64, while letting us slim the other containers.
> > > 
> > > Ok, good idea! ... but then we need to teach lcitool about mingw-w64-tools
> > > first, otherwise that vss code won't get built due to the missing "widl"
> > > tool.
> > 
> > Why is that a pre-requisite ?   What i've suggested will result in a
> > Dockerfile for win64 that is 100% identical to what we already have
> > in git today. So surely that will already succeed to the same extent
> > that CI succeeds today ?
> 
> If you want to have the same result, we can also simply remove g++
> everywhere, also for the mingw cross containers, since the vss code is
> currently not built at all due to the missing widl program.

Oh, I'm getting mixed up between the qemu-setup.exe and the qga installer
exe.

With 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 :|




Re: [PATCH 2/4] tests/lcitool: Remove g++ from the containers (except for the MinGW one)

2024-05-13 Thread Thomas Huth

On 13/05/2024 14.11, Daniel P. Berrangé wrote:

On Mon, May 13, 2024 at 02:05:16PM +0200, Thomas Huth wrote:

On 13/05/2024 12.28, Daniel P. Berrangé wrote:

On Mon, May 13, 2024 at 12:22:50PM +0200, Thomas Huth wrote:

We don't need C++ for the normal QEMU builds anymore, so installing
g++ in each and every container seems to be a waste of time and disk
space. The only container that still needs it is the Fedora MinGW
container that builds the only remaining C++ code in ./qga/vss-win32/
and we can install it here with an extra RUN statement instead.

This way we can also add the mingw-w64-tools package quite easily
which contains the x86_64-w64-mingw32-widl program that is required
for compiling the vss code of the guest agent (it was missing before
this change, so the VSS code was actually never compiled in the CI).

Signed-off-by: Thomas Huth 
---
   tests/lcitool/projects/qemu.yml |  1 -
   tests/lcitool/refresh   | 10 --
   2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/tests/lcitool/projects/qemu.yml b/tests/lcitool/projects/qemu.yml
index 9173d1e36e..b63b6bd850 100644
--- a/tests/lcitool/projects/qemu.yml
+++ b/tests/lcitool/projects/qemu.yml
@@ -22,7 +22,6 @@ packages:
- findutils
- flex
- fuse3
- - g++
- gcc
- gcc-native
- gcovr
diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
index 24a735a3f2..dda07ddcd1 100755
--- a/tests/lcitool/refresh
+++ b/tests/lcitool/refresh
@@ -109,6 +109,11 @@ debian12_extras = [
   "ENV QEMU_CONFIGURE_OPTS --enable-netmap\n"
   ]
+fedora_mingw_extras = [ "\n"
+"RUN nosync dnf install -y mingw64-gcc-c++ mingw-w64-tools && \\\n"
+"  ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/x86_64-w64-mingw32-c++ && 
\\\n"
+"  ln -s /usr/bin/ccache 
/usr/libexec/ccache-wrappers/x86_64-w64-mingw32-g++\n\n"
+]
   def cross_build(prefix, targets):
   conf = "ENV QEMU_CONFIGURE_OPTS --cross-prefix=%s\n" % (prefix)
@@ -193,8 +198,9 @@ try:
   generate_dockerfile("fedora-win64-cross", "fedora-38",
   cross="mingw64",
-trailer=cross_build("x86_64-w64-mingw32-",
-"x86_64-softmmu"))
+trailer="".join(fedora_mingw_extras)
++ cross_build("x86_64-w64-mingw32-",
+  "x86_64-softmmu"))
   #
   # Cirrus packages lists for GitLab


A better way to handle this would be to define a separate project

'tests/lcitool/projects/qemu-win-installer.yml'

With

 packages
   - g++

Then enable the extra project for win64

  generate_dockerfile("fedora-win64-cross", "fedora-38",
  project='qemu,qemu-win-installer',
  cross="mingw64",
  trailer=cross_build("x86_64-w64-mingw32-",
  "x86_64-softmmu"))

which should result in an identical container to what we have today
for win64, while letting us slim the other containers.


Ok, good idea! ... but then we need to teach lcitool about mingw-w64-tools
first, otherwise that vss code won't get built due to the missing "widl"
tool.


Why is that a pre-requisite ?   What i've suggested will result in a
Dockerfile for win64 that is 100% identical to what we already have
in git today. So surely that will already succeed to the same extent
that CI succeeds today ?


If you want to have the same result, we can also simply remove g++ 
everywhere, also for the mingw cross containers, since the vss code is 
currently not built at all due to the missing widl program.


 Thomas





Re: [PATCH 2/4] tests/lcitool: Remove g++ from the containers (except for the MinGW one)

2024-05-13 Thread Daniel P . Berrangé
On Mon, May 13, 2024 at 02:05:16PM +0200, Thomas Huth wrote:
> On 13/05/2024 12.28, Daniel P. Berrangé wrote:
> > On Mon, May 13, 2024 at 12:22:50PM +0200, Thomas Huth wrote:
> > > We don't need C++ for the normal QEMU builds anymore, so installing
> > > g++ in each and every container seems to be a waste of time and disk
> > > space. The only container that still needs it is the Fedora MinGW
> > > container that builds the only remaining C++ code in ./qga/vss-win32/
> > > and we can install it here with an extra RUN statement instead.
> > > 
> > > This way we can also add the mingw-w64-tools package quite easily
> > > which contains the x86_64-w64-mingw32-widl program that is required
> > > for compiling the vss code of the guest agent (it was missing before
> > > this change, so the VSS code was actually never compiled in the CI).
> > > 
> > > Signed-off-by: Thomas Huth 
> > > ---
> > >   tests/lcitool/projects/qemu.yml |  1 -
> > >   tests/lcitool/refresh   | 10 --
> > >   2 files changed, 8 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/tests/lcitool/projects/qemu.yml 
> > > b/tests/lcitool/projects/qemu.yml
> > > index 9173d1e36e..b63b6bd850 100644
> > > --- a/tests/lcitool/projects/qemu.yml
> > > +++ b/tests/lcitool/projects/qemu.yml
> > > @@ -22,7 +22,6 @@ packages:
> > >- findutils
> > >- flex
> > >- fuse3
> > > - - g++
> > >- gcc
> > >- gcc-native
> > >- gcovr
> > > diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
> > > index 24a735a3f2..dda07ddcd1 100755
> > > --- a/tests/lcitool/refresh
> > > +++ b/tests/lcitool/refresh
> > > @@ -109,6 +109,11 @@ debian12_extras = [
> > >   "ENV QEMU_CONFIGURE_OPTS --enable-netmap\n"
> > >   ]
> > > +fedora_mingw_extras = [ "\n"
> > > +"RUN nosync dnf install -y mingw64-gcc-c++ mingw-w64-tools && \\\n"
> > > +"  ln -s /usr/bin/ccache 
> > > /usr/libexec/ccache-wrappers/x86_64-w64-mingw32-c++ && \\\n"
> > > +"  ln -s /usr/bin/ccache 
> > > /usr/libexec/ccache-wrappers/x86_64-w64-mingw32-g++\n\n"
> > > +]
> > >   def cross_build(prefix, targets):
> > >   conf = "ENV QEMU_CONFIGURE_OPTS --cross-prefix=%s\n" % (prefix)
> > > @@ -193,8 +198,9 @@ try:
> > >   generate_dockerfile("fedora-win64-cross", "fedora-38",
> > >   cross="mingw64",
> > > -trailer=cross_build("x86_64-w64-mingw32-",
> > > -"x86_64-softmmu"))
> > > +trailer="".join(fedora_mingw_extras)
> > > ++ cross_build("x86_64-w64-mingw32-",
> > > +  "x86_64-softmmu"))
> > >   #
> > >   # Cirrus packages lists for GitLab
> > 
> > A better way to handle this would be to define a separate project
> > 
> >'tests/lcitool/projects/qemu-win-installer.yml'
> > 
> > With
> > 
> > packages
> >   - g++
> > 
> > Then enable the extra project for win64
> > 
> >  generate_dockerfile("fedora-win64-cross", "fedora-38",
> >  project='qemu,qemu-win-installer',
> >  cross="mingw64",
> >  trailer=cross_build("x86_64-w64-mingw32-",
> >  "x86_64-softmmu"))
> > 
> > which should result in an identical container to what we have today
> > for win64, while letting us slim the other containers.
> 
> Ok, good idea! ... but then we need to teach lcitool about mingw-w64-tools
> first, otherwise that vss code won't get built due to the missing "widl"
> tool.

Why is that a pre-requisite ?   What i've suggested will result in a
Dockerfile for win64 that is 100% identical to what we already have
in git today. So surely that will already succeed to the same extent
that CI succeeds today ?


With 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 :|




Re: [PATCH 2/4] tests/lcitool: Remove g++ from the containers (except for the MinGW one)

2024-05-13 Thread Thomas Huth

On 13/05/2024 12.28, Daniel P. Berrangé wrote:

On Mon, May 13, 2024 at 12:22:50PM +0200, Thomas Huth wrote:

We don't need C++ for the normal QEMU builds anymore, so installing
g++ in each and every container seems to be a waste of time and disk
space. The only container that still needs it is the Fedora MinGW
container that builds the only remaining C++ code in ./qga/vss-win32/
and we can install it here with an extra RUN statement instead.

This way we can also add the mingw-w64-tools package quite easily
which contains the x86_64-w64-mingw32-widl program that is required
for compiling the vss code of the guest agent (it was missing before
this change, so the VSS code was actually never compiled in the CI).

Signed-off-by: Thomas Huth 
---
  tests/lcitool/projects/qemu.yml |  1 -
  tests/lcitool/refresh   | 10 --
  2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/tests/lcitool/projects/qemu.yml b/tests/lcitool/projects/qemu.yml
index 9173d1e36e..b63b6bd850 100644
--- a/tests/lcitool/projects/qemu.yml
+++ b/tests/lcitool/projects/qemu.yml
@@ -22,7 +22,6 @@ packages:
   - findutils
   - flex
   - fuse3
- - g++
   - gcc
   - gcc-native
   - gcovr
diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
index 24a735a3f2..dda07ddcd1 100755
--- a/tests/lcitool/refresh
+++ b/tests/lcitool/refresh
@@ -109,6 +109,11 @@ debian12_extras = [
  "ENV QEMU_CONFIGURE_OPTS --enable-netmap\n"
  ]
  
+fedora_mingw_extras = [ "\n"

+"RUN nosync dnf install -y mingw64-gcc-c++ mingw-w64-tools && \\\n"
+"  ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/x86_64-w64-mingw32-c++ && 
\\\n"
+"  ln -s /usr/bin/ccache 
/usr/libexec/ccache-wrappers/x86_64-w64-mingw32-g++\n\n"
+]
  
  def cross_build(prefix, targets):

  conf = "ENV QEMU_CONFIGURE_OPTS --cross-prefix=%s\n" % (prefix)
@@ -193,8 +198,9 @@ try:
  
  generate_dockerfile("fedora-win64-cross", "fedora-38",

  cross="mingw64",
-trailer=cross_build("x86_64-w64-mingw32-",
-"x86_64-softmmu"))
+trailer="".join(fedora_mingw_extras)
++ cross_build("x86_64-w64-mingw32-",
+  "x86_64-softmmu"))
  
  #

  # Cirrus packages lists for GitLab


A better way to handle this would be to define a separate project

   'tests/lcitool/projects/qemu-win-installer.yml'

With

packages
  - g++

Then enable the extra project for win64

 generate_dockerfile("fedora-win64-cross", "fedora-38",
 project='qemu,qemu-win-installer',
 cross="mingw64",
 trailer=cross_build("x86_64-w64-mingw32-",
 "x86_64-softmmu"))

which should result in an identical container to what we have today
for win64, while letting us slim the other containers.


Ok, good idea! ... but then we need to teach lcitool about mingw-w64-tools 
first, otherwise that vss code won't get built due to the missing "widl" tool.


 Thomas




Re: [PATCH 2/4] tests/lcitool: Remove g++ from the containers (except for the MinGW one)

2024-05-13 Thread Daniel P . Berrangé
On Mon, May 13, 2024 at 12:22:50PM +0200, Thomas Huth wrote:
> We don't need C++ for the normal QEMU builds anymore, so installing
> g++ in each and every container seems to be a waste of time and disk
> space. The only container that still needs it is the Fedora MinGW
> container that builds the only remaining C++ code in ./qga/vss-win32/
> and we can install it here with an extra RUN statement instead.
> 
> This way we can also add the mingw-w64-tools package quite easily
> which contains the x86_64-w64-mingw32-widl program that is required
> for compiling the vss code of the guest agent (it was missing before
> this change, so the VSS code was actually never compiled in the CI).
> 
> Signed-off-by: Thomas Huth 
> ---
>  tests/lcitool/projects/qemu.yml |  1 -
>  tests/lcitool/refresh   | 10 --
>  2 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/lcitool/projects/qemu.yml b/tests/lcitool/projects/qemu.yml
> index 9173d1e36e..b63b6bd850 100644
> --- a/tests/lcitool/projects/qemu.yml
> +++ b/tests/lcitool/projects/qemu.yml
> @@ -22,7 +22,6 @@ packages:
>   - findutils
>   - flex
>   - fuse3
> - - g++
>   - gcc
>   - gcc-native
>   - gcovr
> diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
> index 24a735a3f2..dda07ddcd1 100755
> --- a/tests/lcitool/refresh
> +++ b/tests/lcitool/refresh
> @@ -109,6 +109,11 @@ debian12_extras = [
>  "ENV QEMU_CONFIGURE_OPTS --enable-netmap\n"
>  ]
>  
> +fedora_mingw_extras = [ "\n"
> +"RUN nosync dnf install -y mingw64-gcc-c++ mingw-w64-tools && \\\n"
> +"  ln -s /usr/bin/ccache 
> /usr/libexec/ccache-wrappers/x86_64-w64-mingw32-c++ && \\\n"
> +"  ln -s /usr/bin/ccache 
> /usr/libexec/ccache-wrappers/x86_64-w64-mingw32-g++\n\n"
> +]
>  
>  def cross_build(prefix, targets):
>  conf = "ENV QEMU_CONFIGURE_OPTS --cross-prefix=%s\n" % (prefix)
> @@ -193,8 +198,9 @@ try:
>  
>  generate_dockerfile("fedora-win64-cross", "fedora-38",
>  cross="mingw64",
> -trailer=cross_build("x86_64-w64-mingw32-",
> -"x86_64-softmmu"))
> +trailer="".join(fedora_mingw_extras)
> ++ cross_build("x86_64-w64-mingw32-",
> +  "x86_64-softmmu"))
>  
>  #
>  # Cirrus packages lists for GitLab

A better way to handle this would be to define a separate project

  'tests/lcitool/projects/qemu-win-installer.yml'

With

   packages
 - g++

Then enable the extra project for win64

generate_dockerfile("fedora-win64-cross", "fedora-38",
project='qemu,qemu-win-installer',
cross="mingw64",
trailer=cross_build("x86_64-w64-mingw32-",
"x86_64-softmmu"))

which should result in an identical container to what we have today
for win64, while letting us slim the other containers.

With 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 :|




[PATCH 2/4] tests/lcitool: Remove g++ from the containers (except for the MinGW one)

2024-05-13 Thread Thomas Huth
We don't need C++ for the normal QEMU builds anymore, so installing
g++ in each and every container seems to be a waste of time and disk
space. The only container that still needs it is the Fedora MinGW
container that builds the only remaining C++ code in ./qga/vss-win32/
and we can install it here with an extra RUN statement instead.

This way we can also add the mingw-w64-tools package quite easily
which contains the x86_64-w64-mingw32-widl program that is required
for compiling the vss code of the guest agent (it was missing before
this change, so the VSS code was actually never compiled in the CI).

Signed-off-by: Thomas Huth 
---
 tests/lcitool/projects/qemu.yml |  1 -
 tests/lcitool/refresh   | 10 --
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/tests/lcitool/projects/qemu.yml b/tests/lcitool/projects/qemu.yml
index 9173d1e36e..b63b6bd850 100644
--- a/tests/lcitool/projects/qemu.yml
+++ b/tests/lcitool/projects/qemu.yml
@@ -22,7 +22,6 @@ packages:
  - findutils
  - flex
  - fuse3
- - g++
  - gcc
  - gcc-native
  - gcovr
diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
index 24a735a3f2..dda07ddcd1 100755
--- a/tests/lcitool/refresh
+++ b/tests/lcitool/refresh
@@ -109,6 +109,11 @@ debian12_extras = [
 "ENV QEMU_CONFIGURE_OPTS --enable-netmap\n"
 ]
 
+fedora_mingw_extras = [ "\n"
+"RUN nosync dnf install -y mingw64-gcc-c++ mingw-w64-tools && \\\n"
+"  ln -s /usr/bin/ccache 
/usr/libexec/ccache-wrappers/x86_64-w64-mingw32-c++ && \\\n"
+"  ln -s /usr/bin/ccache 
/usr/libexec/ccache-wrappers/x86_64-w64-mingw32-g++\n\n"
+]
 
 def cross_build(prefix, targets):
 conf = "ENV QEMU_CONFIGURE_OPTS --cross-prefix=%s\n" % (prefix)
@@ -193,8 +198,9 @@ try:
 
 generate_dockerfile("fedora-win64-cross", "fedora-38",
 cross="mingw64",
-trailer=cross_build("x86_64-w64-mingw32-",
-"x86_64-softmmu"))
+trailer="".join(fedora_mingw_extras)
++ cross_build("x86_64-w64-mingw32-",
+  "x86_64-softmmu"))
 
 #
 # Cirrus packages lists for GitLab
-- 
2.45.0