[PULL 00/13] Testing, build system and misc patches

Thomas Huth posted 13 patches 2 years, 7 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
.gitlab-ci.d/buildtest.yml         | 100 ++++--------------------------
.gitlab-ci.d/custom-runners.yml    |  12 ++--
configure                          |  14 -----
contrib/vhost-user-gpu/meson.build |   5 +-
docs/about/deprecated.rst          |  20 ++++++
docs/devel/ci-definitions.rst      | 121 +++++++++++++++++++++++++++++++++++++
docs/devel/ci-jobs.rst             |  11 ++++
docs/devel/ci.rst                  |   1 +
meson.build                        |  17 ++++--
qemu-options.hx                    |  18 ++++--
scripts/show-fixed-bugs.sh         |  91 ----------------------------
softmmu/vl.c                       |  24 +++++++-
tests/qtest/libqtest.c             |   4 +-
13 files changed, 222 insertions(+), 216 deletions(-)
create mode 100644 docs/devel/ci-definitions.rst
delete mode 100755 scripts/show-fixed-bugs.sh
[PULL 00/13] Testing, build system and misc patches
Posted by Thomas Huth 2 years, 7 months ago
 Hi Peter,

the following changes since commit 59a89510b62ec23dbeab8b02fa4e3526e353d8b6:

  Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2021-09-01-1' into staging (2021-09-02 08:51:31 +0100)

are available in the Git repository at:

  https://gitlab.com/thuth/qemu.git tags/pull-request-2021-09-02

for you to fetch changes up to c72dc94b74fb1686decc0ca4c2b05e5bf2e5b74b:

  softmmu/vl: Deprecate the -sdl and -curses option (2021-09-02 14:43:58 +0200)

----------------------------------------------------------------
* Add definitions of terms for CI/testing
* Fix g_setenv problem discovered by Coverity
* Gitlab CI improvements
* Build system improvements (configure script + meson.build)
* Removal of the show-fixed-bugs.sh script
* Clean up of the sdl and curses options

----------------------------------------------------------------
Peter Maydell (1):
      libqtest: check for g_setenv() failure

Thomas Huth (11):
      gitlab-ci: Merge "build-disabled" with "build-without-default-features"
      gitlab-ci: Remove superfluous "dnf install" statement
      gitlab-ci: Fix ..._RUNNER_AVAILABLE variables and document them
      gitlab-ci: Don't try to use the system libfdt in the debian job
      meson.build: Fix the check for a usable libfdt
      meson.build: Don't use internal libfdt if the user requested the system libfdt
      configure / meson: Move the GBM handling to meson.build
      scripts: Remove the "show-fixed-bugs.sh" file
      softmmu/vl: Add a "grab-mod" parameter to the -display sdl option
      softmmu/vl: Deprecate the old grab options
      softmmu/vl: Deprecate the -sdl and -curses option

Willian Rampazzo (1):
      docs: add definitions of terms for CI/testing

 .gitlab-ci.d/buildtest.yml         | 100 ++++--------------------------
 .gitlab-ci.d/custom-runners.yml    |  12 ++--
 configure                          |  14 -----
 contrib/vhost-user-gpu/meson.build |   5 +-
 docs/about/deprecated.rst          |  20 ++++++
 docs/devel/ci-definitions.rst      | 121 +++++++++++++++++++++++++++++++++++++
 docs/devel/ci-jobs.rst             |  11 ++++
 docs/devel/ci.rst                  |   1 +
 meson.build                        |  17 ++++--
 qemu-options.hx                    |  18 ++++--
 scripts/show-fixed-bugs.sh         |  91 ----------------------------
 softmmu/vl.c                       |  24 +++++++-
 tests/qtest/libqtest.c             |   4 +-
 13 files changed, 222 insertions(+), 216 deletions(-)
 create mode 100644 docs/devel/ci-definitions.rst
 delete mode 100755 scripts/show-fixed-bugs.sh


Re: [PULL 00/13] Testing, build system and misc patches
Posted by Peter Maydell 2 years, 7 months ago
On Thu, 2 Sept 2021 at 13:49, Thomas Huth <thuth@redhat.com> wrote:
>
>  Hi Peter,
>
> the following changes since commit 59a89510b62ec23dbeab8b02fa4e3526e353d8b6:
>
>   Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2021-09-01-1' into staging (2021-09-02 08:51:31 +0100)
>
> are available in the Git repository at:
>
>   https://gitlab.com/thuth/qemu.git tags/pull-request-2021-09-02
>
> for you to fetch changes up to c72dc94b74fb1686decc0ca4c2b05e5bf2e5b74b:
>
>   softmmu/vl: Deprecate the -sdl and -curses option (2021-09-02 14:43:58 +0200)
>
> ----------------------------------------------------------------
> * Add definitions of terms for CI/testing
> * Fix g_setenv problem discovered by Coverity
> * Gitlab CI improvements
> * Build system improvements (configure script + meson.build)
> * Removal of the show-fixed-bugs.sh script
> * Clean up of the sdl and curses options
>

