Commit Graph

12 Commits

Author SHA1 Message Date
Dylan Baker fcced46c99 interpreter: use typed_kwargs for run_command
This also cleans up a couple of internal callers of the internal impl
version that don't set the `check` argument, and therefore trigger a
warning about not setting the check argument.
2021-11-29 18:12:33 -08:00
Dylan Baker 3a168513bd interpreter: use typed_pos_args for run_command 2021-11-29 18:12:33 -08:00
Christian Clauss a5020857f3 Fix typos discovered by codespell 2021-10-10 16:12:25 -04:00
Eli Schwartz 800c3462f0
condense lines 2021-10-04 17:01:03 -04:00
Eli Schwartz d06cc042eb
f-strings 2021-10-04 16:29:32 -04:00
Eli Schwartz d7e71f3912 during executable lookup, do not search PATH if a directory component is given
This will always be wrong, because when a directory component is
provided we need to match an exact filename on a manual search path, for
example find_program with dirs: or the current meson.build subdir.

If we ever get this far, shutil.which will do the same "is there a
dirname, if so just check whether the filename exists relative to
cwd"... except that the documented meson lookup path is that we check
relative to meson.build subdir, not relative to the cwd, and the cwd
could be anything, but is probably the root sourcedir.

Since internally, meson does not actually os.chdir into the sourcedir,
it could be absolutely anything at all, though.

...

The actual returned name for shutil.which(name) given a literal pathname
with a directory component is "return name" without adding the absolute
path, which means that this is double-broken. Not only does it find
things we didn't expect, the resulting ExternalProgram object doesn't
have the correct path to the program, so it will report "found" and then
fail to actually run when the current directory is changed, for example
by ninja -C.

Fixes #9262
2021-09-20 13:44:32 -04:00
Daniel Mensinger 3e396b3782
fix: Always explicitly set encoding for text files (fixes #8263) 2021-06-29 11:28:08 +02:00
Daniel Mensinger 6879e84c48 holders: Move get_version from directly to ExternalProgram 2021-06-18 23:48:33 +02:00
Daniel Mensinger 66b32a4591 holders: Introduce HoldableObject 2021-06-18 23:48:33 +02:00
Dylan Baker 9016e4596c Move OverrideProgram to programs 2021-03-19 08:47:10 -04:00
Dylan Baker 97c1283baa programs: add type annotations 2021-03-19 08:47:10 -04:00
Dylan Baker 40e3577a65 split program related classes and functions out of dependencies
Dependencies is already a large and complicated package without adding
programs to the list. This also allows us to untangle a bit of spaghetti
that we have.
2021-03-19 08:47:10 -04:00