Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The check argument of run_command should be True by default #9300

Closed
Volker-Weissmann opened this issue Sep 26, 2021 · 13 comments
Closed

The check argument of run_command should be True by default #9300

Volker-Weissmann opened this issue Sep 26, 2021 · 13 comments

Comments

@Volker-Weissmann
Copy link
Contributor

The run_command argument takes a check bool-argument. If check: true, is given and the command fails, meson will error out.

May I ask, who thought that it was a good idea to let check default to false? Ignoring errors by default goes against everything I learned.

So essentially, I want something like this, (plus documentation updates)

diff --git a/mesonbuild/interpreter/interpreterobjects.py b/mesonbuild/interpreter/interpreterobjects.py
index fca371cbc..3b3218c54 100644
--- a/mesonbuild/interpreter/interpreterobjects.py
+++ b/mesonbuild/interpreter/interpreterobjects.py
@@ -163,7 +163,7 @@ class RunProcess(MesonInterpreterObject):
                  subdir: str,
                  mesonintrospect: T.List[str],
                  in_builddir: bool = False,
-                 check: bool = False,
+                 check: bool = True,
                  capture: bool = True) -> None:
         super().__init__()
         if not isinstance(cmd, ExternalProgram):
@@ -184,7 +184,7 @@ class RunProcess(MesonInterpreterObject):
                     subdir: str,
                     mesonintrospect: T.List[str],
                     in_builddir: bool,
-                    check: bool = False) -> T.Tuple[int, str, str]:
+                    check: bool = True) -> T.Tuple[int, str, str]:
         command_array = cmd.get_command() + args
         menv = {'MESON_SOURCE_ROOT': source_dir,
                 'MESON_BUILD_ROOT': build_dir,
@xclaesse
Copy link
Member

xclaesse commented Sep 26, 2021

I think it's like that for historical reasons, changing this would not be backward compatible. But I agree it's not ideal, we should warn when check argument is not set for a few releases, then do the flip eventually.

@Volker-Weissmann
Copy link
Contributor Author

Volker-Weissmann commented Sep 26, 2021

I think it's like that for historical reasons, changing this would not be backward compatible.

I can understand that.

we should warn when check argument is not set

Should I write the PR?

@eli-schwartz
Copy link
Member

I agree that this change would be nice and yes, if you would write the PR that would be great. ;)

@eli-schwartz
Copy link
Member

Fixed via linked PR.

@xclaesse
Copy link
Member

xclaesse commented Nov 2, 2021

FWIW, I checked GStreamer and they have plenty of places where it assumes that check is false by default. I still agree the default should be true, but we'll probably need a long deprecation period because that seems a common thing.

@eli-schwartz
Copy link
Member

Sure, baby steps for now though. :D

@keszybz
Copy link
Contributor

keszybz commented Nov 17, 2021

Please, please, always include the source line in messages like this. In large projects, hunting for the right line to fix is a pita.

keszybz added a commit to keszybz/systemd that referenced this issue Nov 17, 2021
meson-0.59.4-1.fc35.noarch says:
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: mesonbuild/meson#9300
@eli-schwartz
Copy link
Member

You're entirely correct and I apologize for not thinking of this during the review process.

It should be easy to fix -- the mlog functions take an optional location= parameter. Would you like to submit a PR?

keszybz added a commit to keszybz/systemd that referenced this issue Nov 17, 2021
meson-0.59.4-1.fc35.noarch says:
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: mesonbuild/meson#9300
@Volker-Weissmann
Copy link
Contributor Author

Please, please, always include the source line in messages like this. In large projects, hunting for the right line to fix is a pita.

You're right, sorry I forget.

@Volker-Weissmann
Copy link
Contributor Author

You're entirely correct and I apologize for not thinking of this during the review process.

Yeah, it was a real slip up of you to accept this crap. /s

@eli-schwartz
Copy link
Member

It was a good PR :p it just could have used one specific touch-up.

@keszybz
Copy link
Contributor

keszybz commented Nov 17, 2021

OK, OK, I'm sorry that I mentioned it. The change is good.

@Volker-Weissmann
Copy link
Contributor Author

OK, OK, I'm sorry that I mentioned it. The change is good.

No, No, it's good that you mentioned it.

Good error messages are important.

