From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5980CC433FE for ; Wed, 20 Apr 2022 11:19:16 +0000 (UTC) Received: from localhost ([::1]:54912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nh8Md-0002dB-FQ for qemu-devel@archiver.kernel.org; Wed, 20 Apr 2022 07:19:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38760) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nh8L6-0000TX-9Z for qemu-devel@nongnu.org; Wed, 20 Apr 2022 07:17:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:36654) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nh8L4-0006Bl-7S for qemu-devel@nongnu.org; Wed, 20 Apr 2022 07:17:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650453457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WIElod5gheGrWa9eg7HJ0J1AsMWnEhrBpoW7KVTweCk=; b=T/rWUbN41Y7DYtAeg5VO51QYs8e/EWxjR83sJvHcqU5Sqs5rz9Y5Q+VrKkYCDPHeUE7XMH kRK4rBYJVJ6wp2kGJrC4JNv+oy2wakrJVmUFN/Hta1wiLz2fm4g8CbXQ6OWWfGU+uLeIPD Jyge01qzjgg2LKf/MMBrUYMzkD2krYQ= Received: from mail-yb1-f200.google.com (mail-yb1-f200.google.com [209.85.219.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-618-z5CWvKb7O_6o-kSC2uvwig-1; Wed, 20 Apr 2022 07:17:35 -0400 X-MC-Unique: z5CWvKb7O_6o-kSC2uvwig-1 Received: by mail-yb1-f200.google.com with SMTP id s43-20020a25aa2e000000b006453e8e5bb8so1142695ybi.14 for ; Wed, 20 Apr 2022 04:17:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WIElod5gheGrWa9eg7HJ0J1AsMWnEhrBpoW7KVTweCk=; b=v5YWQ3xwx6jryG5jnChiJGsakScUJf0Ffjrio2dH1H616AP2jofD+7QHn7dqYmnSfd z54Yd1qbInB6ERBSCW5QjB3c0ifT14ZVavTdhtuZpvUCarl0doDz1BSXxqo7xF97WZZm Sr43OvZ7Hp9NU4nGOqhDSvmrmPn3wTWlDmr6QtrO9q74Ao7u9VJ3tSgcjpsSyCQFmNJq EdgHz9wvUEsT6zPVKc3P1euT47JKSXQT+942nLYpwsYlqGQtfAtXorKW/SVj7/wrGzGj OCQSbBFF3H4f20mw0mkCVI0QWeVwhMD1FBWJvNJQh9ymZ9dvAPjUlTaPy8wNiM04bOKC 7PkA== X-Gm-Message-State: AOAM5316IG4lRk3Z24t2wv3GH+XNlsHcZhSixTfntBZMAwYqN0WNCQkJ 9PmcE4wmCYFdEKba+ese3FAkwFEEZgJ//3eqTW4rxZfLPi02KnCdE52VlqvPpVKJqSvof6hrD9S g1MND7v7b5jhmo6xx63Cy2o05+sBK5zg= X-Received: by 2002:a05:6902:286:b0:63d:d035:73f4 with SMTP id v6-20020a056902028600b0063dd03573f4mr18609052ybh.205.1650453455272; Wed, 20 Apr 2022 04:17:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwySvR8xf6rpZG4PYXtJ7KFs8blc7QVQTZgUzG7HEzeONHMp/z4hyOZw3nzr2hhD2Pa9wTEZFK8BWzH6Vm5rFE= X-Received: by 2002:a05:6902:286:b0:63d:d035:73f4 with SMTP id v6-20020a056902028600b0063dd03573f4mr18609039ybh.205.1650453455078; Wed, 20 Apr 2022 04:17:35 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Konstantin Kostiuk Date: Wed, 20 Apr 2022 14:17:24 +0300 Message-ID: Subject: Re: [PATCH] qga/vss-win32: enable qga-vss.tlb generation with widl To: Helge Konetzka , =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Content-Type: multipart/alternative; boundary="000000000000e89bed05dd1423bc" Received-SPF: pass client-ip=170.10.133.124; envelope-from=kkostiuk@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Roth , QEMU Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --000000000000e89bed05dd1423bc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Helge, I checked what happened in MSYS2 and this looks like a bug in the widl tool= . I looked into the widl source code and think that it detects the default include path incorrectly. During build of widl tool the corresponding variable receive incorrect value: `BIN_TO_INCLUDEDIR =3D ../x86_64-w64-mingw32/include` but should be `BIN_TO_INCLUDEDIR =3D ../include`. Looks like a package mismatch, because the `/ming64/x86_64-w64-mingw32` directory exist but contains only few libs and no any include files. So I agreed with Marc-Andr=C3=A9. I think this bug should be fixed in MSYS2= . I think you can report this issue there https://github.com/msys2/MINGW-packages/issues When I checked the build using cross-compilation from Linux, the widl tool uses proper BIN_TO_INCLUDEDIR. We should add the rule that qga_vss depends on gen_tlb to get this error more visible. Marc-Andr=C3=A9, what do you think? Best Regards, Konstantin Kostiuk. On Mon, Apr 18, 2022 at 11:15 AM Marc-Andr=C3=A9 Lureau < marcandre.lureau@gmail.com> wrote: > Hi Helge > > On Sun, Apr 17, 2022 at 6:51 PM Helge Konetzka wrote: > >> Generation with widl needs to be triggered explicitly and requires >> library and include directories containing referenced *.idl and *.tlb >> as parameters. >> > > Ok, that's different issues, it would help to split the patch. > > >> >> Signed-off-by: Helge Konetzka >> --- >> >> For tested Msys2 build all referenced resources reside in //include= . >> Msys2 provides its flavours in different / bases. >> >> This patch derives the missing include directory path from widl path. >> Assuming the given widl path is //bin/widl, it determines / >> as base and appends //include as include and library directories >> to widl command. This way the directory is correct for any Msys2 >> flavour. >> It makes sure, only existing directories are appended as parameter. >> > > I would file a bug to msys2 instead for widl to use the default include > directory. Otherwise, every widl user out there needs to be adjusted. > (I think it would need a special --with-widl-includedir=3DDIR, given how > msys2 remaps directory) > > >> --- >> qga/vss-win32/meson.build | 11 +++++++++-- >> 1 file changed, 9 insertions(+), 2 deletions(-) >> >> diff --git a/qga/vss-win32/meson.build b/qga/vss-win32/meson.build >> index 71c50d0866..51539a582c 100644 >> --- a/qga/vss-win32/meson.build >> +++ b/qga/vss-win32/meson.build >> @@ -30,9 +30,16 @@ if midl.found() >> input: 'qga-vss.idl', >> output: 'qga-vss.tlb', >> command: [midl, '@INPUT@', '/tlb', '@OUTPUT@ >> ']) >> -else >> +elif widl.found() >> + widl_cmd =3D [widl, '-t', '@INPUT@', '-o', '@OUTPUT@'] >> + usr_include =3D fs.parent(fs.parent(widl.full_path()))/'include' >> + if fs.is_dir(usr_include) >> + widl_cmd +=3D ['-L', usr_include] >> + widl_cmd +=3D ['-I', usr_include] >> + endif >> gen_tlb =3D custom_target('gen-tlb', >> input: 'qga-vss.idl', >> output: 'qga-vss.tlb', >> - command: [widl, '-t', '@INPUT@', '-o', >> '@OUTPUT@']) >> + build_by_default: true, >> > > I would make qga_vss depend on gen_tlb instead (so the tlb is always buil= t > with the dll) > > thanks > > -- > Marc-Andr=C3=A9 Lureau > --000000000000e89bed05dd1423bc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Helge,

I checked what hap= pened in MSYS2 and this looks like a bug in the widl tool.

I looked = into the widl source code and think that it detects the default include pat= h incorrectly.

During build of widl tool the corresponding variable= receive incorrect value:
`BIN_TO_INCLUDEDIR =3D ../x86_64-w= 64-mingw32/include` but should be
`BIN_TO_INCLUDEDIR =3D ../= include`. Looks like a package mismatch,
because the `/ming6= 4/x86_64-w64-mingw32` directory exist
but contains only few = libs and no any include files.

So I agreed with Marc-Andr=C3=A9. I t= hink this bug should be fixed in MSYS2.
I think you can report th= is issue there h= ttps://github.com/msys2/MINGW-packages/issues

When I chec= ked the build using cross-compilation from Linux,
the widl t= ool uses proper BIN_TO_INCLUDEDIR.

We should add the rule that qga_v= ss depends on gen_tlb to get this error more visible.

<= div>Marc-Andr=C3=A9, what do you think?

<= div>
Best Regards,
Konstantin Kostiuk.


<= div dir=3D"ltr" class=3D"gmail_attr">On Mon, Apr 18, 2022 at 11:15 AM Marc-= Andr=C3=A9 Lureau <marcand= re.lureau@gmail.com> wrote:
Hi Helge

=
On Sun, Ap= r 17, 2022 at 6:51 PM Helge Konetzka <hk@zapateado.de> wrote:
Generation with widl needs to be triggere= d explicitly and requires
library and include directories containing referenced *.idl and *.tlb
as parameters.

Ok, that's different= issues, it would help to split the patch.
=C2=A0

Signed-off-by: Helge Konetzka <hk@zapateado.de>
---

For tested Msys2 build all referenced resources reside in /<usr>/incl= ude.
Msys2 provides its flavours in different /<usr> bases.

This patch derives the missing include directory path from widl path.
Assuming the given widl path is /<usr>/bin/widl, it determines /<u= sr>
as base and appends /<usr>/include as include and library directories=
to widl command. This way the directory is correct for any Msys2
flavour.
It makes sure, only existing directories are appended as parameter.

I would file a bug to msys2 instead for widl t= o use the default include directory. Otherwise, every widl user out there n= eeds to be adjusted.
(I think it would need a special --with-= widl-includedir=3DDIR, given how msys2 remaps directory)


---
=C2=A0 qga/vss-win32/meson.build | 11 +++++++++--
=C2=A0 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/qga/vss-win32/meson.build b/qga/vss-win32/meson.build
index 71c50d0866..51539a582c 100644
--- a/qga/vss-win32/meson.build
+++ b/qga/vss-win32/meson.build
@@ -30,9 +30,16 @@ if midl.found()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 input: 'qga-vss.idl',
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 output: 'qga-vss.tlb',
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 command: [midl, '@INPUT@', '/tlb',= '@OUTPUT@'])
-else
+elif widl.found()
+=C2=A0 widl_cmd =3D [widl, '-t', '@INPUT@', '-o', = '@OUTPUT@']
+=C2=A0 usr_include =3D fs.parent(fs.parent(widl.full_path()))/'include= '
+=C2=A0 if fs.is_dir(usr_include)
+=C2=A0 =C2=A0 widl_cmd +=3D ['-L', usr_include]
+=C2=A0 =C2=A0 widl_cmd +=3D ['-I', usr_include]
+=C2=A0 endif
=C2=A0 =C2=A0 gen_tlb =3D custom_target('gen-tlb',
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 input: 'qga-vss.idl',
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 output: 'qga-vss.tlb',
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 command: [widl, '-t', '@INPUT@', '-o&= #39;,
'@OUTPUT@'])
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 build_by_default: true,

I would make qga_vss depend on gen_tlb instead (so the tlb is always bui= lt with the dll)

thanks

-- =
Marc-Andr=C3=A9 Lureau
--000000000000e89bed05dd1423bc--