Commit Graph

1371 Commits

Author SHA1 Message Date
Ewout van Bekkum
7a436e0697 pw_build: Move "-Wcast-qual" to strict_warnings
Moves "-Wcast-qual" from extra_strict_warnings to strict_warnings.

Change-Id: Iab39c765c5222e6d6cbeac4933fd89874d06c695
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21660
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
2020-10-16 20:40:32 +00:00
Armando Montanez
4eb4218063 pw_build: Fix linker script defines
For some reason this world may never know, I set up pw_linker_script
using process_file_template to iterate over defines. While this works
for most defines, it breaks when a define contains a file path. Switches
to use a foreach instead as it contains less internal magic.

Change-Id: I974a63fc6d769fa884b9c867944112d068453599
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21500
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Armando Montanez <amontanez@google.com>
2020-10-16 20:09:03 +00:00
Wyatt Hepler
ae222dc492 pw_kvs: Apply config pattern; configure log level
- Add PW_KVS_LOG_LEVEL to the pw_kvs config file and update code to
  use it.
- Define a pw_kvs:config facade that be used to override configuration
  values.
- Set up the empty "$dir_pw_build:empty" target that all modules use as
  their default configuration backend via the
  pw_build_DEFAULT_MODULE_CONFIGURATION variable.

Change-Id: Idf54d93678ffbd65e9e02a10454df4479f73827a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21240
Reviewed-by: David Rogers <davidrogers@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-10-16 19:45:13 +00:00
Ewout van Bekkum
b4f9598bae pw_build: Add "-Wimplicit-fallthrough" to strict_warnings
Enables "-Wimplicit-fallthrough" as part of the
"strict_warnings" config to ensure only explicit fallthrough is
permitted.

Change-Id: If72d56975f460ea70fa5275bcb592e593c26f986
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21462
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2020-10-16 16:49:53 +00:00
Ewout van Bekkum
2f20c13c61 pw_build: Add "-Wcast-qual" to extra_strict_warnings
Enables "-Wcast-qual" as part of the "extra_strict_warnings" config
to ensure const qualifiers are not dropped from pointer types. This
is planned to be moved to "strict_warnings" in the near future.

Change-Id: Ie0d88d8e8d7994ed6abb59b4aa31c6a8d47398f9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21461
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2020-10-16 04:19:33 +00:00
Ewout van Bekkum
3f1720a967 pw_presubmit: relax commit subject line length
Relaxes the commit subject line length requirement from 50 to
match the body's line length requirement of 72.

Change-Id: I2af5ff693edea22b5893b31327b8117bf8b26074
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21480
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
2020-10-16 04:18:21 +00:00
Alexei Frolov
3f2d00800d pw_rpc: Update packet class to return results
Following the pw_protobuf change updating the encode function to return
a result, this change forwards that through the RPC packet encoder.
The Packet::FromBuffer decoder is also updated to match.

Change-Id: I402e6d5c81b69758ca334960d872ad9639868bc6
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/20840
Commit-Queue: Alexei Frolov <frolv@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2020-10-16 00:12:39 +00:00
Wyatt Hepler
d49f8fe3f3 BUILD.gn files: Improve import formatting
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>
2020-10-15 18:12:55 +00:00
Rob Mohr
a0f0ba8bce [OWNERS] Add ewout@google.com
Change-Id: I2c53eb3d8c47ce84f210514c7833fdf2d71c3bcc
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21341
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Rob Mohr <mohrr@google.com>
2020-10-15 17:17:54 +00:00
Rob Mohr
895d3df23c pw_env_setup: Change how files are passed in
Change how files are passed into pw_env_setup. In most cases they're
passed in with --use-pigweed-defaults, but downstream projects now have
the option to not include Pigweed's defaults.

Change-Id: I82383705e156be14276a8498648ca376e3340efb
Bug: 274
Requires: pigweed-internal:7120
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19380
Commit-Queue: Rob Mohr <mohrr@google.com>
Reviewed-by: Joe Ethier <jethier@google.com>
Reviewed-by: Michael Spang <spang@google.com>
2020-10-15 13:31:04 +00:00
Sam McCauley
0da412c13a pw_build: Add pw_zip target
Change-Id: I2e8f5653918b8d3a083e6e5a79554d682be79765
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19583
Reviewed-by: Joe Ethier <jethier@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Sam McCauley <stmc@google.com>
2020-10-14 21:15:05 +00:00
David Rogers
3c29837b10 pw_kvs: Count erases + HeavyMaintenance
- Add counting of sectors erased. This count is only since instance
construction.
- Add HeavyMaintenance to be heavy and aggressive about garbage
collecting sectors with valid data.
- Don't erase sectors when doing garbage collection of sectors that are
already erased.

