SQLite Upgrade Guide

Overview

Perfetto depends on SQLite internals:

Upgrade Procedure

Prerequisites

Only upgrade when Chrome, Android, and Google3 all support the target SQLite version.

Steps

  1. Update version references:

    • tools/install-build-deps - update SQLite version/hash
    • bazel/deps.bzl - update SQLite version/hash
  2. Regenerate the PerfettoSQL parser:

    python3 tools/gen_syntaqlite_parser
  3. Build and test:

    tools/ninja -C out/linux_clang_release trace_processor_shell perfetto_unittests out/linux_clang_release/perfetto_unittests --gtest_filter="*Sql*" tools/diff_test_trace_processor.py out/linux_clang_release/trace_processor_shell --quiet

Common Issues

SQLite Internal API Changes

Error: Compilation errors in sqlite_utils.h or sqlite/bindings/*.h

Fix: Update bindings for SQLite API changes

Key Files

Always Review

Generated (Don't Edit)

Grammar Sources (Edit These)

Rollback

  1. Revert version changes in tools/install-build-deps and bazel/deps.bzl
  2. Re-run python3 tools/gen_syntaqlite_parser
  3. Rebuild