All of lore.kernel.org
 help / color / mirror / Atom feed
* vulkan-loader
@ 2021-11-29 23:51 Joel Winarske
  2021-11-30  6:57 ` vulkan-loader Alexander Kanavin
  0 siblings, 1 reply; 4+ messages in thread
From: Joel Winarske @ 2021-11-29 23:51 UTC (permalink / raw)
  To: Alexander Kanavin, Openembedded-core

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

I discovered an upstream problem with vulkan-loader today.

Effectively since 1.2.162 vulkan.pc is broken for cross compilation
scenarios.

This example illustrates current problem with vulkan.pc installed by
vulkan-loader:

$ pkg-config --print-errors --define-variable=prefix=/opt
--variable=includedir vulkan
/usr/include

It should return /opt/usr/include
So doing this in a meson project does not produce the expected result:

vulkan_hpp = join_paths([
    vulkan_dep.get_pkgconfig_variable('includedir', define_variable:
['prefix', get_option('prefix')])
    'vulkan',
    'vulkan.hpp'
    ])


What is the suggested approach to address this?  A patch for each branch up
to master?

Joel

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

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

* Re: vulkan-loader
  2021-11-29 23:51 vulkan-loader Joel Winarske
@ 2021-11-30  6:57 ` Alexander Kanavin
  2021-11-30 14:10   ` vulkan-loader Joel Winarske
  2021-11-30 16:31   ` vulkan-loader Joel Winarske
  0 siblings, 2 replies; 4+ messages in thread
From: Alexander Kanavin @ 2021-11-30  6:57 UTC (permalink / raw)
  To: Joel Winarske; +Cc: OE-core

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

Can you show what vulkan.pc contains please, and why is that a problem?

Alex

On Tue, 30 Nov 2021 at 00:51, Joel Winarske <joel.winarske@gmail.com> wrote:

> I discovered an upstream problem with vulkan-loader today.
>
> Effectively since 1.2.162 vulkan.pc is broken for cross compilation
> scenarios.
>
> This example illustrates current problem with vulkan.pc installed by
> vulkan-loader:
>
> $ pkg-config --print-errors --define-variable=prefix=/opt --variable=includedir vulkan
> /usr/include
>
> It should return /opt/usr/include
> So doing this in a meson project does not produce the expected result:
>
> vulkan_hpp = join_paths([
>     vulkan_dep.get_pkgconfig_variable('includedir', define_variable: ['prefix', get_option('prefix')])
>     'vulkan',
>     'vulkan.hpp'
>     ])
>
>
> What is the suggested approach to address this?  A patch for each branch
> up to master?
>
> Joel
>
>

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

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

* Re: vulkan-loader
  2021-11-30  6:57 ` vulkan-loader Alexander Kanavin
@ 2021-11-30 14:10   ` Joel Winarske
  2021-11-30 16:31   ` vulkan-loader Joel Winarske
  1 sibling, 0 replies; 4+ messages in thread
From: Joel Winarske @ 2021-11-30 14:10 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: OE-core

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

https://github.com/KhronosGroup/Vulkan-Loader/commit/3c1ad4b0d54875ff0899b77a92aeda53ca236f27

Before:
$ pkg-config --print-errors --define-variable=prefix=/opt
--variable=includedir vulkan
/usr/include

After:
$ pkg-config --print-errors --define-variable=prefix=/opt
--variable=includedir vulkan
/opt/usr/include

This is important as meson does not expose
PKG_CONFIG_SYSROOT_DIR to pkg-config.

With change this meson snippet now finds absolute path correctly:

vulkan_dep = dependency('vulkan')
vulkan_hpp = join_paths([
    vulkan_dep.get_pkgconfig_variable('includedir', define_variable:
['prefix', get_option('prefix')]),
    'vulkan',
    'vulkan.hpp'
    ])

Another work around for meson's current limitation would be to implement a
pkg-config wrapper that exposes PKG_CONFIG variables, and point to it in
meson.bbclass/meson.cross.

Regardless the bad vulkan.pc is now fixed.


Joel


On Mon, Nov 29, 2021, 10:58 PM Alexander Kanavin <alex.kanavin@gmail.com>
wrote:

> Can you show what vulkan.pc contains please, and why is that a problem?
>
> Alex
>
> On Tue, 30 Nov 2021 at 00:51, Joel Winarske <joel.winarske@gmail.com>
> wrote:
>
>> I discovered an upstream problem with vulkan-loader today.
>>
>> Effectively since 1.2.162 vulkan.pc is broken for cross compilation
>> scenarios.
>>
>> This example illustrates current problem with vulkan.pc installed by
>> vulkan-loader:
>>
>> $ pkg-config --print-errors --define-variable=prefix=/opt --variable=includedir vulkan
>> /usr/include
>>
>> It should return /opt/usr/include
>> So doing this in a meson project does not produce the expected result:
>>
>> vulkan_hpp = join_paths([
>>     vulkan_dep.get_pkgconfig_variable('includedir', define_variable: ['prefix', get_option('prefix')])
>>     'vulkan',
>>     'vulkan.hpp'
>>     ])
>>
>>
>> What is the suggested approach to address this?  A patch for each branch
>> up to master?
>>
>> Joel
>>
>>

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

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

* Re: vulkan-loader
  2021-11-30  6:57 ` vulkan-loader Alexander Kanavin
  2021-11-30 14:10   ` vulkan-loader Joel Winarske
@ 2021-11-30 16:31   ` Joel Winarske
  1 sibling, 0 replies; 4+ messages in thread