Change-Id: I4fb1647c1920cdc64a7a1029078575068a9156ce
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/20960
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: David Rogers <davidrogers@google.com>
2020-10-14 16:40:11 +00:00
Wyatt Hepler
6473c85887 pw_tokenizer: Fix tests on Windows
detokenize_test.py fails on Windows because Windows doesn't support
having two open file descriptors for the same file.

Change-Id: I218586311407f713b20d62229ace4a0ae75befb4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21100
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-10-13 18:53:13 +00:00
Wyatt Hepler
79d983f20d pw_build: pw_python_script enhancements
- Add --module option, which allows running a Python module instead of a
  script.
- Add --directory option that changes the output directory before
  running the command.
- Add pw_python_script_foreach, which is action_foreach with
  pw_python_script's features.

Change-Id: Idaa208cf9032467a7e3206043935b223cbbff559
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/20640
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
2020-10-13 17:29:03 +00:00
Paul Mathieu
9a9ed1311f pw_kvs: de-inline FlashPartition constructor
This is so that we can safely use PW_DCHECK

Change-Id: Id29b7ebfbef012ee892255d9eac735044a49f311
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21041
Commit-Queue: Paul Mathieu <paulmathieu@google.com>
Reviewed-by: David Rogers <davidrogers@google.com>
2020-10-13 03:19:30 +00:00
Rob Mohr
59d645cdb1 pw_presubmit: Add TODO about removing "whitelist"
Change-Id: I3652f9faf674dce8244cee5942d3fd6de0106804
Bug: 280
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/20780
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Rob Mohr <mohrr@google.com>
2020-10-12 21:19:14 +00:00
Anthony DiGirolamo
aebd39e292 pw_toolchain: pw_command_launcher build arg
New `pw_command_launcher` build arg that uses the `command_launcher`
tool variable. GN docs:
https://gn.googlesource.com/gn/+/master/docs/reference.md#func_tool

This wraps each compile in the given command.
For example using ccache yields faster re-compiles:

~/pigweed $ rm -rf out \
  && gn gen out --args='pw_command_launcher="ccache"' \
  && time ninja -C out stm32f429i
Generating compile_commands took 46ms
Done. Made 4617 targets from 114 files in 261ms
ninja: Entering directory `out'
[380/380] stamp obj/stm32f429i.stamp

real    0m39.430s
user    4m12.004s
sys     0m30.478s

~/pigweed $ rm -rf out \
  && gn gen out --args='pw_command_launcher="ccache"' \
  && time ninja -C out stm32f429i
Generating compile_commands took 45ms
Done. Made 4617 targets from 114 files in 243ms
ninja: Entering directory `out'
[380/380] stamp obj/stm32f429i.stamp

real    0m2.527s
user    0m12.540s
sys     0m4.708s

Change-Id: I153bd5cae2fdcff73301b4a787fabee68e96af3d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/20262
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
2020-10-12 20:46:39 +00:00
Rob Mohr
c26cb51c9e pw_presubmit: Use "blocklist" in .pylintrc
Change "blacklist" to "blocklist" in .pylintrc.

Change-Id: I7c9250bf8f5026ab460f79012822e7473f04a932
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/20720
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Rob Mohr <mohrr@google.com>
2020-10-12 19:05:59 +00:00
Anthony DiGirolamo
c36af656df Arduino: unit_test_runner
- New unit test scripts
  - arduino_unit_test_runner
  - arduino_test_server
  - arduino_test_client
  - teensy_detector

- arduino_builder changes
  - '--config-file' loading and '--save-config' options
  - '--set-variable' option to set arduino recipe vars. This is used
    for passing vars to the teensyloader flash recipe.

- GN changes
  - exec_script(arduino_builder) calls will save config files to:
    ./out/arduino_debug/gen/arduino_builder_config.json
  - 'pw_arduino_use_test_server' gn build arg

The test_runner and test_server both require a options to
run properly, see targets/arduino/target_docs.rst for usage.

Change-Id: I118498c291d2fbb034faa372b9250f6a0783a478
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19220
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
2020-10-12 19:02:19 +00:00
Alexei Frolov
13c7c4fdaf pw_protobuf: Return a Result from Encode()
This updates Encoder::Encode() to return a Result to make it less
awkward to use and to ensure that its status is checked by the caller.

Change-Id: Ie376ee07555199010e4363d013959bb24b0db79a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19620
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
2020-10-12 16:42:49 +00:00
chao liu
7c9a74498b pw_env_setup: support proxy use for cipd download
This add a entry in wrapper.py read system proxy setting
issue found in CHIP that using pigweed as third_party tools

Reported at https://github.com/project-chip/connectedhomeip/issues/2893

Test: 1. with system python setting to py2.7 and py3.8
      2. export https_proxy=http://proxy_ip:8080
         or export https_proxy=http://username:password@proxy_ip:8080
         or replace https_proxy with HTTPS_PROXY
      3. source activate.sh

      The cipd download success with proper proxy setting

Change-Id: I2b5b582cad68f5cceef9d867a16c0fa5f563f075
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19181
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Rob Mohr <mohrr@google.com>
2020-10-12 16:23:00 +00:00
pigweed-roller
fe46fcd6c0 docker: Roll tag to 2006150937
From: us.gcr.io/google.com/pigweed/environment:9e70391d95ed413ae396b4f598b3aec460e37864
To: us.gcr.io/google.com/pigweed/environment:2006150937cebd9b98206c2e7f39ee17cce5fddb

CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: I33e90787378fc2ed63c9e4c2b862131bf0cc765b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/20460
Reviewed-by: Pigweed Roller <pigweed-roller@pigweed.google.com.iam.gserviceaccount.com>
Commit-Queue: Pigweed Roller <pigweed-roller@pigweed.google.com.iam.gserviceaccount.com>
2020-10-11 16:25:39 +00:00
pigweed-roller
2006150937 roll: goma-client
From: git_revision:1dedb59e6102d227b85cf144c786eca51bbfd5b6
To: git_revision:4e2693cc42d116902f0767b9b93643555f79e7c4

CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: I3c83c55f7e971f33ea19b491096179b0e12f19a1
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/20420
Reviewed-by: Pigweed Roller <pigweed-roller@pigweed.google.com.iam.gserviceaccount.com>
Commit-Queue: Pigweed Roller <pigweed-roller@pigweed.google.com.iam.gserviceaccount.com>
2020-10-11 11:18:49 +00:00
pigweed-roller
33477746f1 roll: host_tools
From: git_revision:062ed18abbf7d2555c84bd6ffe2399c207a250ed
To: git_revision:9eb16951269a0555adbef8bb520ab1708bf09078

CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: Ia0c9fddcf194ca5522ca299277ab1e5c15916308
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/20360
Reviewed-by: Pigweed Roller <pigweed-roller@pigweed.google.com.iam.gserviceaccount.com>
Commit-Queue: Pigweed Roller <pigweed-roller@pigweed.google.com.iam.gserviceaccount.com>
2020-10-11 00:18:18 +00:00
Wyatt Hepler
9eb1695126 pw_tokenizer: Base64EncodedBufferSize function
Rename Base64EncodedSize to Base64EncodedBufferSize and have it include
the null terminator. This makes it easier to use directly to size
buffers for Base64 encoding.

Change-Id: Ied24eed67f8d3c5e42a405c98e0b20b30d543536
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/20300
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
2020-10-10 01:32:44 +00:00
David Rogers
22f7b3e03d pw_blob_store: Add additional tests
Add additional blob store tests.
Change the padding at blob close to be flash erased byte rather than
zero.

Change-Id: If66f62ac15fb3733befe94900e6b9c8fba4db4c6
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/20160
Commit-Queue: David Rogers <davidrogers@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
2020-10-09 19:10:04 +00:00
Wyatt Hepler
338c6a1002 pw_metric: Add comment and fix typo in proto
Change-Id: Ic1f5fa8174e73306cd6ab3130e42ca12becbd0f1
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/20180
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-10-08 20:49:15 +00:00
Prashanth Swaminathan
fce26ba0e5 pw_log_rpc: Add log queue implementation
The log protobuf format has been modified to accept signed integers for
the elapsed time, to account for negative deltas.

Change-Id: I3fbc4a1b1dd9cdd5402cd621d6dcf5ae3ec6ecc5
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19040
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Prashanth Swaminathan <prashanthsw@google.com>
2020-10-07 15:49:21 +00:00
Wyatt Hepler
21418c48b1 pw_rpc: Remove unused groups
Change-Id: I8fce2aff965db509e683e7c952eeaffe880168d4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19980
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-10-07 14:46:32 +00:00
Wyatt Hepler
cdafbb4d57 pw_tokenizer: Make Base64 encoding easier to use
- Have PW_TOKENIZER_CFG_ENCODING_BUFFER_SIZE represent the whole encoded
  buffer, including the 4-byte token. This makes the value easier to use
  directly since the token is already accounted for.
