Commit Graph

1526 Commits

Author SHA1 Message Date
Ewout van Bekkum
58901934cd pw_sync: Adds initial SpinLock primitive
Adds the first synchronization primitive to Pigweed: the
pw::sync::SpinLock with integrated local interrupt
masking.

This also provides the first backend for the SpinLock facade
backed by an STL implementation. Note that signals are considered
"NMIs" while spin locks are only supported up to IRQs, ergo no
local interrupt/signal masking is done in the STL implementation.

Change-Id: I34204835c55e54597077d40665f61715964803f9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/25802
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
2020-11-24 19:02:43 +00:00
Wyatt Hepler
00efe188a1 pw_watch: Rework arguments
- Update the command line arguments to make pw watch simpler to use.
  Positional arguments are interpreted as targets in the default output
  directory. -C or --build_directory can be provided to support
  specifying the build directory or using multiple directories.
- Find Ninja directories by build.ninja instead of args.gn to support
  CMake.
- Call .kill() instead of .terminate() on Ninja to give it time to
  properly clean up before closing.
- Import Path from pathlib, for consistency with other modules.

Change-Id: Ic66e58ce775de4a3a8749109d4ff65eb78a22aac
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/25760
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-11-24 00:06:06 +00:00
Wyatt Hepler
afd2914e24 pw_rpc: Support testing services with mixed protobuf libraries
- Replace the public internal method lookup generated functions with a
  private array of method IDs. Create a MethodLookup class that is
  friended by generated services to access this array.
- Use the generated method ID array to support method lookup in services
  with multiple different protobuf implementations (Nanopb and raw).
- Ensure that the correct method implementation is selected when looking
  up a method at compile time. This prevents accidentally accessing a
  Nanopb method as a raw method or vice versa in a test method context.

Change-Id: I0ea334c02ae7c29e50099aa5bcfa975df625d15e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/25740
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-11-23 22:05:07 +00:00
Wyatt Hepler
b6495b3f84 pw_rpc: Generic test for Method and MethodTraits implementations
Change-Id: Iaef3a3b15cbd1c9f6fb7e2f897011f02592466cb
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/25642
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-11-23 21:57:47 +00:00
Wyatt Hepler
e95bd72668 pw_rpc: Check RPC method signature; improve errors
- Fix issue where an RPC method could be implemented with the signature
  of a different RPC type. Pass the expected method type when methods
  are created and check that it matches the type deduced from the method
  signature.
- Reduce code duplication to limit the number of places where
  compilation errors occur.
  - Combine variable RPC method traits classes into MethodTraits.
  - Move all Method creation functionality into the method classes.
  - Put the final method invocation logic into one function that
    supports member functions or static functions.
- Consolidate error messages for incorrect method signatures into one
  place. Expand the messages and describe the expected function
  signature.

Change-Id: Iae3c6d32df715e877e8c977ccd2232814ef590a7
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/25641
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-11-23 21:43:58 +00:00
Wyatt Hepler
5953433921 pw_build: Don't require sources in pw_python_package
To simplify referring to third-party packages, no longer require listing
sources in pw_python_packages.

Change-Id: If7624f3a2dce413042dd531d39e0b04e91b67c0f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/25741
Reviewed-by: Zoltan Szatmary-Ban <szatmz@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-11-23 17:47:56 +00:00
pigweed-roller
cd97252ecf roll: goma-client
From: git_revision:b3d6d03fbdc1d0cfcdae70db30830a08eece4ae1
To: git_revision:98ad65ed6f3182e873a974d1b61427bdf0ab4600

CQ-Do-Not-Cancel-Tryjobs: true
Roller-URL: https://ci.chromium.org/b/8862935772165138080
Cq-Cl-Tag: roller-builder:goma-client-roller
Cq-Cl-Tag: roller-bid:8862935772165138080
CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: I9835e84f017d07ca25e22bb6f3be6171e3789ecb
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/25682
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-11-22 11:14:24 +00:00
pigweed-roller
3c16e4eb4e roll: gn
From: git_revision:0ae75f90df148d19083055b29c4c940b136904b4
To: git_revision:646a62e029de4827e384c8517dc62fd3c7f85207

CQ-Do-Not-Cancel-Tryjobs: true
Roller-URL: https://ci.chromium.org/b/8862954647188938768
Cq-Cl-Tag: roller-builder:gn-roller
Cq-Cl-Tag: roller-bid:8862954647188938768
CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: Ifef60fd0288e5cc3115e5d56f196ab1017d480d8
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/25680
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-11-22 06:15:33 +00:00
pigweed-roller
c674cd1909 roll: host_tools
From: git_revision:1217abbb80bbe1f956cebe88ae5fcfe3db56a34b
To: git_revision:a9e249dad3cb9e29f7484d2a24a6def9337e0773

CQ-Do-Not-Cancel-Tryjobs: true
Roller-URL: https://ci.chromium.org/b/8862977295496621088
Cq-Cl-Tag: roller-builder:host-tools-roller
Cq-Cl-Tag: roller-bid:8862977295496621088
CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: I8a75671fdbc95509e098f6f36298036dee5b7484
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/25661
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-11-22 00:20:33 +00:00
Wyatt Hepler
a9e249dad3 CMake: Make the default build empty
- Include subdirectories with EXCLUDE_FROM_ALL and make sure all targets
  have this property set. This gives external projects full control over
  what builds by default.
- Provide a `pw_apps` top-level group that builds standalone
  applications and add this to the CMake presubmit step.

Change-Id: I52f0043f78ffdf6a78ddf23e7a1a9635eb9eda58
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/25182
Reviewed-by: Zoltan Szatmary-Ban <szatmz@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-11-19 17:30:06 +00:00
Wyatt Hepler
2b27fdc1ec pw_hdlc_lite: Make RPC console more generic
- Make the HDLC frame handling code more generic.
- Move code for collecting protos from paths or modules into
  python_protos.py.
- Provide a protos variable in the RPC console for accessing proto
  messages by package.

Change-Id: I0d4e514944103e0657b4228a1e1aee236aefd8cd
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/25080
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
2020-11-19 00:44:22 +00:00
Alexei Frolov
e22570a2a3 pw_rpc: Return FailedPrecondition when writing to closed ServerWriter
If a ServerWriter is closed, its AcquirePayloadBuffer function returns
an empty span. The nanopb ServerWriter would then try to encode into
this span and fail, returning a cryptic INTERNAL status. This updates
the nanopb writer to correctly return FAILED_PRECONDITION if Write is
called when it is closed.

Change-Id: I30c70f0ee2a7f7c6f44bb8aded9aafa2045b99a4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/25260
Commit-Queue: Alexei Frolov <frolv@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2020-11-19 00:28:02 +00:00
Rob Mohr
298d309ecf pw_doctor: Check that pw plugins all loaded
Change-Id: I147d1eb552be601421ed358ae5a4b9785a4b1320
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24220
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
2020-11-18 20:11:14 +00:00
Alexei Frolov
80246796fe pw_unit_test: Add RPC service
This implements an RPC service that streams pw_unit_test events, as well
as a unit test main that initializes a server with the test service
registered and an HDLC serial channel.

Change-Id: I6c66f2216c54d82aa70c351d7d3d99d9a5c173de
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/23901
Commit-Queue: Alexei Frolov <frolv@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-11-18 17:55:18 +00:00
Anthony DiGirolamo
b5355eeb49 pw_arduino_build: Support Multiple Library Paths
- `--library-path` can take multiple paths in order of increasing
  precedence similar to Arduino IDE behavior. This is useful for
  including the 'libraries' directory included in an Arduino core
  and a separate user library folder.

- Remove serial wait loop from pw_sys_io_arduino

- Fix raised ValueError if arduino core install prefix is not
  relative to os.getcwd()

Change-Id: I6d68b319d2a6a4bfc6a7a599bf4c86f4bea96e39
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24840
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
2020-11-17 21:12:57 +00:00
Armando Montanez
9f848fdf9d Docs: Mention pigweed.dev in getting started
Adds a mention of pigweed.dev in the "Building the Documentation"
section of the getting started guide.

Change-Id: I172de3768df42b551b24ac878972260ce955c241
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24425
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Armando Montanez <amontanez@google.com>
2020-11-17 20:54:47 +00:00
Prashanth Swaminathan
5ef2aa2f3b pw_log_multisink: Move log queue and proto
Moves LogQueue to pw_multisink and log.proto to pw_log.

Change-Id: Icf81e9f6178e2a07a5927053d9d7f29e3153429b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22461
Pigweed-Auto-Submit: Prashanth Swaminathan <prashanthsw@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
2020-11-17 18:25:41 +00:00
Rob Mohr
582586b1a1 pw_env_setup: Move env dir to project root
Change-Id: I9739ac75e0782c7d95c1d74a762026a9a71b25ae
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24660
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: David Rogers <davidrogers@google.com>
2020-11-17 17:11:22 +00:00
Alexei Frolov
fbe68ff858 pw_unit_test: Add configurable deps to tests
This creates a build arg which appends additional public dependencies to
unit test targets. This is required after the .lib target change, as
dependencies which were previously included through the test main are no
longer applied to the test sources.

Change-Id: If4595724dd08763dcaac04a7b44e726a604338f8
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24920
Reviewed-by: Wyatt Hepler <hepler@google.com>
2020-11-17 02:23:51 +00:00
Alexei Frolov
69dccfdac9 pw_unit_test: Add library targets
This updates the pw_test and pw_test_group templates to create a .lib
target which contains the test code as a source_set that can later be
linked into a pw_test. pw_test_groups additionally have a new .bundle
target which builds an executable with all of the group's tests.

Change-Id: Ic77d9d3a02cd29487a9f82001d9bf3314da4fa27
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24621
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2020-11-17 02:23:51 +00:00
Alexei Frolov
66adf554fb pw_rpc: Update ChannelOutput release API
This changes ChannelOutput::SendAndReleaseBuffer to take a span instead
of a size. The previous API restricted a ChannelOutput implementation to
using a single buffer, which is limiting for larger systems. With the
new API, a ChannelOutput can hand out multiple buffers simultaneously.

Change-Id: Ie4c55bf66063493bf280353795c0295ceb7e450a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24444
Reviewed-by: Wyatt Hepler <hepler@google.com>
2020-11-16 17:21:51 +00:00
pigweed-roller
6c0df7dccc roll: gn
From: git_revision:fe9e5db149b0cc78e03511d52c452039dbf5ac1b
To: git_revision:0ae75f90df148d19083055b29c4c940b136904b4

CQ-Do-Not-Cancel-Tryjobs: true
Roller-URL: https://ci.chromium.org/b/8863588806820110512
Cq-Cl-Tag: roller-builder:gn-roller
Cq-Cl-Tag: roller-bid:8863588806820110512
CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: If0e45a3d3c82af24ce6bfc51b5289d9a2d702eef
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24644
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-11-15 06:14:36 +00:00
pigweed-roller
acfa61d9d6 roll: host_tools
From: git_revision:00e773eafb943b25643d2e32b0d0af2f032426b3
To: git_revision:1217abbb80bbe1f956cebe88ae5fcfe3db56a34b

CQ-Do-Not-Cancel-Tryjobs: true
Roller-URL: https://ci.chromium.org/b/8863611468930583232
Cq-Cl-Tag: roller-builder:host-tools-roller
Cq-Cl-Tag: roller-bid:8863611468930583232
CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: Iefc55c3dc222af9b7995db68a081895fa83a7179
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24760
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-11-15 00:15:46 +00:00
Wyatt Hepler
d109398072 pw_status: Read/write bytes for update_style.py
Using bytes avoids potential Unicode decode errors.

Change-Id: I0f58a19c0f06147d19cc18499d44c819abdb8cd1
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24480
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-11-13 20:41:27 +00:00
Rob Mohr
a28d22b9cc pw_env_setup: Print logs for gn/ninja failures
Change-Id: I471ad0dc09afd698e433aefb679809b2f402db0d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24561
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Joe Ethier <jethier@google.com>
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
2020-11-12 23:42:27 +00:00
Wyatt Hepler
a17fbddbf4 pw_status: Remove implicit conversion to pw_Status
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>
2020-11-12 23:22:55 +00:00
Wyatt Hepler
1217abbb80 pw_status: Add Status::code() method
This change prepares for removing the implicit conversion to pw_Status.

Change-Id: I31bbad155999920a7a5dd639a437616f75830ef3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24560
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
2020-11-12 23:01:45 +00:00
Wyatt Hepler
8aa5ed5fd0 pw_build: Make warning flags private in CMake
To prevent leaking warning flags to users, make the
pw_build.strict_warnings and pw_build.extra_strict_warnings private
dependencies. They automatically apply to Pigweed code, but not code
that depends on it. CMake projects using Pigweed should configure
their own warnings as appropriate.

Change-Id: I98c4cb29246d570f8ff91f2513832773a69f6df1
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24541
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Zoltan Szatmary-Ban <szatmz@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-11-12 21:59:25 +00:00
Armando Montanez
ec4aebb262 Clean up root python groups
Since the default toolchain now supports copying, python targets/groups
don't need to explicitly specify a toolchain.

