question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The `check` argument of `run_command` should be `True` by default

See original GitHub issue

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,

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
keszybzcommented, 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.

0reactions
Volker-Weissmanncommented, Nov 17, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Working with parameters using Run Command commands
Run parameters by using either Run Command on the Systems Manager console or the AWS CLI.
Read more >
subprocess — Subprocess management — Python 3.11.1 ...
By default, the program to execute is the first item in args if args is a sequence. If args is a string, the...
Read more >
Check existence of input argument in a Bash shell script
In some cases you need to check whether the user passed an argument to the script and if not, fall back to a...
Read more >
Artisan Console - Laravel - The PHP Framework For Web ...
By default, this method will return false . However, if the user enters y or yes in response to the prompt, the method...
Read more >
Tutorial: Get started with System.CommandLine
This code also specifies a default value, which is why it sets isDefault to true . If you don't set isDefault to true...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found