This provokes a new warning from meson on a linux-static build:

Run-time dependency appleframeworks found: NO (tried framework)
Library rt found: YES
Found pkg-config: /usr/bin/pkg-config (0.29.1)
WARNING: Static library 'gbm' not found for dependency 'gbm', may not
be statically linked
Run-time dependency gbm found: YES 20.0.8
Dependency libpng found: YES 1.6.34 (cached)
Dependency libjpeg found: YES unknown (cached)

If we're building statically and we can't find a static
library then (a) we shouldn't print a WARNING and
(b) we shouldn't then conclude that we've found gdm.

thanks
-- PMM

Re: [PULL 00/13] Testing, build system and misc patches
Posted by Thomas Huth 2 years, 7 months ago
On 03/09/2021 15.22, Peter Maydell wrote:
> On Thu, 2 Sept 2021 at 13:49, Thomas Huth <thuth@redhat.com> wrote:
>>
>>   Hi Peter,
>>
>> the following changes since commit 59a89510b62ec23dbeab8b02fa4e3526e353d8b6:
>>
>>    Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2021-09-01-1' into staging (2021-09-02 08:51:31 +0100)
>>
>> are available in the Git repository at:
>>
>>    https://gitlab.com/thuth/qemu.git tags/pull-request-2021-09-02
>>
>> for you to fetch changes up to c72dc94b74fb1686decc0ca4c2b05e5bf2e5b74b:
>>
>>    softmmu/vl: Deprecate the -sdl and -curses option (2021-09-02 14:43:58 +0200)
>>
>> ----------------------------------------------------------------
>> * Add definitions of terms for CI/testing
>> * Fix g_setenv problem discovered by Coverity
>> * Gitlab CI improvements
>> * Build system improvements (configure script + meson.build)
>> * Removal of the show-fixed-bugs.sh script
>> * Clean up of the sdl and curses options
>>
> 
> This provokes a new warning from meson on a linux-static build:
> 
> Run-time dependency appleframeworks found: NO (tried framework)
> Library rt found: YES
> Found pkg-config: /usr/bin/pkg-config (0.29.1)
> WARNING: Static library 'gbm' not found for dependency 'gbm', may not
> be statically linked
> Run-time dependency gbm found: YES 20.0.8
> Dependency libpng found: YES 1.6.34 (cached)
> Dependency libjpeg found: YES unknown (cached)
> 
> If we're building statically and we can't find a static
> library then (a) we shouldn't print a WARNING and
> (b) we shouldn't then conclude that we've found gdm.

Hmmm, no clue what's wrong here, since I basically did declare it like all 
other libraries are declared, too (so this problem should have shown up 
somewhere else already?)... Paolo, do you have any ideas what's going on here?

  Thomas


Re: [PULL 00/13] Testing, build system and misc patches
Posted by Alex Bennée 2 years, 7 months ago
Thomas Huth <thuth@redhat.com> writes:

> On 03/09/2021 15.22, Peter Maydell wrote:
>> On Thu, 2 Sept 2021 at 13:49, Thomas Huth <thuth@redhat.com> wrote:
>>>
>>>   Hi Peter,
>>>
>>> the following changes since commit 59a89510b62ec23dbeab8b02fa4e3526e353d8b6:
>>>
>>>    Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2021-09-01-1' into staging (2021-09-02 08:51:31 +0100)
>>>
>>> are available in the Git repository at:
>>>
>>>    https://gitlab.com/thuth/qemu.git tags/pull-request-2021-09-02
>>>
>>> for you to fetch changes up to c72dc94b74fb1686decc0ca4c2b05e5bf2e5b74b:
>>>
>>>    softmmu/vl: Deprecate the -sdl and -curses option (2021-09-02 14:43:58 +0200)
>>>
>>> ----------------------------------------------------------------
>>> * Add definitions of terms for CI/testing
>>> * Fix g_setenv problem discovered by Coverity
>>> * Gitlab CI improvements
>>> * Build system improvements (configure script + meson.build)
>>> * Removal of the show-fixed-bugs.sh script
>>> * Clean up of the sdl and curses options
>>>
>> This provokes a new warning from meson on a linux-static build:
>> Run-time dependency appleframeworks found: NO (tried framework)
>> Library rt found: YES
>> Found pkg-config: /usr/bin/pkg-config (0.29.1)
>> WARNING: Static library 'gbm' not found for dependency 'gbm', may not
>> be statically linked
>> Run-time dependency gbm found: YES 20.0.8
>> Dependency libpng found: YES 1.6.34 (cached)
>> Dependency libjpeg found: YES unknown (cached)
>> If we're building statically and we can't find a static
>> library then (a) we shouldn't print a WARNING and
>> (b) we shouldn't then conclude that we've found gdm.
>
> Hmmm, no clue what's wrong here, since I basically did declare it like
> all other libraries are declared, too (so this problem should have
> shown up somewhere else already?)... Paolo, do you have any ideas
> what's going on here?

