- For run_async, replace the silent option with the log_output option.
With log_output, lines are read one-by-one and logged. Otherwise, the
output is dumped to a temporary file.
- For tests, only log the output on failure. This substantially speeds
up verbose tests. A pw_kvs test went from 38 s to 1.2 s when
passing, or 26 s when failing and printing the output.
Change-Id: Iba18c555c07eeaa9eb5ba79bc8d36d3ef2435485
This change creates a top level bootstrap and activate script on Windows
to mirror the Linux setup.
Change-Id: I6d06ea2112b68deceb0d6d2011c3c80699a7e77f
MacOS runs into some strange issues when trying to call python3. While
the source of these issues has not been found, it was determined that
there is no longer any reason to try to prioritize python3 for env
setup, as it works with any Python version.
The environment variable to force python2 has been replaced with a
variable to force a specific version of Python.
Fixed: 151
Change-Id: Ief21cb1cf3f5326d2d7036d46c3a9fc0504ba9fa
This change updates the output of the bootstrap and env_setup scripts to
make it more detailed and prettier.
The POSIX-side improvements are handled here; Windows will come in a
follow-up change.
Example output:
WELCOME TO...
▒█████▄ █▓ ▄███▒ ▒█ ▒█ ░▓████▒ ░▓████▒ ▒▓████▄
▒█░ █░ ░█▒ ██▒ ▀█▒ ▒█░ █ ▒█ ▒█ ▀ ▒█ ▀ ▒█ ▀█▌
▒█▄▄▄█░ ░█▒ █▓░ ▄▄░ ▒█░ █ ▒█ ▒███ ▒███ ░█ █▌
▒█▀ ░█░ ▓█ █▓ ░█░ █ ▒█ ▒█ ▄ ▒█ ▄ ░█ ▄█▌
▒█ ░█░ ░▓███▀ ▒█▓▀▓█░ ░▓████▒ ░▓████▒ ▒▓████▀
BOOTSTRAP! Bootstrap may take a few minutes; please be patient.
Downloading and installing packages into local source directory:
Setting up CIPD package manager...done
Setting up Python environment.....done
Setting up Pigweed host tools.....done
Setting up Rust's cargo...........done
Activating environment (setting environment variables):
Setting environment variables for CIPD package manager...done
Setting environment variables for Python environment.....done
Setting environment variables for Pigweed host tools.....done
Setting environment variables for Rust's cargo...........skipped
Note: Re-run bootstrap with PW_CARGO_SETUP=1 set in your environment
to enable Rust.
Sanity checking the environment:
20200306 12:48:12 ℹ️ Pigweed environment passes all checks!
Environment looks good; you are ready to go!
To activate this environment in the future, run this in your terminal:
. pw_env_setup/env_setup.sh
Bug: 143
Change-Id: If91457888cecfa117d5b8907c82c396413c640e8
- Fix several typing issues.
- Disable type checking in several places where mypy wasn't working
correctly.
- Enable mypy.
- Execute individual steps in the same order as they are provided with
--step.
Change-Id: I229cf8ee39a4db5067c1923b4acfc5fcd164f733
This change adds an argument to the pw command which prevents it from
printing the Pigweed banner. This is useful when pw is called from
scripts to avoid polluting the output.
Bug: 143
Change-Id: I30af43bd7815aa0472a1cb1ac2ca3f5ef49976dc
Echo info about steps in generated env setup script.
Also run 'pw doctor' at end of env setup script.
Non-warning/error output can be suppressed by setting
PW_ENVSETUP_QUIET to '1'.
Change-Id: Ief333779dabbdb4613db05726d00f80d3fca325a
This change fixes pw_exec to work with Windows GOPATHs and enables ANSI
color codes in cmd.exe. This should be the final change required to run
host builds within Windows, so it is added back into the env_setup
steps.
Fixes: 97
Change-Id: I389e9374ec685f2b94de8d7651733207e7b1ecf8
This change switches the test runner from coloredlogs to pw_cli.log with
the timestamp removed to improve its output when running from Ninja.
Change-Id: Ieb6dd09988309eb3244f13345a73c7b9053a5065
This change adds an environment module to pw_cli which defines all of
the environment variables used by Pigweed.
A new variable named PW_USE_COLOR added, forcing the use of log colors
even if not printing to a TTY. This is set by the watch command for its
subprocesses.
The check for the PW_SUBPROCESS variable in logging is updated to use
the environment module.
Change-Id: I84007691f3ae9bb262c6bf6471afa43db831268f
This change adds a Python module which implements an environment
variable parser that allows defining and typing environment variables
for a Python program.
Change-Id: Icda61c8dabcf4e4bc6902707f6ebed9c50d31d71
This change extends the watch command to ignore the presubmit directory
in addition to its build directories.
Change-Id: I7880fcbd4e2887a8af736ee93ffccd404d60256e
This change renames the pw_test_server module to pw_target_runner and
integrates it into the GN build using the new Go templates. The module
is updated to match the GOPATH structure under its go/ directory, and
its protos are moved into the module protos directory. Additionally,
the simple server and client are split into two separate programs
instead of combining them into one.
Change-Id: I44adeca0989dc7e15cb1a169a6ce183139dde2ce
Before this patch, creating or modifying source files inside build
directories would re-trigger the build in the watcher. Until recently
this was not a problem, but with the introduction of Go support, we are
generating files in the out directory that trigger the watcher. This
change filters out all changes coming from the build directory.
Change-Id: Iecb33b23bfef623fd7ca83194b44e0157554da31
This makes the watcher clear the terminal before starting a build, to
make it clearer what terminal output is associated with the current
build. Additionally, a "BUILD" banner is now printed at the top to
indicate that a build is starting.
The approach of clearing the screen is also what various file watchers
from the JavaScript world do.
Example output:
██████╗ ██╗ ██╗██╗██╗ ██████╗
██╔══██╗██║ ██║██║██║ ██╔══██╗
██████╔╝██║ ██║██║██║ ██║ ██║
██╔══██╗██║ ██║██║██║ ██║ ██║
██████╔╝╚██████╔╝██║███████╗██████╔╝
╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝
20191223 12:41:11 INF Change detected: ./pw_varint/varint_test.cc
20191223 12:41:11 INF Starting build with 2 directories
20191223 12:41:11 INF [1/2] Starting build: out/disco
ninja: Entering directory `out/disco'
ninja: no work to do.
20191223 12:41:11 INF [1/2] Finished build: out/disco (OK)
20191223 12:41:11 INF [2/2] Starting build: out/host
ninja: Entering directory `out/host'
ninja: no work to do.
20191223 12:41:11 INF [2/2] Finished build: out/host (OK)
20191223 12:41:11 INF Finished; all successful.
.------------------------------------
|
| OK out/disco
| OK out/host
|
'------------------------------------
██████╗ █████╗ ███████╗███████╗██╗
██╔══██╗██╔══██╗██╔════╝██╔════╝██║
██████╔╝███████║███████╗███████╗██║
██╔═══╝ ██╔══██║╚════██║╚════██║╚═╝
██║ ██║ ██║███████║███████║██╗
╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚═╝
Bug: 39
Change-Id: I4383ff489aa3d51b8320fa514001e95529b8db85
Create a logger for each check. Add a FileHandler with level DEBUG to
these loggers. Since they're child loggers of the root logger, warn()
and error() send output to the log file and to stderr.
Make several changes to simplify passing these log objects around.
Add log statements to a few presubmit checks.
Change-Id: If13ad92da5c2abf9035e78c1cbe81d5025916888
Bug: 3
This change adds a module responsible for invoking the protobuf compiler
to generate code from .proto definition files. It provides a GN template
which performs the codegen operation on a list of input .proto files.
The template currently only supports C++.
Change-Id: I5558fd5b4282e0d6f09f8fafebda972738dc1e83
This change sets an environment variable in the subprocess run by
pw_cli.process.run() to indicate that it is running as a subprocess.
Change-Id: I1def3259b62578a156a4b374d41af99692147699
- Use env_setup/virtualenv/init.py to setup the Python venv.
- Improve diff colorization.
- Add function for finding Python packages from .py file changes.
- Add check that runs Python tests.
- Enable full pylint and yapf as warnings.
- Delete unused code in watch.py that used an undefined variable.
- Enable required python -E check.
Change-Id: I5ba9882ea9ec93f006260d5636031dd0b5005a85
- Have requirements.in only include what is necessary for the build.
- Update requirements.txt.
- Remove pw_cli/requirements.txt since the dependencies are noted in the
setup.py.
Change-Id: I622d066312c0436074d10fe6e8345feed1c31d06
This starts a basic Pigweed meta-module tool. The first tool is a simple
checker invoked with
pw module-check
which for now does two super-simple checks. Example output:
$ pw module-check pw_module
20191125 07:53:57 PM INF Checking module: pw_module
20191125 07:53:57 PM INF OK: Module pw_module looks good; no errors or warnings found
$ pw module-check pw_foo
20191125 07:54:00 PM INF Checking module: pw_foo
20191125 07:54:00 PM ERR PWCK001: Python code present but no setup.py.
20191125 07:54:00 PM ERR PWCK002: C++ code present but no tests at all (you monster).
20191125 07:54:00 PM ERR FAIL: Found errors when checking module pw_foo
Change-Id: I6eb3bfa941abc450a33affbec3e005477b9b2dc4
This change adds a module within pw_cli that provides a function for
running a subprocess and capturing its stdout and stderr to the main
pw log. A new log level is defined for the captured output.
The pw_unit_test runner script is updated to use this function instead
of running its subprocess directly.
The pw command is updated to run its subcommand in an async context,
preventing subcommands from needing to create their own. Fully
synchronous subcommands continue to function transparently to this.
Change-Id: Ia9efb1fbda8a38ef91a0e14113929711038710a8
This renames pw_cmd to pw_cli, since our plan is for the cli module to
contain general command line interface related tooling, rather than just
the pw_cmd itself.
Change-Id: I1dc7185db25b89d725601ac5d47e0793ea907bf1