Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
cede70f
Add GCC example: build GMP, MPFR, MPC from source
typeless Feb 10, 2026
bf84476
Extend GCC example: build cc1 C compiler from source
typeless Feb 13, 2026
c308348
Build genmatch from source, eliminating pre-generated match files
typeless Feb 13, 2026
701fb6f
Fix generator paths, config headers, and library builds for 3-tree mode
typeless Feb 13, 2026
7123961
Add project skills for Tupfile patterns and GCC example
typeless Feb 13, 2026
b5eab6e
Build full GCC cross-compiler toolchain
typeless Feb 14, 2026
39f53d8
Support $$ escape and config-tree overlay for external packages
typeless Feb 19, 2026
869c7f7
Add cross-binutils (as + ar) as first external package
typeless Feb 19, 2026
37c125c
Fix GCC dep scanner regex to match -c as first argument
typeless Feb 19, 2026
011bf31
Add groups_cross_dir_3tree fixture for 3-tree cross-directory group test
typeless Feb 21, 2026
609f01f
Remove scheduler workaround for missing source directories in 3-tree …
typeless Feb 21, 2026
43b1d0c
Flatten examples/ into a BSP with gcc/ and binutils/ tarball groups
typeless Feb 22, 2026
37cbdc5
Fix 3-tree build issues and clean up GCC example for Linux host
typeless Feb 26, 2026
af9a6b5
Add build-gcc-bsp CI job for end-to-end BSP validation
typeless Feb 26, 2026
7518229
Slim clang-tidy config and drop LLVM 21 CI install
typeless Feb 26, 2026
06480a0
Fix stale docs after BSP flattening and toolchain expansion
typeless Feb 26, 2026
ed04516
Move BSP into examples/bsp/ to fix CI ghost node failure
typeless Feb 27, 2026
5eb445f
Move busybox out of BSP scan tree to fix CI ghost node
typeless Mar 3, 2026
80163ce
Skip DEP generation for compound shell commands
typeless Mar 3, 2026
d3dc59d
Fix binutils config for modern glibc
typeless Mar 3, 2026
294c906
Add HAVE_SYS_RESOURCE_H to binutils config
typeless Mar 4, 2026
e7b68d7
Make install_source_configs respect .pupignore
typeless Mar 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
233 changes: 55 additions & 178 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,194 +1,81 @@
---
# clang-tidy configuration for uld_cpp
# Based on Ladybird browser config, adapted for C++11 embedded/AOSP project
# clang-tidy configuration for putup
#
# Approach: allowlist high-value checks, skip expensive analysis families.
# Modeled after DuckDB (allowlist + cherry-pick) and Ladybird (no clang-analyzer
# in CI). See https://github.com/duckdb/duckdb and
# https://github.com/LadybirdBrowser/ladybird for reference.
#
# Families enabled in full: bugprone, cert, concurrency, misc, performance,
# portability, readability (with selective exclusions below).
# Families cherry-picked: modernize (6 checks), cppcoreguidelines (7 checks).
# Families omitted:
# clang-analyzer-* — path-sensitive symbolic execution; 10x slower than all
# other checks combined. DuckDB omits it; Ladybird only uses it locally.
# google-* — style rules for Google's C++ guidelines, not our style.
#
# =============================================================================
# DISABLED CHECKS RATIONALE
# =============================================================================
#
# bugprone-easily-swappable-parameters:
# This check warns when adjacent function parameters have similar types and
# could be accidentally swapped by callers. While the warning is valid, it's
# extremely noisy and the suggested fix (wrapping in structs) adds complexity.
# Example: void foo(int width, int height) triggers this warning.
#
# bugprone-macro-parentheses:
# Warns when macro arguments aren't parenthesized in expansion. Our ALOGE/ALOGI
# logging macros use variadic arguments that can't be parenthesized. Ladybird
# also disables this for code-generating macros.
#
# bugprone-reserved-identifier, cert-dcl37-c, cert-dcl51-cpp:
# These warn about identifiers starting with underscore or containing double
# underscores. System headers and OpenSSL headers legitimately use these.
# cert-dcl37-c and cert-dcl51-cpp are aliases for bugprone-reserved-identifier.
#
# cert-err33-c:
# Requires checking return values of certain C functions including fprintf().
# Our logging macros (ALOGE, ALOGI, etc.) expand to fprintf() calls where
# ignoring the return value is intentional - logging failures shouldn't crash.
#
# cert-err58-cpp:
# ENABLED: Warns about exceptions in static object constructors. This project
# doesn't use exceptions, so no warnings expected.
#
# concurrency-mt-unsafe:
# Flags functions like strerror(), localtime(), getenv() as thread-unsafe.
# This project is single-threaded and these are standard C idioms. Using
# thread-safe alternatives (_r variants) would reduce portability.
#
# misc-const-correctness:
# Suggests adding const to variables that could be const. While good practice,
# enabling this generates hundreds of warnings requiring significant refactoring
# with minimal practical benefit for this codebase.
#
# misc-include-cleaner:
# Analyzes whether includes are necessary. Very noisy, reports many false
# positives, and the suggested changes often break compilation due to
# transitive includes.
#
# misc-no-recursion:
# Warns about recursive function calls. This project intentionally uses
# recursion for tree traversal and nested data structure parsing.
#
# misc-non-private-member-variables-in-classes:
# Warns when classes have non-private member variables. This project uses
# POD-style structs (CAPHeader, FileInfo, etc.) where public members are
# appropriate. The CheckOption IgnoreClassesWithAllMemberVariablesBeingPublic
# handles most cases but some edge cases remain.
#
# misc-unused-parameters:
# Warns about unused function parameters. These are not a security or safety
# concern. Some parameters are intentionally unused in stub implementations
# or virtual method overrides where the signature is fixed.
#
# misc-use-anonymous-namespace:
# Suggests using anonymous namespaces instead of static for internal linkage.
# We prefer static for C++11 compatibility and consistency with existing code.
# Anonymous namespaces can cause issues with some debuggers.
#
# modernize-avoid-c-arrays:
# Suggests replacing C arrays with std::array. This project uses fixed-size
# C arrays intentionally for protocol buffers, crypto operations, and embedded
# compatibility. std::array adds overhead and isn't always available on AOSP.
#
# modernize-use-auto:
# ENABLED: We now use auto declarations where the type is clear from context
# (e.g., auto it = container.begin(), auto result = SomeFunction()).
# Explicit types are still preferred for numeric types where precision matters.
#
# modernize-use-trailing-return-type:
# ENABLED: We now use trailing return type syntax (auto foo() -> ReturnType)
# for consistency with modern C++ style and better readability with complex
# return types.
#
# modernize-raw-string-literal:
# Suggests R"(...)" for strings with escapes. Not always clearer, especially
# for short strings, and can hurt readability for strings with mixed content.
#
# performance-enum-size:
# Suggests using smaller base types for enums (int8_t instead of int). While
# this could save memory, enums in this project are not in hot paths or large
# arrays where size matters. The default int size aids debugging.
#
# performance-trivially-destructible:
# Suggests defaulting empty destructors in class definitions to make them
# trivially destructible. While technically correct, explicit destructor
# declarations document intent and allow future extension.
#
# performance-no-int-to-ptr:
# Warns about integer-to-pointer casts. Low-level serial and crypto code
# sometimes requires legitimate pointer arithmetic. This check is overly
# broad for systems programming.
#
# performance-noexcept-move-constructor:
# Suggests adding noexcept to move constructors. This project doesn't use
# exceptions (-fno-exceptions on AOSP), so noexcept provides no benefit
# and adds visual noise.
#
# readability-braces-around-statements:
# ENABLED: Project style now requires braces around all if/for/while bodies
# for consistency and to prevent bugs from later additions.
#
# readability-convert-member-functions-to-static:
# Suggests making member functions static when they don't use 'this'. This
# is a design choice - keeping methods as non-static preserves API flexibility
# and allows future refactoring to use member state without API changes.
#
# readability-else-after-return:
# Warns about using 'else' after a return statement. While early return can
# be cleaner, explicit else blocks can improve readability by making all
# branches visually parallel, especially in switch-like if/else chains.
#
# readability-function-cognitive-complexity:
# Measures function complexity and warns above threshold. Complex functions
# in crypto and protocol parsing are sometimes unavoidable. Warnings are
# hard to fix without artificial refactoring that hurts readability.
#
# readability-function-size:
# Warns when functions exceed size thresholds. Crypto functions (OAEP,
# decryption) and protocol parsers are inherently complex and can't be
# split without hurting readability. Test runners also legitimately large.
#
# readability-identifier-length:
# Warns about short variable names (i, n, fd, etc.). These are idiomatic
# in C/C++ for loop indices, counts, and file descriptors. Longer names
# would hurt readability in tight loops.
#
# readability-implicit-bool-conversion:
# Warns about implicit conversions to bool (if (ptr) instead of if (ptr !=
# nullptr)). The implicit form is idiomatic C++ and often clearer.
#
# readability-magic-numbers:
# Warns about numeric literals in code. Despite recent cleanup to add named
# constants, many legitimate magic numbers remain (bit shifts, protocol
# offsets, etc.) where inline numbers are clearer than constants.
#
# readability-named-parameter:
# Requires naming all function parameters. We intentionally omit names for
# unused parameters to satisfy -Wunused-parameter: void foo(int /*unused*/)
#
# readability-simplify-boolean-expr:
# Suggests applying DeMorgan's theorem to simplify boolean expressions. While
# mathematically equivalent, the original form (explicit range checks like
# c >= '0' && c <= '9') is often more readable than the transformed version.
#
# readability-make-member-function-const:
# Suggests making member functions const when they don't modify member
# variables. This produces false positives for I/O methods that don't
# modify class state but have observable side effects (serial reads/writes,
# file operations). The check can't detect that calling read()/write()
# on a file descriptor has side effects.
#
# readability-uppercase-literal-suffix:
# Suggests 1UL instead of 1ul for literal suffixes. Low priority style issue
# with many occurrences. Can be enabled later for incremental cleanup.
# bugprone-easily-swappable-parameters: too noisy, fix adds complexity
# bugprone-macro-parentheses: variadic macros can't parenthesize args
# cert-err33-c: fprintf return values in logging are intentionally ignored
# concurrency-mt-unsafe: single-threaded project, standard C idioms fine
# misc-const-correctness: hundreds of warnings, marginal benefit
# misc-include-cleaner: noisy false positives, breaks transitive includes
# misc-no-recursion: intentional recursion for tree traversal / parsing
# misc-non-private-member-variables-in-classes: POD structs use public members
# misc-unused-parameters: intentional in stubs and virtual overrides
# performance-enum-size: not in hot paths; default int aids debugging
# performance-no-int-to-ptr: legitimate in low-level pointer arithmetic
# performance-noexcept-move-constructor: no exceptions in this project
# readability-convert-member-functions-to-static: design choice for API flex
# readability-function-cognitive-complexity: unavoidable in parsers
# readability-function-size: large functions in parsers are sometimes clearest
# readability-identifier-length: short names (i, n, fd) are idiomatic C++
# readability-implicit-bool-conversion: if (ptr) is idiomatic
# readability-magic-numbers: inline numbers often clearer than constants
# readability-make-member-function-const: false positives on I/O methods
# readability-named-parameter: intentionally omitted for unused params
# readability-redundant-member-init: explicit init documents intent
# readability-simplify-boolean-expr: explicit range checks are more readable
#
# =============================================================================