keszybz added a commit to keszybz/systemd that referenced this issue Nov 17, 2021
meson-0.59.4-1.fc35.noarch says:
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: mesonbuild/meson#9300
keszybz added a commit to keszybz/systemd that referenced this issue Nov 18, 2021
meson-0.59.4-1.fc35.noarch says:
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: mesonbuild/meson#9300
keszybz added a commit to keszybz/systemd that referenced this issue Nov 18, 2021
meson-0.59.4-1.fc35.noarch says:
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: mesonbuild/meson#9300
keszybz added a commit to systemd/systemd that referenced this issue Nov 18, 2021
meson-0.59.4-1.fc35.noarch says:
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: mesonbuild/meson#9300
gnomesysadmins pushed a commit to GNOME/totem that referenced this issue Jan 6, 2022
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: mesonbuild/meson#9300
intel-media-ci pushed a commit to intel-media-ci/gstreamer that referenced this issue Jan 11, 2022
This is required since Meson 0.61.0, and causes a warning to be
emitted otherwise:

mesonbuild/meson@2c079d8
mesonbuild/meson#9300

This exposed a bunch of places where we had broken run_command()
calls, unnecessary run_command() calls, and places where check: true
should be used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1507>
ford-prefect pushed a commit to PipeWire/pipewire that referenced this issue Jan 17, 2022
The include tests are not critical, hence there is
no need to halt the build if, for some reason, `find` fails.

See mesonbuild/meson#9300
LaserEyess added a commit to LaserEyess/mpv that referenced this issue Jan 17, 2022
Warning from meson:

WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: mesonbuild/meson#9300

All of the run_command() calls currently use need to succeed for the
build to work properly.
hadess added a commit to hadess/umockdev that referenced this issue Jan 18, 2022
As per:
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: mesonbuild/meson#9300
martinpitt pushed a commit to martinpitt/umockdev that referenced this issue Jan 18, 2022
As per:
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: mesonbuild/meson#9300
diegogangl pushed a commit to getting-things-gnome/gtg that referenced this issue Mar 15, 2024
This explicitly checks the command before assigning to the
`version` variable.

This also addresses the following warning during building:

```
WARNING: You should add the boolean check kwarg to the run_command call.
It currently defaults to false,
but it will default to true in future releases of meson.
See also: mesonbuild/meson#9300
```
emersion added a commit to emersion/wayvnc that referenced this issue Apr 19, 2024
Fixes the following warning:

    WARNING: You should add the boolean check kwarg to the run_command call.
             It currently defaults to false,
             but it will default to true in future releases of meson.
             See also: mesonbuild/meson#9300
emersion added a commit to emersion/wayvnc that referenced this issue Apr 19, 2024
Fixes the following warning:

    WARNING: You should add the boolean check kwarg to the run_command call.
             It currently defaults to false,
             but it will default to true in future releases of meson.
             See also: mesonbuild/meson#9300
any1 pushed a commit to any1/wayvnc that referenced this issue Apr 19, 2024
Fixes the following warning:

    WARNING: You should add the boolean check kwarg to the run_command call.
             It currently defaults to false,
             but it will default to true in future releases of meson.
             See also: mesonbuild/meson#9300
