Skip to main content

A catch-all compile-tool wrapper

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

canker

CI

canker is a catch-all compile tool wrapper.

Usage

$ pip3 install canker
$ eval $(canker-env --guess-wrapped)
$ export CANKER_ACTIONS="Record"
$ export CANKER_ACTION_RECORD="output=/tmp/demo.jsonl"
$ cd /your/project && make
$ cat /tmp/demo.jsonl

Goals

  • Wrapping CC, CXX, CPP, LD, and AS.
  • Providing a visitor-style API for each of the above, pre- and post-execution.
  • Providing a nice set of default actions.
  • Being as non-invasive as possible.

Anti-goals

  • Using LD_PRELOAD to capture every exec in a build system, a la Bear.
  • Supporting cl.exe.
  • Detailed support for non C/C++ languages.
  • Parsing arguments that are passed via @file.

Contributing a new action

New canker actions are easy to write. For example, the following prints a message before every ld invocation:

# src/canker/actions/printld.py

from canker.action import LDAction


class PrintLD(LDAction):
    def before_run(self, tool):
        print(f"ld was run with: {tool.args}")
# src/canker/actions/__init__.py

# bring PrintLD into canker.actions so that `CANKER_ACTIONS` can find it
from printld import PrintLD  # noqa: F401
$ eval $(canker-env --guess-wrapped)
$ export CANKER_ACTIONS="PrintLD"
$ make

Check out canker's API documentation for more details, including the kinds of available actions.

The name?

My phone autocorrected "CMake" to "canker" once.

Canker is cognate with cancer, which is appropriate for both build systems and tools that instrument build systems (like canker does).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

canker-0.0.8.tar.gz (14.8 kB view details)

Uploaded Source

File details

Details for the file canker-0.0.8.tar.gz.

File metadata

  • Download URL: canker-0.0.8.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for canker-0.0.8.tar.gz
Algorithm Hash digest
SHA256 fda53e68c3fcc75f62de631cc2455f11878595707b3ac8ab2cd089b635810e00
MD5 ebbe47b3c1d4db140c5cb6ceba67fd1b
BLAKE2b-256 87a9cdce455870934e5832ee58488c0927bf8670a3f05bc070182f4f66fa1f14

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page