Change-Id: Ie0d28d03d12e59c37f48d0f4e6f33a723fb6967b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24442
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2020-11-12 19:11:33 +00:00
Armando Montanez
7cd6f08474 pw_toolchain: Add copy to GN dummy toolchain
Adds a .gni to share the stamp and copy tools between the dummy
toolchain and generated toolchains.

Change-Id: I04e044c293854b60ad8117b1a603aa1993891d92
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24441
Commit-Queue: Armando Montanez <amontanez@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2020-11-12 18:47:32 +00:00
Wyatt Hepler
d9336a4cad pw_protobuf_compiler: Pass plugin paths
- Rather than relying on Python entry point scripts to get paths to
  protoc plugins, pass the paths to the generate_protos.py script. This
  works in environments where the Python entry points are not available.
- Use unique paths for generated proto code in the GN build. This allows
  multiple GN targets to generate code from the same .proto files. The
  CMake build already worked like this.
- Cleanup and reduce code duplication in the CMake and GN proto
  generation code.
- Support Windows builds: generate .bat wrapper script for plugins, fix
  compilation issue that affects some older compilers.

Change-Id: Iab27a3d193d6008567b324dc1c4e5f540894b8ff
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24380
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Zoltan Szatmary-Ban <szatmz@google.com>
2020-11-12 17:28:22 +00:00
Rob Mohr
bb3d5a9cda pw_env_setup: Remove setup py roots argument
It's no longer used by Pigweed or any downstream projects.

Change-Id: Ida7592bbcf625a152047cdc23ca5c7b0c60fa2f0
Bug: 287
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24202
Commit-Queue: Rob Mohr <mohrr@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2020-11-12 16:12:42 +00:00
Wyatt Hepler
5083907255 pw_status: Functions for checking the status code
- Add IsErrorCode() functions to simplify checking for specific status
  codes.
- Automatically replace some cases of status == Status::Code() with
  status.IsCode() in update_style.py.

Change-Id: I13be834a2413d694d41a7755d2e317c35d34c5bf
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/19521
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-11-12 04:48:14 +00:00
Wyatt Hepler
1ed189b7fa pw_tokenizer: Add entries rather than strings to databases
- Do not recalculate tokens when adding them to a token database.
- Remove unneeded APIs for adding plain strings. These are no longer
  needed and should not be used since the hash calculations are done
  entirely in firmware now.

Change-Id: I8d15088f2ebe60adf6e21d6ccbd0dc99ad255fd7
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24460
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-11-12 04:47:13 +00:00
Wyatt Hepler
73439f70c9 pw_tokenizer: Apply linker script in CMake
Automatically add the linker script in the CMake build, as the GN build
does.

Change-Id: Ibbad27fbb94c091c065983b80c91a85527844226
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24440
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-11-12 04:32:13 +00:00
Wyatt Hepler
ff4fc388ca pw_presubmit: Run CMake tests in default presubmit
Add the CMake tests to the 'quick' presubmit program so they run locally
by default (on supported platforms).

Bug: 251
Change-Id: I16a1fa44d167456a7234de4b58d71aed012de9e3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24261
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
2020-11-11 21:52:59 +00:00
Rob Mohr
0a8db6e3d0 pw_presubmit: Always rerun virtualenv setup
The virtualenv setup is now fast enough that it can always be run.

Bug: 287
Change-Id: I55c8de48bdcef53295f36d8814887134b31f87d5
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/23502
Commit-Queue: Rob Mohr <mohrr@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2020-11-11 16:16:49 +00:00
Rob Mohr
f5712ee345 pw_env_setup: Ensure PATH is exported
Bug: 281
Change-Id: Ib26cf37f14d6fe51bdc8b0c3dd20dbbd4165f8ce
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24160
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: David Rogers <davidrogers@google.com>
2020-11-10 22:04:35 +00:00
Wyatt Hepler
dcfa92bf0e pw_hdlc_lite: Build HDLC RPC example with CMake
- Add CMakeLists.txt for pw_hdlc_lite's RPC example.
- Update the pw_rpc CMake to split out individual libraries.
- Small docs update for using third party code in the CMake build.

Change-Id: I3ee8b85a275c3402dc494b0ea3a8140005241ccf
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24280
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-11-10 21:18:45 +00:00
Rob Mohr
321470342c pw_env_setup: Fix help string for argument
Change-Id: I060b28dc735caabf018443d060d9f4bc45bbe290
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24180
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
2020-11-09 20:01:10 +00:00
Rob Mohr
037298c081 git: Add "* text=auto" to .gitattributes
Change-Id: If241ed3f8d47ea06b797e34c3886b0891702e8b6
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24141
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
Commit-Queue: Rob Mohr <mohrr@google.com>
2020-11-09 18:05:42 +00:00
Anthony DiGirolamo
550f1e23ae pw_arduino_build: fix list-boards and list-menu-options
- was broken if library_* args are not set

Change-Id: Iad987dbfe843195eef4996f075d7b2a051ee8787
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24107
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-11-08 22:47:54 +00:00
Rob Mohr
9986bce8f5 pw_env_setup: Windows target support packages
Include target support packages when bootstrapping on Windows. This also
affects downstream projects that directly invoke Pigweed's
bootstrap.bat, including the sample project. Longer-term those projects
need to do something equivalent to the POSIX bootstrap.

Change-Id: Idf0bfe40d8611e2d2769604e67ee97a2730d6af8
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24106
Commit-Queue: Rob Mohr <mohrr@google.com>
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
2020-11-08 21:52:29 +00:00
Wyatt Hepler
ea02de82b3 pw_unit_test: Use canonical labels for group names
Use "label_no_toolchain" for group names so that the canonical GN labels
are used. Previously, group names were not formatted correctly
(//path/:target).

Change-Id: I9dc0f4637fe3ceaa16f53f2b15311dee8faebd35
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24081
Commit-Queue: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
2020-11-08 17:59:54 +00:00
Wyatt Hepler
a7e4977645 pw_tokenizer: tail -f functionality for detokenize
- Add -f/--follow option to pw_tokenizer.detokenize, which gives similar
  behavior to tail -f.
- Default to requiring at least one database file at the command line.

Change-Id: I56813ba0e7706a121acff1f1d9c2ea2d9c64c7cd
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24056
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-11-08 08:24:24 +00:00
pigweed-roller
aed1a72693 roll: gn
From: git_revision:0310dbe8411c76e7f17643fbe28436cf1391c2ec
To: git_revision:fe9e5db149b0cc78e03511d52c452039dbf5ac1b

CQ-Do-Not-Cancel-Tryjobs: true
Roller-URL: https://ci.chromium.org/b/8864223001542502176
Cq-Cl-Tag: roller-builder:gn-roller
Cq-Cl-Tag: roller-bid:8864223001542502176
CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: Iaaba9f3c8f049fc79c5f09b09a2b5bd522a26cf9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24053
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-11-08 06:15:03 +00:00
pigweed-roller
48368f7cc7 roll: host_tools
From: git_revision:061f97248f98ae715ce46c23df5ff85b33908190
To: git_revision:00e773eafb943b25643d2e32b0d0af2f032426b3

CQ-Do-Not-Cancel-Tryjobs: true
Roller-URL: https://ci.chromium.org/b/8864245646063104256
Cq-Cl-Tag: roller-builder:host-tools-roller
Cq-Cl-Tag: roller-bid:8864245646063104256
CQ-Do-Not-Cancel-Tryjobs: true
Change-Id: I0225c20f20fc94479865c10714af4fb64558bd16
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24045
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-11-08 00:14:32 +00:00
Armando Montanez
1498e9b4f8 pw_protobuf_compiler: Windows fixes
Drive letters (`C:\...`) break parsing of the nanopb_out flag. Split it
into two separate flags for Windows compatibility.

Change-Id: I334708e74971cbefe1091bdaa088fa5e06d4f1f4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24023
Commit-Queue: Armando Montanez <amontanez@google.com>
Pigweed-Auto-Submit: Armando Montanez <montanez.armando.l@gmail.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2020-11-07 23:40:32 +00:00
Armando Montanez
9bce5c20a8 pw_env_setup: Add Windows py launcher
Some tools (nanopb) launch python using `py -3`. Pigweed doesn't
provide a full py launcher, so this is a stopgap change to add a
stub that should support scripts that launch python using the py
launcher.

Change-Id: Ibed1ae2ca79ef3c9698056c04110a1ab82d825c7
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24022
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
Pigweed-Auto-Submit: Armando Montanez <montanez.armando.l@gmail.com>
2020-11-07 05:10:49 +00:00
Keir Mierle
6909f18e6b pw_sys_io: Add TryReadByte(byte* dest) function
This adds a non-blocking version of ReadByte() that enables writing, for
example, a superloop that combines custom processing simultaneously with
byte input handling for the RPC subsystem.

Change-Id: I9cb1e6ae8c944ca7cdff6d4bff101ac52e80b53a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/23980
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Keir Mierle <keir@google.com>
2020-11-07 01:17:28 +00:00