- 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>
In general toolchains should set values for the builtin arguments
current_cpu and current_os; this configures both the toolchain itself
and everything it builds. Make it so in Pigweed.
If there's a toolchain with current_os = "ios", use the arguments for
Apple's linker.
Bug: 241
Change-Id: I2ce8c46eb48cbc70c5d14086934bdf59c2fc3f36
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/16006
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Michael Spang <spang@google.com>
This change creates a Pigweed third_party directory and defines a GN
build file for nanopb which exposes a pw_source_set for the nanopb
library from a build arg pointing to a local nanopb installation.
Change-Id: I6779203626abce7821dc3fcef6dcbc11c319b43c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/15763
Reviewed-by: Keir Mierle <keir@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>
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>
Fixes some errors and some stale references and formats.
Change-Id: I5a2f6d4a20591b61ae49eaab3310dc7abf51d83d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/14122
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Updates syntax for using pw_watch in a few other locations.
Change-Id: I599fc3cb552c75e9f546447556fb756633093391
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/13804
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Armando Montanez <amontanez@google.com>
Updates pigweed to depend directly on is_host_toolchain provided by the
toolchain. Also adds a toolchain option that controls the extension of
final linked binaries.
Change-Id: Ia9499fe5974997a5bbc0bb9cfb89b5569b987189
This checks if the project has already set the nanopb protobuf generator
before adding it as part of the host target.
Change-Id: I1336d73bdcbcb786bf783909b32230bebf10bdba
Update the host toolchains to be prefixed with their target name and use
a slightly more compact style to define the toolchain scopes.
Change-Id: Ib0dae237299e74c6c48cd4c35869fd215563a7bf
Sets up clang and gcc based toolchains for all host target builds.
Defaults to using Clang for linux/mac and GCC for windows.
Change-Id: I1a15d98581cbf886fbb86321f2d7dabb0dd43cf1
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 adds support for compiling nanopb protobufs using
pw_protobuf_compiler.
The pw_protobuf_langs build variable is renamed to
pw_protobuf_generators as there is no longer a 1:1 mapping of languages.
To compile nanopb, add the "nanopb" generator to pw_protobuf_generators.
The build variable $dir_third_party_nanopb must be set to point to a
local installation of nanopb with GN support:
https://github.com/frolv/nanopb/tree/gn-build
The host build will run a test which compiles nanopb code if
$dir_third_party_nanopb is set.
Change-Id: I29bf8780644917f35203a538b0bd7e4f3ec40180
Adds target docs for the `docs` and `host` builds. Also includes a few
other documentation updates.
Change-Id: Icc973d6d51707c79b7c506d89c8975023e274ef2
- The scripts in .python3-env/bin use a shebang line to point to
Python. If the Python path has spaces, this line will not work
correctly. Until this can be fixed, abort bootstrap.sh if Pigweed's
path has spaces.
- Quote expansions in environment setup to prepare for eventually
allowing paths with spaces.
Change-Id: I85333bd930e03731e5ae093c5f63b6a2a26c6316
Renames host.gni to target_config.gni so all targets have a
target_config.gni, and it's clear which .gni file to use for target
configuration.
Change-Id: I1bd0442a9dc00201bff46eb776a4a59c1d339a4e
This makes Windows consistent with the other host platforms and this
behavior is required by CI builds.
Change-Id: I35b3df2d82364d3d43f6c334e71e7bef8d8a0f4d
This change configures the Windows host target for GN. It should allow
building unit tests for the host.
Change-Id: Ib92c9a83b9b858a9b7ed55487199c63896580af1
This starts a logging module facade, with a frontend and a dumb IO based
backend. The initial version is lacking many features, like an API to
control enabling or disabling logs.
Change-Id: I3075aed33d9600a1190ca5237b5f7cfcfdc8f2ed
This change moves building documentation out of the host and disco targets
into a special docs target.
The presubmit script is updated to handle the docs target.
Change-Id: I975170c9e8941d126d85a391c0f3b355e4fa44dd
This defines pw_build_host_tools as a GN build arg, allowing it to be
toggled without changing the host target.
Change-Id: I9b053b26e4deffc04885015c6981496bb857ee33
This change moves the pw_build_host_tools variable from host.gni to
host_common.gni, where it belongs.
Change-Id: I8f7188900344d9ce7cff33a99b8725d5347b9b02
This change cerates a GN template called pw_host_tool which copies a
binary target to a common host_tools directory that can be added to a
user's PATH.
Change-Id: I9eb38ab4ff9d11a4a87e6be2547d5224370e3412
This change adds functionality to the test runner script to search a
directory tree for generated test metadata files, build up a graph of
test groups, and run a user-specified list of groups with all of their
dependencies.
Tests are run through an external runner executable provided on the
command line. The executable is called with the path to a unit test
binary file.
The old test runner functionality to run a single test directly from its
binary path is maintained, but now uses a runner executable. This is
configured in GN using the build variable "pw_automatic_test_runner",
which replaces the functionality of "pw_unit_test_create_run_targets".
Change-Id: Ic1ed959d87a71266408e1f26e0ae1bf906eebfb0
This fixes the macOS host build by adding a bloaty config. However, the
bloaty config isn't quite right; followup work will be needed to decide
if it makes sense to have Mach-O bloat reports.
Change-Id: I4148c85d73a1b8dbd02b1772688259dbe59e950e
This change introduces the pw_dumb_io module, a module intended for
pigweed testing and bringup. pw_dumb_io includes a facade, and a backend
implementation using stdio (pw_dumb_io_stdio).
Change-Id: I5d9ca3c256c7e7c6d60cc07292aaead808a7f3dd
This change adds a size reporting module named pw_bloat. The module
uses Bloaty McBloatface to generate size report cards for binaries. It
provides a GN template which defines an action to perform a size diff
on a group of binary targets.
Example output:
simple_bloat
────────────
┌────────────────┬──────────────┬────────┬───────┬───────┐
│ Label │ Segment │ Before │ Delta │ After │
├════════════════┼══════════════┼════════┼═══════┼═══════┤
│ Add a loop │ EXAMPLE CODE │ 429 │ +32 │ 461 │
│ │ EXAMPLE RAM │ 576 │ +8 │ 584 │
├────────────────┼──────────────┼────────┼───────┼───────┤
│ Add a function │ EXAMPLE CODE │ 429 │ +16 │ 445 │
│ │ EXAMPLE RAM │ 576 │ +8 │ 584 │
└────────────────┴──────────────┴────────┴───────┴───────┘
Change-Id: I14b3d383ec450bc6d017bf5d0111e266b0a3c368
- Move pw_unit_test_create_run_targets to pw_vars_default.gni so that
targets can set it.
- Keep the default false, but set it to true for the host targets.
Change-Id: Ia1af584642d0dd4d16b801b2ee4a8bb1a78c286e
- Update host_clang to work on Linux: switch to -Map and --gc-sections
options
- Make pw_target_toolchain a build arg for Linux and macOS targets.
Default to gcc on Linux, clang on macOS.
- Rename x86_linux_gcc to host_gcc.
Change-Id: I72eef9ba9398a331f6567b68ad404092186eb15b
This adds a generic host_clang toolchain, targeting hosts running Mac and
Linux to start, and likely Windows later.
For now, on Mac the default toolchain is set to host_clang_og
Change-Id: Iea457c61586930d509439c6616574c9a74919433
This change defines the build target system used by Pigweed, where the
build is configured using per-target globals imported from a target .gni
file. A single build arg specifying the path to the target file replaces
the previous args.
A default build variables file is provided in the Pigweed root. This
file defines and documents all of the build variables used by Pigweed.
A top-level targets directory is added to define the targets used by
Pigweed developers. Currently, only a "host" target is added, which
configures the build for a development system based on the host OS.
Change-Id: Ie62b8d41e5789bfe7fffe20462160142c79076c4