In attempting to replicate I found all the dynamic libs blow up:

  Run-time dependency pixman-1 found: YES 0.40.0
  Library aio found: Y
  Run-time dependency zlib found: YES 1.2.1
  Run-time dependency liburing found: NO (tried p
  Run-time dependency libxml-2.0 found: YES 2.9.1
  Run-time dependency libnfs found: YES 4.0.0
  Run-time dependency appleframeworks found: NO (tried f
  Run-time dependency libseccomp found: YES 2.5.1
  Has header "cap-ng.h" : Y
  Library cap-ng found: Y
  WARNING: Static library 'xkbcommon' not found for dependency 'xkbcommon', may not be statically l
  Run-time dependency xkbcommon found: YES 1.0.3
  Library rt found: Y
  Run-time dependency libiscsi found: YES 1.19.0
  Run-time dependency libzstd found: YES 1.4.8
  WARNING: Static library 'virglrenderer' not found for dependency 'virglrenderer', may not be statically l
  Run-time dependency virglrenderer found: YES 0.8.2
  WARNING: Static library 'nghttp2' not found for dependency 'libcurl', may not be statically l
  WARNING: Static library 'rtmp' not found for dependency 'libcurl', may not be statically l
  WARNING: Static library 'psl' not found for dependency 'libcurl', may not be statically l
  WARNING: Static library 'gssapi_krb5' not found for dependency 'libcurl', may not be statically l
  WARNING: Static library 'krb5' not found for dependency 'libcurl', may not be statically l
  WARNING: Static library 'k5crypto' not found for dependency 'libcurl', may not be statically l
  WARNING: Static library 'lber' not found for dependency 'libcurl', may not be statically l
  WARNING: Static library 'ldap' not found for dependency 'libcurl', may not be statically l
  Run-time dependency libcurl found: YES 7.74.0
  WARNING: Static library 'udev' not found for dependency 'libudev', may not be statically l
  Run-time dependency libudev found: YES 2
  Library mpathpersist found: N
  Run-time dependency ncursesw found: YES 6.2.2
  Has header "brlapi.h" : Y
  Library brlapi found: Y
  ../../meson.build:680: WARNING: could not link brlapi, d
  sdl2-config found: N
  Run-time dependency sdl2 found: NO (tried pkgconfig and config-t
  Library rados found: N
  Has header "rbd/librbd.h" : Y
  Library rbd found: N
  WARNING: Static library 'gfapi' not found for dependency 'glusterfs-api', may not be statically l
  WARNING: Static library 'glusterfs' not found for dependency 'glusterfs-api', may not be statically l
  WARNING: Static library 'gfrpc' not found for dependency 'glusterfs-api', may not be statically l
  WARNING: Static library 'gfxdr' not found for dependency 'glusterfs-api', may not be statically l
  Run-time dependency glusterfs-api found: YES 7.9.2
  Has header "bzlib.h" : Y
  Library bz2 found: YES
  Has header "lzfse.h" : NO                                                              

So is this a general problem with static libs. BTW I didn't catch this
because I only build user with --static as I thought system --static was
flakey anyway.

>
>  Thomas


-- 
Alex Bennée

Re: [PULL 00/13] Testing, build system and misc patches
Posted by Peter Maydell 2 years, 7 months ago
On Fri, 3 Sept 2021 at 17:37, Alex Bennée <alex.bennee@linaro.org> wrote:
> Thomas Huth <thuth@redhat.com> writes:
> > On 03/09/2021 15.22, Peter Maydell wrote:
> >> This provokes a new warning from meson on a linux-static build:
> >> Run-time dependency appleframeworks found: NO (tried framework)
> >> Library rt found: YES
> >> Found pkg-config: /usr/bin/pkg-config (0.29.1)
> >> WARNING: Static library 'gbm' not found for dependency 'gbm', may not
> >> be statically linked
> >> Run-time dependency gbm found: YES 20.0.8
> >> Dependency libpng found: YES 1.6.34 (cached)
> >> Dependency libjpeg found: YES unknown (cached)
> >> If we're building statically and we can't find a static
> >> library then (a) we shouldn't print a WARNING and
> >> (b) we shouldn't then conclude that we've found gdm.
> >
> > Hmmm, no clue what's wrong here, since I basically did declare it like
> > all other libraries are declared, too (so this problem should have
> > shown up somewhere else already?)... Paolo, do you have any ideas
> > what's going on here?
>
> In attempting to replicate I found all the dynamic libs blow up:

>   WARNING: Static library 'xkbcommon' not found for dependency 'xkbcommon', may not be statically l
>   Run-time dependency xkbcommon found: YES 1.0.3

I do vaguely recall complaining about new meson warnings for
static library detection in the past as well:
https://lore.kernel.org/qemu-devel/CAFEAcA8chPqS0keyGv0vBgNgacnMo95gA3LZDU2QfmteQ=4UZg@mail.gmail.com/
https://lore.kernel.org/qemu-devel/CAFEAcA_-cNmt-sY3nqnGkpUqET86M6-82rf-Uv3QkwCR14kYsw@mail.gmail.com/
https://lore.kernel.org/qemu-devel/CAFEAcA8xHxCGhh2hibsdCxZrYRRU+xcwVsa85O7KL9BsmW7ohw@mail.gmail.com/

> So is this a general problem with static libs. BTW I didn't catch this
> because I only build user with --static as I thought system --static was
> flakey anyway.

I'm not doing a system build in this case... Looking at some of
those older threads, it looks like part of the answer is that
for dependencies that we don't need for linux-user mode we should
guard the test with some suitable if condition so we don't create
the dependency unless we're going to use it, eg the brlapi check
uses "if not get_option('brlapi').auto() or have_system", rbd
has a similar thing involving have_block, etc.

But I think there is an underlying meson bug here which that kind of
use of an if is merely working around: if we ask for a static library
it should not give us a dynamic library.

-- PMM

Re: [PULL 00/13] Testing, build system and misc patches
Posted by Thomas Huth 2 years, 7 months ago
On 03/09/2021 18.49, Peter Maydell wrote:
> On Fri, 3 Sept 2021 at 17:37, Alex Bennée <alex.bennee@linaro.org> wrote:
>> Thomas Huth <thuth@redhat.com> writes:
>>> On 03/09/2021 15.22, Peter Maydell wrote:
>>>> This provokes a new warning from meson on a linux-static build:
>>>> Run-time dependency appleframeworks found: NO (tried framework)
>>>> Library rt found: YES
>>>> Found pkg-config: /usr/bin/pkg-config (0.29.1)
>>>> WARNING: Static library 'gbm' not found for dependency 'gbm', may not
>>>> be statically linked
>>>> Run-time dependency gbm found: YES 20.0.8
>>>> Dependency libpng found: YES 1.6.34 (cached)
>>>> Dependency libjpeg found: YES unknown (cached)
>>>> If we're building statically and we can't find a static
>>>> library then (a) we shouldn't print a WARNING and
>>>> (b) we shouldn't then conclude that we've found gdm.
>>>
>>> Hmmm, no clue what's wrong here, since I basically did declare it like
>>> all other libraries are declared, too (so this problem should have
>>> shown up somewhere else already?)... Paolo, do you have any ideas
>>> what's going on here?
>>
>> In attempting to replicate I found all the dynamic libs blow up:
> 
>>    WARNING: Static library 'xkbcommon' not found for dependency 'xkbcommon', may not be statically l
>>    Run-time dependency xkbcommon found: YES 1.0.3
> 
> I do vaguely recall complaining about new meson warnings for
> static library detection in the past as well:
> https://lore.kernel.org/qemu-devel/CAFEAcA8chPqS0keyGv0vBgNgacnMo95gA3LZDU2QfmteQ=4UZg@mail.gmail.com/
> https://lore.kernel.org/qemu-devel/CAFEAcA_-cNmt-sY3nqnGkpUqET86M6-82rf-Uv3QkwCR14kYsw@mail.gmail.com/
> https://lore.kernel.org/qemu-devel/CAFEAcA8xHxCGhh2hibsdCxZrYRRU+xcwVsa85O7KL9BsmW7ohw@mail.gmail.com/
> 
>> So is this a general problem with static libs. BTW I didn't catch this
>> because I only build user with --static as I thought system --static was
>> flakey anyway.
> 
> I'm not doing a system build in this case... Looking at some of
> those older threads, it looks like part of the answer is that
> for dependencies that we don't need for linux-user mode we should
> guard the test with some suitable if condition so we don't create
> the dependency unless we're going to use it, eg the brlapi check
> uses "if not get_option('brlapi').auto() or have_system", rbd
> has a similar thing involving have_block, etc.

Ok, thanks, that seems to work, I'll change the patch accordingly.

> But I think there is an underlying meson bug here which that kind of
> use of an if is merely working around: if we ask for a static library
> it should not give us a dynamic library.

Agreed. Actually, when I run configure with "--static --disable-system" on 
my laptop, I'm also getting some warnings:

WARNING: Static library 'z' not found for dependency 'zlib', may not be 
statically linked
Run-time dependency zlib found: YES 1.2.11
Run-time dependency appleframeworks found: NO (tried framework)
Library rt found: YES
WARNING: Static library 'png16' not found for dependency 'libpng', may not 
be statically linked
WARNING: Static library 'z' not found for dependency 'libpng', may not be 
statically linked

... and linking then later fails while running "make".

Paolo, could the behavior of meson be changed to fail already the 
configuration step in this case instead of only printing a warning?

  Thomas


Re: [PULL 00/13] Testing, build system and misc patches
Posted by Paolo Bonzini 2 years, 7 months ago
On 06/09/21 11:51, Thomas Huth wrote:
> On 03/09/2021 18.49, Peter Maydell wrote:
>> On Fri, 3 Sept 2021 at 17:37, Alex Bennée <alex.bennee@linaro.org> wrote:
>>> Thomas Huth <thuth@redhat.com> writes:
>>>> On 03/09/2021 15.22, Peter Maydell wrote:
>>>>> This provokes a new warning from meson on a linux-static build:
>>>>> Run-time dependency appleframeworks found: NO (tried framework)
>>>>> Library rt found: YES
>>>>> Found pkg-config: /usr/bin/pkg-config (0.29.1)
>>>>> WARNING: Static library 'gbm' not found for dependency 'gbm', may not
>>>>> be statically linked
>>>>> Run-time dependency gbm found: YES 20.0.8
>>>>> Dependency libpng found: YES 1.6.34 (cached)
>>>>> Dependency libjpeg found: YES unknown (cached)
>>>>> If we're building statically and we can't find a static
>>>>> library then (a) we shouldn't print a WARNING and
>>>>> (b) we shouldn't then conclude that we've found gdm.
>>>>
>>>> Hmmm, no clue what's wrong here, since I basically did declare it like
>>>> all other libraries are declared, too (so this problem should have
>>>> shown up somewhere else already?)... Paolo, do you have any ideas
>>>> what's going on here?
>>>
>>> In attempting to replicate I found all the dynamic libs blow up:
>>
>>>    WARNING: Static library 'xkbcommon' not found for dependency 
>>> 'xkbcommon', may not be statically l
>>>    Run-time dependency xkbcommon found: YES 1.0.3
>>
>> I do vaguely recall complaining about new meson warnings for
>> static library detection in the past as well:
>> https://lore.kernel.org/qemu-devel/CAFEAcA8chPqS0keyGv0vBgNgacnMo95gA3LZDU2QfmteQ=4UZg@mail.gmail.com/ 
>>
>> https://lore.kernel.org/qemu-devel/CAFEAcA_-cNmt-sY3nqnGkpUqET86M6-82rf-Uv3QkwCR14kYsw@mail.gmail.com/ 
>>
>> https://lore.kernel.org/qemu-devel/CAFEAcA8xHxCGhh2hibsdCxZrYRRU+xcwVsa85O7KL9BsmW7ohw@mail.gmail.com/ 
>>
>>
>>> So is this a general problem with static libs. BTW I didn't catch this
>>> because I only build user with --static as I thought system --static was
>>> flakey anyway.
>>
>> I'm not doing a system build in this case... Looking at some of
>> those older threads, it looks like part of the answer is that
>> for dependencies that we don't need for linux-user mode we should
>> guard the test with some suitable if condition so we don't create
>> the dependency unless we're going to use it, eg the brlapi check
>> uses "if not get_option('brlapi').auto() or have_system", rbd
>> has a similar thing involving have_block, etc.
> 
> Ok, thanks, that seems to work, I'll change the patch accordingly.
> 
>> But I think there is an underlying meson bug here which that kind of
>> use of an if is merely working around: if we ask for a static library
>> it should not give us a dynamic library.
> 
> Agreed. Actually, when I run configure with "--static --disable-system" 
> on my laptop, I'm also getting some warnings:
> 
> WARNING: Static library 'z' not found for dependency 'zlib', may not be 
> statically linked
> Run-time dependency zlib found: YES 1.2.11
> Run-time dependency appleframeworks found: NO (tried framework)
> Library rt found: YES
> WARNING: Static library 'png16' not found for dependency 'libpng', may 
> not be statically linked
> WARNING: Static library 'z' not found for dependency 'libpng', may not 
> be statically linked
> 
> ... and linking then later fails while running "make".
> 
> Paolo, could the behavior of meson be changed to fail already the 
> configuration step in this case instead of only printing a warning?

The reason why this is just a warning is explained only in the code, and
it's this:

     # Library wasn't found, maybe we're looking in the wrong
     # places or the library will be provided with LDFLAGS or
     # LIBRARY_PATH from the environment (on macOS), and many
     # other edge cases that we can't account for.
     #
     # Add all -L paths and use it as -lfoo

In other words, Meson doesn't really know the library will be used for a
statically-linked binary (as opposed to just not wanting a shared
library for whatever reason).  So it looks for a .a file, and forces use
of the a static library by passing a path to that file.  If it cannot
find one, it warns.

Note that pre-Meson we didn't warn for --disable-system (correct) but we
did the wrong thing silently for --enable-system (just like now, except
without a warning).  So Meson's warning forces us to be a bit more verbose
to do only strictly necesary tests, as in:

   pam = not_found
   if not get_option('auth_pam').auto() or have_system
     pam = cc.find_library('pam', has_headers: ['security/pam_appl.h'],
                           required: get_option('auth_pam'),
                           kwargs: static_kwargs)
   endif

but it also catches incorrect setups on the user side and makes the "configure"
step a little faster with --disable-system.

FWIW, in the latest Meson version there's a shortcut for the above pattern,
since it is very common in QEMU; it can be rewritten as follows to avoid the
if/endif:

   pam = cc.find_library('pam', has_headers: ['security/pam_appl.h'],
                         required: get_option('auth_pam').disable_auto_if(not have_system)
                         kwargs: static_kwargs)

Paolo


Re: [PULL 00/13] Testing, build system and misc patches
Posted by Peter Maydell 2 years, 7 months ago
On Mon, 6 Sept 2021 at 16:08, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 06/09/21 11:51, Thomas Huth wrote:
> > On 03/09/2021 18.49, Peter Maydell wrote:
> >> But I think there is an underlying meson bug here which that kind of
> >> use of an if is merely working around: if we ask for a static library
> >> it should not give us a dynamic library.
> >
> > Agreed. Actually, when I run configure with "--static --disable-system"
> > on my laptop, I'm also getting some warnings:
> >
> > WARNING: Static library 'z' not found for dependency 'zlib', may not be
> > statically linked
> > Run-time dependency zlib found: YES 1.2.11
> > Run-time dependency appleframeworks found: NO (tried framework)
> > Library rt found: YES
> > WARNING: Static library 'png16' not found for dependency 'libpng', may
> > not be statically linked
> > WARNING: Static library 'z' not found for dependency 'libpng', may not
> > be statically linked
> >
> > ... and linking then later fails while running "make".
> >
> > Paolo, could the behavior of meson be changed to fail already the
> > configuration step in this case instead of only printing a warning?
>
> The reason why this is just a warning is explained only in the code, and
> it's this:
>
>      # Library wasn't found, maybe we're looking in the wrong
>      # places or the library will be provided with LDFLAGS or
>      # LIBRARY_PATH from the environment (on macOS), and many
>      # other edge cases that we can't account for.
>      #
>      # Add all -L paths and use it as -lfoo
>
> In other words, Meson doesn't really know the library will be used for a
> statically-linked binary (as opposed to just not wanting a shared
> library for whatever reason).  So it looks for a .a file, and forces use
> of the a static library by passing a path to that file.  If it cannot
> find one, it warns.

Then Meson needs a feature so we can tell it "yes, we really did mean
that we want a static library, and only a static library will do".

thanks
-- PMM