Skip to main content

Introduction

compdb is a command line tool to manipulates compilation databases. A compilation database is a database for compile options, it has records of which compile options are used to build the files in a project. An example of compilation database is the JSON Compilation Database

compdb aims to make it easier for you to run tools on your codebase by spoon-feeding you the right compile options.

compdb is not so much about generating the initial compilation database, this, is left to other tools, such as cmake and ninja. It is only a glue between the initial compilation database and your tool(s).

Motivation

With the proliferation of Clang-based tools, it has become apparent that the compile options are no longer useful uniquely to the compiler.

Standalone tools such as clang-tidy or text editors with libclang integration have to deal with compile options.

Examples of such tools, dealing with compilation databases are: irony-mode, rtags and ycmd.

Based on this evidence, compdb came to life. A tool that has knowledge of the compile options and can share it both to inform the text editor and to run clang based tool from the shell.

Getting started

Installation

Install with pip:

pip install compdb

From Github, as user:

pip install --user git+https://github.com/Sarcasm/compdb.git#egg=compdb

Generate a compilation database with header files

Assuming a build directory build/, containing a compile_commands.json, a new compilation database, containing the header files, can be generated with:

compdb -p build/ list > compile_commands.json

Running the tests

To run the tests, type:

python -m tests

Or:

tox --skip-missing-interpreters

For regression tests on a few open source projects:

cd tests/regression/headerdb
make [all|help]

Contribute

Contributions are always welcome!

Try to be consistent with the actual code, it will ease the review.

License

This project is licensed under the MIT License. See LICENSE.txt for details.

Acknowledgments

  • repo: for its ubiquitous command line interface, which served as an inspiration

  • scan-build: for the clear Python package design

  • git: for the git-config API

  • julio.meroh.net: for the interesting article serie on CLI design

Metadata

Release files for compdb 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for compdb 0.2.0
File Size Uploaded Provenance
compdb-0.2.0.tar.gz 21.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for compdb 0.2.0
File Interpreter ABI Platform
compdb-0.2.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 47.5 kB

Release files / compdb-0.2.0.tar.gz

Download URL compdb-0.2.0.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
73471badd01e5e69c816fb3a4e0d014f099c2826ee283df5716cd7b1902b79dd
BLAKE2b-256 checksum
How to use checksums
7a14979e6c597d5e5c106462f98c6373e7684f5a771a73e10cef59eb9fce3f93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / compdb-0.2.0-py2.py3-none-any.whl

Download URL compdb-0.2.0-py2.py3-none-any.whl
Size 26.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
f63b87d36a50b984a654dea1c782066cf659cad66d9b37e2d06cede7d0737b91
BLAKE2b-256 checksum
How to use checksums
1960009b092d1664e20c8726dbead6aa0093747fca23ae85b7d7a5fc3c4c22e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for compdb 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page