ExecutableSerialisation: capture and feed are optional strings

capture is the optional filename stdout is redirected to.
feed is the optional filename stdin reads from.
pull/12074/head
Xavier Claessens 2 years ago committed by Eli Schwartz
parent cdef674169
commit 28e6d2be96
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 12
      mesonbuild/backend/backends.py
  2. 6
      mesonbuild/utils/core.py

@ -510,8 +510,8 @@ class Backend:
self, cmd: T.Sequence[T.Union[programs.ExternalProgram, build.BuildTarget, build.CustomTarget, File, str]],
workdir: T.Optional[str] = None,
extra_bdeps: T.Optional[T.List[build.BuildTarget]] = None,
capture: T.Optional[bool] = None,
feed: T.Optional[bool] = None,
capture: T.Optional[str] = None,
feed: T.Optional[str] = None,
env: T.Optional[mesonlib.EnvironmentVariables] = None,
tag: T.Optional[str] = None,
verbose: bool = False,
@ -582,8 +582,8 @@ class Backend:
cmd_args: T.Sequence[T.Union[str, mesonlib.File, build.BuildTarget, build.CustomTarget, programs.ExternalProgram]],
workdir: T.Optional[str] = None,
extra_bdeps: T.Optional[T.List[build.BuildTarget]] = None,
capture: T.Optional[bool] = None,
feed: T.Optional[bool] = None,
capture: T.Optional[str] = None,
feed: T.Optional[str] = None,
force_serialize: bool = False,
env: T.Optional[mesonlib.EnvironmentVariables] = None,
verbose: bool = False) -> T.Tuple[T.Sequence[T.Union[str, File, build.Target, programs.ExternalProgram]], str]:
@ -638,9 +638,9 @@ class Backend:
return es.cmd_args, ''
args: T.List[str] = []
if capture:
args += ['--capture', str(capture)]
args += ['--capture', capture]
if feed:
args += ['--feed', str(feed)]
args += ['--feed', feed]
return (
self.environment.get_build_command() + ['--internal', 'exe'] + args + ['--'] + es.cmd_args,

@ -141,15 +141,13 @@ class EnvironmentVariables(HoldableObject):
@dataclass(eq=False)
class ExecutableSerialisation:
# XXX: should capture and feed default to False, instead of None?
cmd_args: T.List[str]
env: T.Optional[EnvironmentVariables] = None
exe_wrapper: T.Optional['programs.ExternalProgram'] = None
workdir: T.Optional[str] = None
extra_paths: T.Optional[T.List] = None
capture: T.Optional[bool] = None
feed: T.Optional[bool] = None
capture: T.Optional[str] = None
feed: T.Optional[str] = None
tag: T.Optional[str] = None
verbose: bool = False
installdir_map: T.Optional[T.Dict[str, str]] = None

Loading…
Cancel
Save