All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konstantin Kostiuk <kkostiuk@redhat.com>
To: "Helge Konetzka" <hk@zapateado.de>,
	"Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: Michael Roth <michael.roth@amd.com>, QEMU <qemu-devel@nongnu.org>
Subject: Re: [PATCH] qga/vss-win32: enable qga-vss.tlb generation with widl
Date: Wed, 20 Apr 2022 14:17:24 +0300	[thread overview]
Message-ID: <CAPMcbCqP8zkpHX9Zg8Y4v1AdOSGb5seiuCYqt5S4HhZpe8SE8Q@mail.gmail.com> (raw)
In-Reply-To: <CAJ+F1CLuCGTequPCD8ZK08bu3zdo6rdN1UBNX7AXO-s16fVQog@mail.gmail.com>

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

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 = ../x86_64-w64-mingw32/include` but should be
`BIN_TO_INCLUDEDIR = ../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é. 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é, what do you think?

Best Regards,
Konstantin Kostiuk.


On Mon, Apr 18, 2022 at 11:15 AM Marc-André Lureau <
marcandre.lureau@gmail.com> wrote:

> Hi Helge
>
> On Sun, Apr 17, 2022 at 6:51 PM Helge Konetzka <hk@zapateado.de> 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 <hk@zapateado.de>
>> ---
>>
>> For tested Msys2 build all referenced resources reside in /<usr>/include.
>> 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 /<usr>
>> 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 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=DIR, 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 = [widl, '-t', '@INPUT@', '-o', '@OUTPUT@']
>> +  usr_include = fs.parent(fs.parent(widl.full_path()))/'include'
>> +  if fs.is_dir(usr_include)
>> +    widl_cmd += ['-L', usr_include]
>> +    widl_cmd += ['-I', usr_include]
>> +  endif
>>     gen_tlb = 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 built
> with the dll)
>
> thanks
>
> --
> Marc-André Lureau
>

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

  reply	other threads:[~2022-04-20 11:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-17 14:50 [PATCH] qga/vss-win32: enable qga-vss.tlb generation with widl Helge Konetzka
2022-04-17 15:40 ` Konstantin Kostiuk
2022-04-17 16:34   ` Helge Konetzka
2022-04-18  8:15 ` Marc-André Lureau
2022-04-20 11:17   ` Konstantin Kostiuk [this message]
2022-04-20 12:27     ` Marc-André Lureau
2022-04-22 17:12       ` Helge Konetzka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPMcbCqP8zkpHX9Zg8Y4v1AdOSGb5seiuCYqt5S4HhZpe8SE8Q@mail.gmail.com \
    --to=kkostiuk@redhat.com \
    --cc=hk@zapateado.de \
    --cc=marcandre.lureau@gmail.com \
    --cc=michael.roth@amd.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.