From: Joel Winarske @ 2021-11-30 16:31 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: OE-core

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

[Readable version]

https://github.com/KhronosGroup/Vulkan-Loader/commit/3c1ad4b0d54875ff0899b77a92aeda53ca236f27

Before:
$ pkg-config --print-errors --define-variable=prefix=/opt
--variable=includedir vulkan
/usr/include

After:
$ pkg-config --print-errors --define-variable=prefix=/opt
--variable=includedir vulkan
/opt/usr/include

This is important as meson does not expose
PKG_CONFIG_SYSROOT_DIR to pkg-config.

With change this meson snippet now finds absolute path correctly:

vulkan_dep = dependency('vulkan')
vulkan_hpp = join_paths([
    vulkan_dep.get_pkgconfig_variable('includedir', define_variable:
['prefix', get_option('prefix')]),
    'vulkan',
    'vulkan.hpp'
    ])

Another work around for meson's current limitation would be to implement a
pkg-config wrapper that exposes PKG_CONFIG variables, and point to it in
meson.bbclass/meson.cross.

Regardless, the bad vulkan.pc is now fixed.


Joel

On Mon, Nov 29, 2021 at 10:58 PM Alexander Kanavin <alex.kanavin@gmail.com>
wrote:

> Can you show what vulkan.pc contains please, and why is that a problem?
>
> Alex
>
> On Tue, 30 Nov 2021 at 00:51, Joel Winarske <joel.winarske@gmail.com>
> wrote:
>
>> I discovered an upstream problem with vulkan-loader today.
>>
>> Effectively since 1.2.162 vulkan.pc is broken for cross compilation
>> scenarios.
>>
>> This example illustrates current problem with vulkan.pc installed by
>> vulkan-loader:
>>
>> $ pkg-config --print-errors --define-variable=prefix=/opt --variable=includedir vulkan
>> /usr/include
>>
>> It should return /opt/usr/include
>> So doing this in a meson project does not produce the expected result:
>>
>> vulkan_hpp = join_paths([
>>     vulkan_dep.get_pkgconfig_variable('includedir', define_variable: ['prefix', get_option('prefix')])
>>     'vulkan',
>>     'vulkan.hpp'
>>     ])
>>
>>
>> What is the suggested approach to address this?  A patch for each branch
>> up to master?
>>
>> Joel
>>
>>

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

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

end of thread, other threads:[~2021-11-30 16:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-29 23:51 vulkan-loader Joel Winarske
2021-11-30  6:57 ` vulkan-loader Alexander Kanavin
2021-11-30 14:10   ` vulkan-loader Joel Winarske
2021-11-30 16:31   ` vulkan-loader Joel Winarske

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.