pw_doctor#

Pigweed AI summary: The "pw_doctor" module checks if the environment is set up correctly for Pigweed projects. It includes checks such as matching the OS, defining "PW_ROOT" correctly, installing the presubmit git hook, and ensuring that Python and CIPD are set up correctly. The module can be configured through the "pigweed.json" file, but customization is not widely supported yet.

pw doctor confirms the environment is set up correctly. With --strict it checks that things exactly match what is expected and it checks that things look compatible without.

Projects that adjust the behavior of pw_env_setup may need to customize these checks, but unfortunately this is not generally supported yet.

Checks carried out by pw_doctor include:

  • The bootstrapped OS matches the current OS.

  • PW_ROOT is defined and points to the root of the Pigweed repo.

    • If your copy of pigweed is intentionally vendored and not a git repo (or submodule), set PW_DISABLE_ROOT_GIT_REPO_CHECK=1 during bootstrap to suppress the anti-vendoring portion of this check.

  • The presubmit git hook is installed.

  • Python is one of the supported versions.

  • The Pigweed virtual env is active.

  • CIPD is set up correctly and in use.

  • The CIPD packages required by Pigweed are up to date.

  • The platform support symlinks.

Note

The documentation for this module is currently incomplete.

Configuration#

Pigweed AI summary: The "pw doctor" tool in Pigweed can have its options specified in the "pigweed.json" file, with the current limitation of only one option. The "new_bug_url" option determines the link given to users for filing bugs, with the default being the Pigweed Bug Tracker. A JSON code block is provided as an example of how to specify this option in the file.

Options for pw doctor can be specified in the pigweed.json file (see also SEED-0101). This is currently limited to one option.

  • new_bug_url: What link is given to users be given for filing bugs. By default this is to the Pigweed Bug Tracker_.

{
  "pw": {
    "pw_doctor": {
      "new_bug_url": "https://example.com/bugs/new"
    }
  }
}