<commit_before>name: find_program
returns: external_program
description: |
  `program_name` here is a string that can be an executable or script
  to be searched for in `PATH` or other places inside the project.
  The search order is:

  1. Program overrides set via [[meson.override_find_program]]
  1. [`[provide]` sections](Wrap-dependency-system-manual.md#provide-section)
    in subproject wrap files, if [`wrap_mode`](Builtin-options.md#core-options) is
    set to `forcefallback`
  1. [`[binaries]` section](Machine-files.md#binaries) in your machine files
  1. Directories provided using the `dirs:` kwarg (see below)
  1. Project's source tree relative to the current subdir
     - If you use the return value of [[configure_file]], the
       current subdir inside the build tree is used instead
  1. `PATH` environment variable
  1. [`[provide]` sections](Wrap-dependency-system-manual.md#provide-section) in
    subproject wrap files, if [`wrap_mode`](Builtin-options.md#core-options) is
    set to anything other than `nofallback`

  Meson will also autodetect scripts with a shebang line and run them
  with the executable/interpreter specified in it both on Windows
  (because the command invocator will reject the command otherwise) and
  Unixes (if the script file does not have the executable bit set).
  Hence, you *must not* manually add the interpreter while using this
  script as part of a list of commands.

  If you need to check for a program in a non-standard location, you can
  just pass an absolute path to `find_program`, e.g.

  ```meson
  setcap = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
  ```

  It is also possible to pass an array to `find_program` in case you
  need to construct the set of paths to search on the fly:

  ```meson<commit_msg>docs: find_program can return the current Python3 interpreter<commit_after>name: find_program
returns: external_program
description: |
  `program_name` here is a string that can be an executable or script
  to be searched for in `PATH` or other places inside the project.
  The search order is:

  1. Program overrides set via [[meson.override_find_program]]
  1. [`[provide]` sections](Wrap-dependency-system-manual.md#provide-section)
    in subproject wrap files, if [`wrap_mode`](Builtin-options.md#core-options) is
    set to `forcefallback`
  1. [`[binaries]` section](Machine-files.md#binaries) in your machine files
  1. Directories provided using the `dirs:` kwarg (see below)
  1. Project's source tree relative to the current subdir
     - If you use the return value of [[configure_file]], the
       current subdir inside the build tree is used instead
  1. `PATH` environment variable
  1. [`[provide]` sections](Wrap-dependency-system-manual.md#provide-section) in
    subproject wrap files, if [`wrap_mode`](Builtin-options.md#core-options) is
    set to anything other than `nofallback`

  Meson will also autodetect scripts with a shebang line and run them
  with the executable/interpreter specified in it both on Windows
  (because the command invocator will reject the command otherwise) and
  Unixes (if the script file does not have the executable bit set).
  Hence, you *must not* manually add the interpreter while using this
  script as part of a list of commands. Since *0.50.0* if the "python3"
  program is requested and it is not found in the system, Meson will return
  its current interpreter.

  If you need to check for a program in a non-standard location, you can
  just pass an absolute path to `find_program`, e.g.

  ```meson
  setcap = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
  ```

  It is also possible to pass an array to `find_program` in case you
  need to construct the set of paths to search on the fly:

  ```meson
{'fraction_non_alphanumeric': 0.08152031454783748, 'fraction_numerical': 0.005242463958060288, 'mean_word_length': 4.081225033288948, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '914682', 'n_tokens_mistral': 1121, 'n_tokens_neox': 1079, 'n_words': 492}