redirected execution daemon
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
libred
red
CMakeLists.txt
COPYING
ChangeLog.md
PKGBUILD
README.md

README.md

Red

Red is a tool for generating a tree of subprocess invocations for a command. It is forked from LibEAR.

How to build

Red should be quite portable on UNIX operating systems. It has been tested on FreeBSD, GNU/Linux and OS X.

Prerequisites

  1. an ANSI C compiler, to compile the sources.
  2. cmake, to configure the build process.
  3. make, to run the build. The makefiles are generated by cmake.
  4. python is a runtime dependency. The red command is written in Python. (version >= 2.7)

Build commands

Ideally, you should build Red in a separate build directory.

cmake $RED_SOURCE_DIR
make all
make install # to install
make check   # to run tests
make package # to make packages

You can configure the build process with passing arguments to cmake.

How to use

After installation the usage is like this:

red make

The output file called compile_commands.json found in current directory.

For more options you can check the man page or pass --help parameter.

Known issues

Environment overriding caused problems

Because Red uses LD_PRELOAD or DYLD_INSERT_LIBRARIES environment variables, it does not append to it, but overrides it. So builds which are using these variables might not work. (I don't know any build tool which does that, but please let me know if you do.)

Empty compilation database on OS X Captain or Fedora

Security extension/modes on different operating systems might disable library preloads. This case Red behaves normaly, but the result compilation database will be empty. (Please make sure it's not the case when reporting bugs.) Notable examples for enabled security modes are: OS X 10.11 (check with csrutil status | grep 'System Integrity Protection'), and Fedora, CentOS, RHEL (check with sestatus | grep 'SELinux status').

Workaround could be to disable the security feature while running Red. (This might involve reboot of your computer, so might be heavy workaround.) The other option could be to use tools which are using compiler wrappers. (It inject a fake compiler which does record the compiler invocation and calls the real compiler too.) An example for such tool might be scan-build. The build system shall respect CC and CXX environment variables.