- Update the Base64 encoding functions to always add a null terminator
  to the Base64 output.
- Provide a pw::tokenizer::PrefixedBase64Encode overload that allocates
  the buffer using pw::Vector.

Change-Id: Id78ef06a7d2111e7dfe5604ee091975be40ceed4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19720
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-10-06 21:04:17 +00:00
Wyatt Hepler
2cbb313f93 pw_status: [[nodiscard]] functions, comment update
- The return values of the Status member functions should not be
  ignored, so add [[nodiscard]].
- Reorder Status values and update the comments to match Abseil's
  status/status.h.

Change-Id: Ie91f4f5fbb98353caf1df905a6bf5ce5da4ecaf9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19360
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-10-06 19:59:25 +00:00
Anthony DiGirolamo
50a196f8db Arduino: python cleanup
- Move code in arduinobuilder.py to their own modules:
  - __main__.py
  - builder.py
  - core_installer.py
  - file_operations.py
- New log.py module
- os.system -> subprocess.run
- Move --run-* args in the 'show' subcommand under the 'run' subcommand.
  This allows running multiple steps in the same invocation. For
  example, this will execute 3 steps:

  arduino_builder run \
                  --run-objcopy \
                  --run-postbuild \
                  --run-upload-command teensyloader

Change-Id: Ibe5493689f39aa6e6aaeecf5bc7065929111499d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19143
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
2020-10-06 19:50:35 +00:00
Armando Montanez
0ab4c0ac5a pw_stream/pw_blob_store: Remove CHECK from headers
Switches CHECKs to ASSERTs in headers.

Change-Id: Ide78948fb6407d00e113b69340491b0d70a6ad9c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19744
Reviewed-by: David Rogers <davidrogers@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Armando Montanez <amontanez@google.com>
2020-10-06 16:20:04 +00:00
Prashanth Swaminathan
85d3679e85 pw_log: Limit level values to fit within 3 bits
In order to fit within the log.proto definition of log levels, the
existing level constants are now limited to three-bit-width values.

Change-Id: I9cc40e84761383406a1264ead65e0d298c309660
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19740
Commit-Queue: Prashanth Swaminathan <prashanthsw@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
2020-10-06 16:02:49 +00:00
Carlos Chinchilla
32358e57af Arduino: Set empty config if core is missing
Create an empty object of the same type as arduino_build when the
arduiro core is not specified.

Change-Id: Ia4cf3d19622ad2297f5d3d4220cb8ca8e894a8c5
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19741
Commit-Queue: Carlos Chinchilla <cachinchilla@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
2020-10-06 00:43:19 +00:00
pigweed-roller
2e3d636903 docker: Roll tag to 9e70391d95
From: us.gcr.io/google.com/pigweed/environment:40351225471b5654a9c0e9b1f767af6ffdac5eae
To: us.gcr.io/google.com/pigweed/environment:9e70391d95ed413ae396b4f598b3aec460e37864

CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: I9cef359387afb8820b32ee376b177293f17b4c73
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19663
Reviewed-by: Pigweed Roller <pigweed-roller@pigweed.google.com.iam.gserviceaccount.com>
Commit-Queue: Pigweed Roller <pigweed-roller@pigweed.google.com.iam.gserviceaccount.com>
2020-10-04 16:28:09 +00:00
pigweed-roller
9e70391d95 roll: gn
From: git_revision:5233fa13e84fa4adddaf6e00f22aaee16f94342f
To: git_revision:de5a8348b2eef6833146542d8b376e1e79bfeb8b

CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: Ia7c96774f7d35e49609d2d99dd9e32956b5a900a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19660
Reviewed-by: Pigweed Roller <pigweed-roller@pigweed.google.com.iam.gserviceaccount.com>
Commit-Queue: Pigweed Roller <pigweed-roller@pigweed.google.com.iam.gserviceaccount.com>
2020-10-04 06:14:58 +00:00
pigweed-roller
431c7e9d3d roll: host_tools
From: git_revision:2afeb0e8ec510caf4618bbbfeebb9ec3c2767dc4
To: git_revision:062ed18abbf7d2555c84bd6ffe2399c207a250ed

CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: I33fdea93aa6a823de02171a3a8f7b0ad6c4b6c09
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19640
Reviewed-by: Pigweed Roller <pigweed-roller@pigweed.google.com.iam.gserviceaccount.com>
Commit-Queue: Pigweed Roller <pigweed-roller@pigweed.google.com.iam.gserviceaccount.com>
2020-10-04 00:15:38 +00:00
Alexei Frolov
062ed18abb pw_rpc: Send CLIENT_ERROR on unexpected packet
This updates the RPC client to send back a CLIENT_ERROR to the server if
it receives a packet it was not expecting. The server is updated to
handle client errors by ending the active RPC, if applicable.

