Fix all instances of
https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#unsorted-dict-items
in upstream Pigweed.
This change was auto-generated by adding unsorted-dict-items to the list
of warnings fixed by `pw format` (see followup change), and then running
`pw format --fix`.
Bug: 340637744
Change-Id: Ifa238c23f4ca9547c073389690607a040626966f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/209880
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Ted Pudlik <tpudlik@google.com>
Select compatible targets via the constraint for the backend instead of
limiting to only hosts. There are embedded use cases where stdio output
makes sense (semi-hosting/simulators/etc).
Change-Id: I1d99dc054c808c8cfa1202422a596b210a745a18
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/208511
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Commit-Queue: Austin Foxley <afoxley@google.com>
References to `string_view` are nearly always unnecessary indirection.
Additionally, this CL clarifies that pw_sys_io WriteLine arguments do
not need to be null-terminated.
Fix: b/334933335
Fix: b/279159436
Change-Id: I13e0f8ad65d070e8363888242bc1a9b962be64ec
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/204591
Reviewed-by: Wyatt Hepler <hepler@google.com>
- Define pw_log_basic, and pw_sys_io facades as cc_defaults.
- Define the pw_sys_io_stdio backend as cc_static_library
following the new guidance at: https://pigweed.dev/pw_build_android/.
Bug: 328503970
Test: presubmits in Android main pass
Change-Id: I88cc3e52d89d009e2dea23dfb0fa809e7905adf0
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/199034
Commit-Queue: Carlos Chinchilla <cachinchilla@google.com>
Pigweed-Auto-Submit: Carlos Chinchilla <cachinchilla@google.com>
Reviewed-by: Cindy Liu <hcindyl@google.com>
Reviewed-by: Matthew Sedam <matthewsedam@google.com>
This change was automatically generated by running,
buildozer 'set kind cc_library' ...:%pw_cc_library
buildozer 'fix unusedLoads' ...:__pkg__
The first command converted all `pw_cc_library` targets to `cc_library`.
The second removed the (now unused) loads of `pw_cc_library` from the
affected BUILD.bazel files.
This change is just a no-op cleanup, since `pw_cc_library` became an
alias for `cc_library` in http://pwrev.dev/178924.
Bug: 267498492
Change-Id: Iefcc21fc5819a21612bbaffaafd1ffbec42faa26
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/186763
Reviewed-by: Armando Montanez <amontanez@google.com>
Pigweed-Auto-Submit: Ted Pudlik <tpudlik@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Adds a constraint_setting associated with the pw_sys_io facade, and
constraint_values for the backends for this facade provided by Pigweed.
Also documents how this mechanism should be used.
pw_sys_io is just the first facade to receive this treatment: the rest
will be handled in followup CLs.
Bug: b/272090220
Change-Id: Id1f670ce194757f4ccfe489e0f29ac936f36a1ab
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/133290
Reviewed-by: Erik Gilling <konkers@google.com>
Commit-Queue: Ted Pudlik <tpudlik@google.com>
Reviewed-by: Kayce Basques <kayce@google.com>
Updates pw_add_library to replace pw_add_module_library where
the library type must be explicitly specified, just like
pw_add_library_generic.
Migrates all pw_add_module_library uses to pw_add_library.
Change-Id: I62efdeca1e227a3c82667cac5e46fe383c280cc2
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/119318
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
- Allow empty pw_test_group targets.
- Create empty pw_test_group targets for modules that need them.
- Create stub docs pages for modules that are missing them.
- Require odules to provide "tests" and "docs" targets by assuming
they're present in the module list generation code.
- Update the generated modules list.
Change-Id: I5a67741afa0a8a5d2e2ba508435027f750a471c4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/103487
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
This changes uses of std::span to pw::span. No changes are made to build
dependencies in this commit.
This change was made with the following shell script:
#!/bin/bash
readonly FILES="$(git ls-files '*.rst' '*.md' '*.h' '*.cc' '*.py')"
readonly PW_NS_FILES="$(git grep -l 'namespace pw\>' | grep -v generate_decoding_test_data.cc)"
echo "Updating #includes"
sed -i --follow-symlinks \
's/#include <span>/#include "pw_span\/span.h"/g' ${FILES}
for name in span as_bytes as_writable_bytes dynamic_extent; do
echo Renaming std::$name to pw::$name
sed -i --follow-symlinks "s/std::$name/pw::$name/g" ${FILES}
sed -i --follow-symlinks "s/pw::$name/$name/g" ${PW_NS_FILES}
sed -i --follow-symlinks "s/using $name;//" ${PW_NS_FILES}
done
git checkout pw_span
pw format -b origin/main --fix
Bug: b/235237667
Change-Id: I32edfbcb7cadf3ab39009596fdb7275fcc5ea3f5
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/98264
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
These are likely incomplete but not incorrect.
Change-Id: Ie6a240fccea8c7f61420ed684b649390d3eb840f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/67140
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Keir Mierle <keir@google.com>
We get warnings when these are imported into google3.
Change-Id: I8daaef65c3ae35d81e75815460d659b53c122ee3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/50580
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Keir Mierle <keir@google.com>
Switches over all packages that were previously working with Bazel
to use the new facades API. In the process of doing this a few new
modules where newly compatible with Bazel. This is reflected in the
changes to the presubmit.
Change-Id: I12aa67fa43b9ac2b947f33814f901dd00f929543
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/41561
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Akira Baruah <akirabaruah@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Keir Mierle <keir@google.com>
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>
- 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>
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>
Replace pw::span with std::span and "pw_span/span.h" with <span>
throughout the codebase.
Change-Id: Ib1fa873168b6093794e861611d750fcad6285d6c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12801
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
This change configures the Linux clang -Og target as a toolchain with
args. To support this, all Pigweed variables from pw_vars_default are
made into build args, defined within their respective modules.
The Linux clang target/toolchain is the only one that currently works.
Pigweed's other targets will be ported in later changes.
Change-Id: I051e29fde7577e41a3184c37031a4e04936404e1
Require targets to explicitly import pigweed variable definitions. This
moves out some necessary logic from the BUILDCONFIG.gn file.
Change-Id: If9c9fe5a680cc9d897a0e8a55889873be618ed84
This change replaces the implicit overrides of the default GN target
types in BUILDCONFIG.gn with explicit pw_* versions. This is done to
allow Pigweed to build within larger GN projects without modifying their
BUILDCONFIG files.
Change-Id: I1d1e41d5e9bde8fe076f7031f3c2b98b9630ff70