SQLite Upgrade Guide
Overview
Perfetto depends on SQLite internals:
- SQLite grammar processing via the syntaqlite library
- Internal SQLite constants and structures
Upgrade Procedure
Prerequisites
Only upgrade when Chrome, Android, and Google3 all support the target SQLite version.
Steps
Update version references:
tools/install-build-deps- update SQLite version/hashbazel/deps.bzl- update SQLite version/hash
Regenerate the PerfettoSQL parser:
python3 tools/gen_syntaqlite_parserBuild 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
tools/install-build-deps- SQLite version/hashbazel/deps.bzl- SQLite version/hashtools/gen_syntaqlite_parser- Parser regeneration script
Generated (Don't Edit)
src/trace_processor/perfetto_sql/syntaqlite/syntaqlite_perfetto.csrc/trace_processor/perfetto_sql/syntaqlite/syntaqlite_perfetto.h
Grammar Sources (Edit These)
src/trace_processor/perfetto_sql/syntaqlite/perfetto.y- Perfetto dialect grammarsrc/trace_processor/perfetto_sql/syntaqlite/perfetto.synq- AST node definitions
Rollback
- Revert version changes in
tools/install-build-depsandbazel/deps.bzl - Re-run
python3 tools/gen_syntaqlite_parser - Rebuild