Change-Id: Ia9a2f36571fd3f91e28a50393c531df66ba11f09
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19180
Commit-Queue: Alexei Frolov <frolv@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2020-10-02 16:21:48 +00:00
Wyatt Hepler
da651f169f pw_watch: Don't restart on file changes by default
- Create the --restart option for pw watch that restarts builds when a
  file changes, but have it default off. Restarting automatically is
  problematic if projects happen to generate files tracked by pw watch
  during the build, as it results in an infinite loop. Better path
  filtering is needed to prevent this.
- Fix mypy issue related to path_to_log that came up.

Change-Id: I73e16e707a2f65c705ff986c92018c3b3662852a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19440
Reviewed-by: Murphy Stein <steinm@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-10-01 23:34:57 +00:00
Rob Mohr
6a10edf12c pw_env_setup: Limit recursive setup.py search
Don't recursively search for setup.py files within an already found
Python package.

Bug: 275
Change-Id: I982b0187e751ffea736ffa9e22cea36ff5e97e3e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19441
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Rob Mohr <mohrr@google.com>
2020-10-01 21:49:05 +00:00
Wyatt Hepler
f9fb90f299 docs: Make labels consistent; remove boilerplate
- 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>
2020-10-01 21:47:35 +00:00
Wyatt Hepler
455b4923ba pw_rpc, pw_hdlc_lite: Documentation update
Change-Id: Ie4b7121177133e1539ae3dca066a15e9fba689e7
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19161
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
2020-10-01 21:45:35 +00:00
Wyatt Hepler
7d9cc974fb pw_tokenizer: Support database text replacements
Support a --replace argument for database.py that replaces text in
the tokenized string database. This can be used to scrub potentially
senstive terms (e.g. code names) from token databases, which may be
distributed.

Change-Id: Ie5530e09e9ea1c92894914426fddd1278ce93661
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19020
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-10-01 16:20:04 +00:00
Wyatt Hepler
140c6ef413 pw_watch: Terminate interrupted builds
- Terminate interrupted builds immediately. This saves time since the
  the watcher doesn't have to wait for the previous build to finish
  before starting a new build.
- Remove some unused members of PigweedBuildWatcher.

Change-Id: I2218f711725ceb76a374c9e035a62f8c64224fdb
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19301
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-10-01 16:06:41 +00:00
Wyatt Hepler
d78f7c6b75 pw_status: Update Status::CODE to Status::Code()
- 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>
2020-09-30 18:09:44 +00:00
Wyatt Hepler
8d3ceb6e81 pw_hdlc_lite: Rename modules
Rename encoder.py to encode.py, since there is no encoder -- just a
function that encodes information frames. Rename decoder.py for
consistency.

Change-Id: I6aec98b51e1298aa920cbe5d26ca4d6785607acc
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19300
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-09-30 16:38:12 +00:00
Alexei Frolov
4d2adde7c6 pw_rpc: Basic client implementation
This implements an RPC client class which is used to make RPC requests
to a server. Like the server, the client exists globally and processes
incoming RPC packets. The client keeps track of active RPC request
contexts through ClientCall objects, and dispatches packets to them when
an expected response is received.

A nanopb implementation of a ClientCall is added as well, supporting
unary and server-streaming RPC calls, with a codegen-ready API.

Change-Id: If9615877199e0d4bc468c33d3d9ecf85da32440a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/15741
Commit-Queue: Alexei Frolov <frolv@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2020-09-30 16:31:44 +00:00
Wyatt Hepler
bb57d9cdd5 pw_status: Docs update
- Expand status docs.
- Fix update_style.py docstring.

Change-Id: I44323ca293d801d9c8b5e24ee3353046ec3d5db2
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19164
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-09-30 16:31:23 +00:00
Carlos Chinchilla
1ba30db66d pw_hdlc_lite: Break dependencies apart
Separate encoder and decoder dependencies to allow projects to import
one without the other, but keep them as the core of `pw_hdlc_lite`.
This fixes a circular dependency when encoding tokenized logs for
HDLC-Lite RPCs, since `pw_hdlc_lite:decoder` depends on logging, and
tokenized logging only needs `pw_hdlc_lite:encoder`.

Change-Id: Id94821cb3e12c9b772b45ea17e640d833a6732ed
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19145
Commit-Queue: Carlos Chinchilla <cachinchilla@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2020-09-30 00:32:41 +00:00