havardgraff pushed a commit to pexip/libffi that referenced this issue Jun 4, 2024
```
Program test-cc-supports-hidden-visibility.py found: YES (/usr/bin/python3 /path/to/libffi/test-cc-supports-hidden-visibility.py)
WARNING: You should add the boolean check kwarg to the run_command call.
It currently defaults to false,
but it will default to true in future releases of meson.
See also: mesonbuild/meson#9300
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/meson-ports/libffi/-/merge_requests/16>
pevik added a commit to pevik/iputils that referenced this issue Jul 9, 2024
This fixes warnings:

Program xsltproc found: YES (/usr/bin/xsltproc)
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: mesonbuild/meson#9300

Signed-off-by: Petr Vorel <pvorel@suse.cz>
pevik added a commit to pevik/iputils that referenced this issue Jul 9, 2024
This fixes warnings:

Program xsltproc found: YES (/usr/bin/xsltproc)
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: mesonbuild/meson#9300

Signed-off-by: Petr Vorel <pvorel@suse.cz>
pevik added a commit to pevik/iputils that referenced this issue Jul 9, 2024
This fixes warnings:

Program xsltproc found: YES (/usr/bin/xsltproc)
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: mesonbuild/meson#9300

Signed-off-by: Petr Vorel <pvorel@suse.cz>
geissonator pushed a commit to openbmc/obmc-console that referenced this issue Jul 10, 2024
The `run_command()` invocations in the iniparser meson.build lacked the
`check` parameter:

```
iniparser| WARNING: You should add the boolean check kwarg to the run_command call.
iniparser| It currently defaults to false,
iniparser| but it will default to true in future releases of meson.
iniparser| See also: mesonbuild/meson#9300
```

Add `check` and set it to true to make sure the build configuration only
succeeds if these commands also succeed.

Fixes: 1e04f44 ("use iniparser dependency for config file parsing")
Change-Id: I97841398fc899e876b97e4e28e18cd8dd3b13222
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
aperezdc added a commit to Igalia/WPEBackend-fdo that referenced this issue Sep 12, 2024
Set the "check" parameter in run_command() calls, instead of relying on
the default value, which might get changed at some point in the fuiture.

This silences the folloeing Meson warning:

  WARNING: You should add the boolean check kwarg to the run_command call.
           It currently defaults to false,
           but it will default to true in future releases of meson.
           See also: mesonbuild/meson#9300
aperezdc added a commit to Igalia/WPEBackend-fdo that referenced this issue Sep 12, 2024
Set the "check" parameter in run_command() calls, instead of relying on
the default value, which might get changed at some point in the fuiture.

This silences the following Meson warning:

  WARNING: You should add the boolean check kwarg to the run_command call.
           It currently defaults to false,
           but it will default to true in future releases of meson.
           See also: mesonbuild/meson#9300
aperezdc added a commit to Igalia/WPEBackend-fdo that referenced this issue Sep 12, 2024
Set the "check" parameter in run_command() calls, instead of relying on
the default value, which might get changed at some point in the future.

This silences the following Meson warning:

  WARNING: You should add the boolean check kwarg to the run_command call.
           It currently defaults to false,
           but it will default to true in future releases of meson.
           See also: mesonbuild/meson#9300
aperezdc added a commit to Igalia/WPEBackend-fdo that referenced this issue Sep 12, 2024
Set the "check" parameter in run_command() calls, instead of relying on
the default value, which might get changed at some point in the future.

This silences the following Meson warning:

  WARNING: You should add the boolean check kwarg to the run_command call.
           It currently defaults to false,
           but it will default to true in future releases of meson.
           See also: mesonbuild/meson#9300
aperezdc added a commit to Igalia/WPEBackend-fdo that referenced this issue Sep 13, 2024
Set the "check" parameter in run_command() calls, instead of relying on
the default value, which might get changed at some point in the future.

This silences the following Meson warning:

  WARNING: You should add the boolean check kwarg to the run_command call.
           It currently defaults to false,
           but it will default to true in future releases of meson.
           See also: mesonbuild/meson#9300

(cherry picked from commit f486b18)
christophecvr added a commit to christophecvr/meson that referenced this issue Sep 23, 2024
cgzones added a commit to cgzones/systemd-netlogd that referenced this issue Oct 3, 2024
meson complains:

    WARNING: You should add the boolean check kwarg to the run_command call.
             It currently defaults to false,
             but it will default to true in future releases of meson.
             See also: mesonbuild/meson#9300
cgzones added a commit to cgzones/systemd-netlogd that referenced this issue Oct 3, 2024
meson complains:

    WARNING: You should add the boolean check kwarg to the run_command call.
             It currently defaults to false,
             but it will default to true in future releases of meson.
             See also: mesonbuild/meson#9300
orlitzky added a commit to tobiasdiez/sage that referenced this issue Oct 14, 2024
Meson warns about this when the "check" keyword is absent,

  WARNING: You should add the boolean check kwarg to the run_command call.
           It currently defaults to false,
           but it will default to true in future releases of meson.
           See also: mesonbuild/meson#9300

and the command should indeed succeed, so we now pass "check: true" to
run_command().
sailfish009 pushed a commit to sailfish009/goodvibes that referenced this issue Oct 20, 2024
To make meson happy and get rid of:

  WARNING:
    You should add the boolean check kwarg to the run_command call.
    It currently defaults to false,
    but it will default to true in future releases of meson.
    See also: mesonbuild/meson#9300
MingcongBai pushed a commit to AOSC-Tracking/libinput that referenced this issue Nov 12, 2024
run_command() wants a check kwarg now:

WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: mesonbuild/meson#9300

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
TheEvilSkeleton added a commit to TheEvilSkeleton/Bottles that referenced this issue Dec 8, 2024
This addresses the following warning:
```
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: mesonbuild/meson#9300
```
TheEvilSkeleton added a commit to TheEvilSkeleton/Bottles that referenced this issue Dec 9, 2024
This addresses the following warning:
```
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: mesonbuild/meson#9300
```
mirkobrombin pushed a commit to bottlesdevs/Bottles that referenced this issue Dec 10, 2024
This addresses the following warning:
```
WARNING: You should add the boolean check kwarg to the run_command call.
         It currently defaults to false,
         but it will default to true in future releases of meson.
         See also: mesonbuild/meson#9300
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants