The `check` argument of `run_command` should be `True` by default
See original GitHub issueThe 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:
- Created 2 years ago
- Reactions:1
- Comments:13 (13 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Please, please, always include the source line in messages like this. In large projects, hunting for the right line to fix is a pita.
No, No, it’s good that you mentioned it.
Good error messages are important.