Checks: >
bugprone-*,
cert-*,
clang-analyzer-*,
-clang-analyzer-core.uninitialized.Assign,
concurrency-*,
misc-*,
modernize-*,
performance-*,
portability-*,
readability-*,
-bugprone-easily-swappable-parameters,
-bugprone-macro-parentheses,
cert-*,
-cert-err33-c,
concurrency-*,
-concurrency-mt-unsafe,
cppcoreguidelines-avoid-non-const-global-variables,
cppcoreguidelines-interfaces-global-init,
cppcoreguidelines-pro-type-const-cast,
cppcoreguidelines-pro-type-cstyle-cast,
cppcoreguidelines-rvalue-reference-param-not-moved,
cppcoreguidelines-slicing,
cppcoreguidelines-virtual-class-destructor,
misc-*,
-misc-const-correctness,
-misc-include-cleaner,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-misc-unused-parameters,
-modernize-raw-string-literal,
modernize-use-auto,
modernize-use-bool-literals,
modernize-use-emplace,
modernize-use-nullptr,
modernize-use-override,
modernize-use-trailing-return-type,
performance-*,
-performance-enum-size,
-performance-no-int-to-ptr,
-performance-noexcept-move-constructor,
portability-*,
readability-*,
-readability-convert-member-functions-to-static,
-readability-function-cognitive-complexity,
-readability-function-size,
Expand All @@ -199,12 +86,6 @@ Checks: >
-readability-named-parameter,
-readability-redundant-member-init,
-readability-simplify-boolean-expr,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-reinterpret-cast

WarningsAsErrors: ''

Expand All @@ -219,9 +100,5 @@ CheckOptions:
value: 'true'
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: true
- key: readability-function-size.LineThreshold
value: 200
- key: readability-function-size.StatementThreshold
value: 400
- key: modernize-use-trailing-return-type.AllowOverridingMethods
value: true
Loading