- Since protobuf Python packages are generated and installed from the
build directory now, add dependencies on package installs in the
build. This ensures packages are properly installed before tests or
linting.
- Instantiate all Python actions in the default toolchain. This prevents
duplicate instantiations of Python actions for each toolchain, which
causes flakiness as packages are reinstalled for each toolchain.
- Add python_deps to pw_python_action that Python actions can depend on
Python package installations.
- Add various missing dependencies between Python packages.
Change-Id: I4ec34f06c04014b3552cc1b60aa506ac9a89b329
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/30000
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
Run python -m pw_status.update_style to migrate to the new
Status::Code() functions from the Status::CODE variables.
Change-Id: I8757cf1f46586c04cd822c01f9868de7d3ea0583
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24481
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
- Add pylintrc and mypy_ini options to the pw_python_package template.
These can be used to specify configuration files to use for Pylint and
Mypy.
- Run pylint and mypy from the setup directory. This allows tools to
find per-package configuration files (if they aren't specified by the
pylintrc or mypy_ini arguments).
- Fix some incorrect import ordering that Pylint detects now that it
runs from package directories. PEP8 states imports should be grouped
by standard library, third party, and local package imports.
Change-Id: I8017341178ac5920d623ebbed4535432d69527c3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/26700
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Conversions to the pw_Status enum are dangerous, since they make Status
convertible to bool. This means statements like `if (status)` compile,
and status evaluates false for OK and true for non-OK.
This change replaces pw::Status's conversion to pw_Status with an
explicit code() function.
Change-Id: I2075a73c3e59ec051bd50b60a089baefc5f05dca
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24520
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
- Define CMake cache variables (similar to gn args) for facade backends.
- Create simple initial toolchain files for GCC and Clang.
- Misc updates to pigweed.cmake and pw_build/CMakeLists.txt.
- Add or expand various CMakeLists.txt files.
- Watch CMake files in watch.py to support using CMake in pw watch.
Change-Id: I490d157485d02811a11f6a3589a0508ea1851f58
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22840
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Keir Mierle <keir@google.com>
Updates the pw_trace_tokenized's host_trace_time backend to use
the std::chrono::steady_clock which is monotonic, instead of the
std::chrono::system_clock which may unexpectedly jump backwards
causing odd trace artifacts.
Change-Id: I42749e7a8272650c23f2ff420615a23191df3b1a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/23222
Reviewed-by: Rob Oliver <rgoliver@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Add an internal queue with a separate lock, this is a small section
which just copies the arguments making it suitable for a critical
section.
Emptying this queue is handled from a separate lock, which is a trylock.
If the queue is already being emptied, it is safe to return after adding
to the queue (no need to block).
Change-Id: I45bbf749b2cb8687bb5d8e485adde2256b2c99a8
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21881
Reviewed-by: Paul Mathieu <paulmathieu@google.com>
Commit-Queue: Rob Oliver <rgoliver@google.com>
Create a config header and expose through facade
(pw_trace_tokenized_CONFIG).
Change-Id: I8068589434cfe6a4a1d9a6f6d7bbcd8959c550c3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21880
Commit-Queue: Rob Oliver <rgoliver@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Paul Mathieu <paulmathieu@google.com>
- Generate BUILD.gn files with pw_python_packages using
pw_build.generate_python_package_gn.
- Add the new pw_python_package targets to the default build.
- Remove the unncecessary "python_packages" group.
- Fix some Windows path issues in Python tests.
Change-Id: I50c9b1f650652554f0836cbdc1781a00ec7e8e56
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22203
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
- PEP 561 (https://www.python.org/dev/peps/pep-0561/) specifies that
packages that wish to support type checking must provide a py.typed
marker file. Add py.typed to all packages.
- Add missing __init__.py files to pw_cli and pw_hdlc_lite.
Change-Id: I32d652222e9909a5ac4a5612c2dd1683b18b2d36
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22200
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
- Use the target-relative path for pylint's stamp so it is unique when
there are multiple files with the same basename (e.g. __init__.py).
- Serialize pip install commands since in-parallel --editable installs
do not work correctly.
- Run mypy over the entire package directory rather than individual
files.
- Fix various mypy issues so that mypy passes without
--ignore-missing-imports.
Change-Id: I8129144d7c963616e5b836dd2f082c41f1dc1416
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22201
Reviewed-by: Alexei Frolov <frolv@google.com>
Testing done:
- tested with data obtained on my own target
Change-Id: I16c11a632917d4758b5df97c120171af88af85f1
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/20283
Commit-Queue: Paul Mathieu <paulmathieu@google.com>
Reviewed-by: Rob Oliver <rgoliver@google.com>
The "# gn-format disable" comments are no longer necessary. Delete these
comments and reformat with a Vim macro and gn format.
Change-Id: Ia62c40ad73eef91187d0d443d6e3b0fa723e5aa9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21380
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
- Update labels so they use consistent naming. Instead of the
copy-and-pasted `chapter` prefix, name labels with a prefix consistent
with what they point to:
- "module-" for module
- "target-" for targets
- "docs-" for general documentation
- Remove the unnecessary highlight and default-domain directives.
Neither is necessary since the Pigweed docs always specify the
language in code snippets and other directives.
Change-Id: I55c34e9ec919f6f4670e5d3d008e0edf5fecf05b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19328
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
- Update Status::CODE style to Status::Code() using
pw_status/update_style.py.
- Make minor adjustments to the pw_assert tests to get them passing.
Change-Id: Ie54c3c605178fd1e42c7cedbcff324115f3ed279
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19165
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Renames the existing pw::varint::kMaxVarintSizeBytes to
pw::varint::kMaxVarint64SizeBytes and adds a new
pw::varint::kMaxVarint32SizeBytes.
Note this does not yet remove pw::varint::kMaxVarintSizeBytes, as
the existing users need to be migrated first.
Change-Id: Ie57e32b9526347df95282f7bba2d6f2ff34b4a08
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/18686
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Adds a support function that dumps the current trace buffer using the
pw_log module.
Change-Id: Ie3b5bb666602ed0b0f294514e8c55646fba5c902
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/18160
Reviewed-by: Paul Mathieu <paulmathieu@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Prashanth Swaminathan <prashanthsw@google.com>
Adding public to sources is unnecessary. Clean up the remaining places
where this is done.
Change-Id: I63f1df64054b319d0a3297f62227756a1e3847ed
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/15665
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
Add a example for how to filter out traces. in this example, all traces
from the processing task which aren't trace_id 3 are skipped.
Change-Id: I8c1ad1931cf2319df85c13c01b6d41e359e6cbb6
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/13922
Commit-Queue: Rob Oliver <rgoliver@google.com>
Reviewed-by: (☞゚∀゚)☞ Tennessee Carmel-Veilleux <tennessee@google.com>
Uses the trace sample app to demonstrate how to use trace events as
triggrs to capture a specific sequence of events. in this case the
example captures all events when handling job 3 of the sample app.
Change-Id: Ib278ad5318f428e1dee8813fd0d6cff9b77b1c1a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/13921
Commit-Queue: Rob Oliver <rgoliver@google.com>
Reviewed-by: (☞゚∀゚)☞ Tennessee Carmel-Veilleux <tennessee@google.com>
Run the trace sample app and dump all trace data to a file.
- Use std::chrono::system_clock as the time source for host builds.
- Add trace_to_file.h which registers callbacks and saves all trace data
to a provided binary file.
Change-Id: I57fac75ed91fc98646e7aae920897687a39549ab
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/13802
Commit-Queue: Rob Oliver <rgoliver@google.com>
Reviewed-by: (☞゚∀゚)☞ Tennessee Carmel-Veilleux <tennessee@google.com>
Add an optional ring buffer which holds the encoded trace data. When
included the buffer registers automatically and captures and stores
encoded trace events. This is a work in progress, future CLs will add
more/better methods of accessing the data.
Test: passes the included tests.
Change-Id: I0744547471086171dd47a22ed53312b1033930c7
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/13322
Commit-Queue: Rob Oliver <rgoliver@google.com>
Reviewed-by: (☞゚∀゚)☞ Tennessee Carmel-Veilleux <tennessee@google.com>
Tokenized trace, implements trace events by tokenizing all compile time
information of the event into a 32bit number (using tokenizer module).
This CL just adds the encoding of trace events and callback hooks,
buffering which usies the callback will be added in a future CL.
Test: passes included test
Change-Id: Ibfcc34211c09965af8da030e28dba5e8f7c6ccdb
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/11428
Commit-Queue: Rob Oliver <rgoliver@google.com>
Reviewed-by: (☞゚∀゚)☞ Tennessee Carmel-Veilleux <tennessee@google.com>
Reviewed-by: Keir Mierle <keir@google.com>