All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Winarske <joel.winarske@gmail.com>
To: Alexander Kanavin <alex.kanavin@gmail.com>,
	OE-core <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [RFC] meson needs a pkg-config wrapper script
Date: Wed, 1 Dec 2021 15:56:59 -0800	[thread overview]
Message-ID: <CABKMkP+t=Cgj9GJ1BcaDWc3Cu9xz+Yq2hYrGahdLxpPa3OnV1w@mail.gmail.com> (raw)
In-Reply-To: <16BCC5463709ABBF.10763@lists.openembedded.org>

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

Actually the recipe pkgconfig_git.bb points to the freedesktop pkg-config
repo, which is used by default.

On Wed, Dec 1, 2021 at 3:27 PM Joel Winarske via lists.openembedded.org
<joel.winarske=gmail.com@lists.openembedded.org> wrote:

> Forgot the reply all, not intentional :)
>
> Looks like the build is using the pkgconfig flavor:
> meta/recipes-devtools/pkgconfig/pkgconfig_git.bb
>
> Perhaps I just need a PREFERRED_PROVIDER_pkgconfig ?= "pkg-config" and
> pkg-config recipe, then perhaps it will just work.
>
> On Wed, Dec 1, 2021 at 2:39 PM Alexander Kanavin <alex.kanavin@gmail.com>
> wrote:
>
>> Please keep the conversation on the list.
>>
>> Those are two different, independently developed projects:
>> https://gitlab.freedesktop.org/pkg-config/pkg-config
>> https://github.com/pkgconf/pkgconf
>> and they are not fully compatible as you have just shown.
>>
>> I'm not sure how pkgconf is able to decide that includedir is a path
>> (short of hardcoding that inside the source somewhere), but such logic
>> needs to be carefully investigated before we make use of it, e.g. by
>> switching to pkgconf in oe-core.
>>
>> Alex
>>
>> On Wed, 1 Dec 2021 at 23:31, Joel Winarske <joel.winarske@gmail.com>
>> wrote:
>>
>>> pkg-config --version ?
>>>
>>> Using 0.29.2 I get the same output as you:
>>> $ PKG_CONFIG_SYSROOT_DIR=$STAGING_DIR_TARGET
>>> /home/linuxbrew/.linuxbrew/bin/pkg-config --define-variable=prefix=/opt
>>> --variable=includedir glesv2
>>> /usr/include
>>>
>>> Using 1.7.3 it works:
>>>
>>> STAGING_DIR_TARGET=/b/github-ci/_work/meta-flutter/rpi4-drm-honister-latest/raspberrypi4-64/tmp/work/cortexa72-poky-linux/vkmark/git-r0/recipe-sysroot
>>> PKG_CONFIG_SYSROOT_DIR=$STAGING_DIR_TARGET /usr/bin/pkg-config
>>> --variable=includedir glesv2
>>>
>>> /b/github-ci/_work/meta-flutter/rpi4-drm-honister-latest/raspberrypi4-64/tmp/work/cortexa72-poky-linux/vkmark/git-r0/recipe-sysroot/usr/include
>>>
>>> $ /usr/bin/pkg-config --version
>>> 1.7.3
>>>
>>> $ /home/linuxbrew/.linuxbrew/bin/pkg-config --version
>>> 0.29.2
>>>
>>> On Wed, Dec 1, 2021 at 12:36 AM Alexander Kanavin <
>>> alex.kanavin@gmail.com> wrote:
>>>
>>>> No, it's not that. Even if you pass PKG_CONFIG_SYSROOT_DIR to
>>>> pkg-config directly, it will apply that only to --cflags and similar, but
>>>> not to generic --variable. Try this:
>>>>
>>>> alex@alex-lx-laptop:~$ PKG_CONFIG_SYSROOT_DIR=/aaaa pkg-config libdrm
>>>> --cflags
>>>> -I/aaaa/usr/include/libdrm
>>>> alex@alex-lx-laptop:~$ PKG_CONFIG_SYSROOT_DIR=/aaaa pkg-config libdrm
>>>> --variable=includedir
>>>> /usr/include
>>>>
>>>> So a wrapper will not solve the 'includedir prefix' problem, and
>>>> neither the wrapper, nor pkg-config or meson can possibly know which
>>>> variable is a path, and which isn't - the only place where that is known is
>>>> the component that obtains the variable. And so that's where it has to be
>>>> prefixed.
>>>>
>>>> Alex
>>>>
>>>> On Tue, 30 Nov 2021 at 23:38, Joel Winarske <joel.winarske@gmail.com>
>>>> wrote:
>>>>
>>>>> Based on my testing, if PKG_CONFIG_SYSROOT_DIR is set or not makes
>>>>> zero difference on the outcome.  I suspect this is related to how
>>>>> pkg-config is launched by meson.
>>>>>
>>>>> Looking at the meson source tree, in all ci/test cross compile
>>>>> scenarios they reference a pkg-config wrapper.  No cross compile scenario I
>>>>> see referencing the 'pkgconfig' key uses a bare pkg-config.
>>>>>
>>>>>     cross/armclang-linux.txt:#pkgconfig =
>>>>> '/usr/bin/arm-linux-gnueabihf-pkg-config'
>>>>>     cross/linux-mingw-w64-32bit.txt:pkgconfig =
>>>>> '/usr/bin/i686-w64-mingw32-pkg-config'
>>>>>     cross/linux-mingw-w64-64bit.txt:pkgconfig =
>>>>> '/usr/bin/x86_64-w64-mingw32-pkg-config'
>>>>>     cross/ubuntu-armhf.txt:pkgconfig =
>>>>> '/usr/bin/arm-linux-gnueabihf-pkg-config'
>>>>>     test cases/unit/33 cross file overrides always
>>>>> args/ubuntu-armhf-overrides.txt:pkgconfig =
>>>>> '/usr/bin/arm-linux-gnueabihf-pkg-config'
>>>>>     test cases/unit/36 exe_wrapper
>>>>> behaviour/broken-cross.txt:pkgconfig =
>>>>> '/usr/bin/x86_64-w64-mingw32-pkg-config'
>>>>>
>>>>> I think adding a wrapper makes sense.
>>>>>
>>>>> 5.2 Tool Calling Conventions -
>>>>> https://autotools.io/pkgconfig/cross-compiling.html
>>>>>
>>>>> On Tue, Nov 30, 2021 at 12:13 PM Alexander Kanavin <
>>>>> alex.kanavin@gmail.com> wrote:
>>>>>
>>>>>> On Tue, 30 Nov 2021 at 21:00, Joel Winarske <joel.winarske@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Yes, if the sys_root key value in meson.cross is present
>>>>>>> PKG_CONFIG_SYSROOT_DIR gets set.  Honister patch I confirmed with:
>>>>>>>
>>>>>>> https://github.com/jwinarske/manifests/blob/honister/rpi64/0001-Add-sys_root-to-properties-section.patch
>>>>>>>
>>>>>>> The issue is that meson doesn't pass PKG_CONFIG_SYSROOT_DIR to the
>>>>>>> shell environment that runs pkg-config, as with the pkg-config sandbox test
>>>>>>> it does work.
>>>>>>>
>>>>>>
>>>>>> Both meson source code and its documentation indicate otherwise - if
>>>>>> you set sys_root property, it will get passed to pkg-config via environment
>>>>>> as PKG_CONFIG_SYSROOT_DIR:
>>>>>>
>>>>>> https://github.com/mesonbuild/meson/blob/master/mesonbuild/dependencies/pkgconfig.py#L121
>>>>>>
>>>>>> Alex
>>>>>>
>>>>>>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#159068):
> https://lists.openembedded.org/g/openembedded-core/message/159068
> Mute This Topic: https://lists.openembedded.org/mt/87407703/2167248
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> joel.winarske@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

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

  parent reply	other threads:[~2021-12-01 23:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30 17:20 [RFC] meson needs a pkg-config wrapper script Joel Winarske
2021-11-30 17:49 ` [OE-core] " Alexander Kanavin
2021-11-30 18:25   ` Joel Winarske
2021-11-30 18:53     ` Alexander Kanavin
2021-11-30 19:15       ` Joel Winarske
2021-11-30 19:39         ` Alexander Kanavin
2021-11-30 20:00           ` Joel Winarske
2021-11-30 20:03             ` Joel Winarske
2021-11-30 20:13             ` Alexander Kanavin
2021-11-30 22:37               ` Joel Winarske
2021-12-01  8:36                 ` Alexander Kanavin
2021-12-01  9:11                   ` Eero Aaltonen
     [not found]                   ` <CABKMkPJ+6xA9BtZsv-tcKKssJdhfjA4w7eSxJzNyBOg4Ak2=gw@mail.gmail.com>
2021-12-01 22:38                     ` Alexander Kanavin
2021-12-01 23:27                       ` Joel Winarske
     [not found]                       ` <16BCC5463709ABBF.10763@lists.openembedded.org>
2021-12-01 23:56                         ` Joel Winarske [this message]
2021-11-30 21:18 ` Ross Burton

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='CABKMkP+t=Cgj9GJ1BcaDWc3Cu9xz+Yq2hYrGahdLxpPa3OnV1w@mail.gmail.com' \
    --to=joel.winarske@gmail.com \
    --cc=alex.kanavin@gmail.com \
    --cc=openembedded-core@lists.openembedded.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.